Back to blog
By the Lesscode team

Audit Log Retention: What Your SaaS Should Promise Customers

Audit Log Retention: What Your SaaS Should Promise Customers

“We keep your audit logs for a year” sounds like a complete product promise. It leaves several things unanswered: which events are included, whether the customer can search the whole year, how long an archive request takes, and what happens when the subscription ends.

For a SaaS product, audit log retention is the period during which recorded activity remains available under a defined policy. Choosing that period requires agreement about the investigations the history must support, the commitments made to customers, and how the records will be protected and eventually removed. A storage setting implements part of the decision. It cannot make the decision for the business.

This is a product and engineering guide for founders and growing teams, rather than a statement that any particular duration meets a regulatory requirement. Where a contract or applicable obligation sets a requirement, have the responsible adviser establish it before making a customer promise.

The number needs a reason

Start with the work someone will do with the history. A support specialist investigating yesterday's configuration change needs a short, readable path to the relevant event. An account administrator reviewing a quarterly access change needs an older record that still identifies the actor and the affected account. Those uses may justify different access arrangements, even when both depend on the same underlying evidence.

Ask the people who will use the history when they typically discover a problem and how far back they need to look. A team that reviews permissions every quarter should consider what happens when an issue is discovered at the end of that cycle. Keeping only the most recent few weeks could leave the important change outside the available window.

Customer commitments provide another input. Read the actual product description, security questionnaire responses and signed terms together. If they describe different periods, resolve that difference before changing infrastructure. A salesperson's statement that history is available “whenever you need it” should not quietly become an indefinite engineering obligation.

Then consider what is being kept. A compact record of a permission change has different sensitivity and storage characteristics from a complete request body. Longer retention increases the time during which stored information needs protection. Removing unnecessary contents at collection can be more useful than arguing over the lifetime of a much larger, more sensitive record.

The OWASP Logging Cheat Sheet recommends defining logging around requirements and avoiding direct storage of secrets and sensitive information that does not belong in the log. Its disposal guidance also covers copies, extracts and backups. There is no single duration on that page that a startup can adopt as a universal answer.

Searchable history and an archive are different services

A customer choosing a date in the product expects a result. An archive may require an operator to locate files, restore an index or run an export. Both can be useful, but they are different experiences.

Describe three things separately: how long events remain in the ordinary search interface, how long any additional archive is retained, and the process for obtaining archived information. Include who can request it and whether there is a retrieval delay. An archive that only one unavailable developer knows how to recover is a weak basis for a product commitment.

The distinction also changes cost discussions. Moving older events to cheaper storage can reduce one part of the bill while adding retrieval work, access controls and maintenance. A smaller team may prefer a shorter, clearly agreed searchable window over operating an archive it cannot support reliably. Another team may have a specific customer need that justifies both. Compare the complete service, including staff effort, rather than storage prices alone.

Check the experience with the actual expected record volume. Can an authorized administrator locate one older event without downloading the entire account history? Can the product filter by the affected resource and show an unambiguous time zone? These are proposed acceptance checks; no product testing was performed for this article.

Retention also depends on coverage. A year of available storage does not mean a year of evidence for an event type introduced last month. Publish when each relevant category began being recorded. If history is incomplete or delayed, the interface should make that visible so an empty search is not mistaken for proof that nothing happened.

A policy a customer can understand

Here is an illustrative policy outline for a hypothetical B2B application. It deliberately leaves the durations open; they must come from the team's requirements, not from an invented industry default.

Recorded activity: named administrative events, such as changes to team permissions and integration connections. The published event list explains coverage and its start dates.

Access window: the agreed recent period is searchable by authorized account administrators. Older retained events, if offered, are available through a documented archive-request process with a stated expected response time.

Expiry: events become eligible for removal according to the agreed period. The product documentation explains the scope and timing of removal, including relevant copies and the separate treatment of backups.

Account changes: the policy states what happens when the customer changes plans, closes the account or loses access to the product, and how an authorized customer can export available history beforehand.

That outline turns one vague sentence into decisions that product, engineering and support can implement. It still needs a defined owner, approved durations and review against the actual obligations of the business. It is not a legal template or a claim about Lesscode's own retention practices.

Be careful with the word “available.” If customers must retain their own exports to preserve history beyond your product's window, say so before that window expires. An export option is useful only while the underlying events can still be retrieved and the requester has the necessary access.

An export also becomes another copy. Limit who can generate and download it, explain the time period and filters it includes, and avoid putting sensitive record contents into a second log while recording the export itself. Once a customer downloads a file, your product no longer controls every copy of it.

Changing a retention setting changes the promise

Increasing a period cannot reconstruct records that have already been removed. A customer upgrading today should know whether the longer window applies to existing retained events, only to future activity, or to both where data is still available. Avoid displaying an earlier start date simply because the new plan allows a longer maximum period.

Shortening a period deserves deliberate handling. Identify the affected events, customer commitments and any authorized exceptions before enabling a removal job. Give the appropriate customers and operators a clear explanation of the change and its effective date. A routine configuration update should not unexpectedly erase the only evidence needed for an open investigation.

Actual deletion may also lag behind the configured expiry. For example, Amazon CloudWatch Logs documentation says logs are stored indefinitely by default unless retention is configured, and that deletion typically takes up to 72 hours after events reach the retention setting, sometimes longer. That is a documented behavior of that service, not a recommendation to use it as a customer-facing audit system.

The product implication is broader: understand what the selected storage platform actually does before promising exact removal times. A search filter that hides older events is not evidence that every stored copy has been deleted. Conversely, retained backups should not be described as an immediately searchable customer archive unless the product can provide that service.

Have the team explain how expiry, backup rotation and restoration interact. If an older backup is restored during recovery, how will expired records be handled before normal access resumes? The answer should follow the approved policy and the capabilities of the system. Do not rely on a deletion schedule that exists only for the main database.

Commission the whole feature

When requesting audit log retention from a development partner, ask for a short product specification that names the events, authorized readers, search period, archive arrangement, export behavior and removal process. Include how account closure and plan changes affect each promise. Those decisions provide a much clearer basis for an estimate than “add audit logs.”

The demonstration should follow one representative event through its lifetime: visible in recent search, retrievable through any promised archive route, and handled correctly when it expires. Use suitable sample data and controlled environments. Ask what evidence the team will provide and who will monitor a retention job that stops running. These are recommended delivery criteria, not claimed test results.

Account access deserves particular care when staff leave or responsibilities move. Lesscode's employee offboarding automation guide explains the related distinction between removing access and maintaining business continuity. Your history should remain available to the authorized business owner without keeping a departed person's login active.

For teams building custom AI software and SaaS applications, retention belongs in the product scope alongside permissions and support operations. Bring the investigation your customer needs to perform and the commitment you intend to make. That gives the engineering discussion a concrete destination: useful history for an agreed period, accessible in an agreed way, with a lifecycle the team can actually operate.

Cover: AI-generated conceptual illustration of searchable records and an archive.

Keep reading

Related articles.

New business / 2026

Have a process that should work better?

Bring us the bottleneck, the brittle build, or the idea. We'll give you a direct read on what to do next.