← Back

← All guides · Published November 13, 2026 · Reviewed November 13, 2026 · Ingenious AI team

How Long Should You Keep AI Agent Logs? An Audit-Trail Retention Guide

The short answer

Keep agent logs long enough to investigate an incident you discover late — and no longer. For many operators a workable policy choice is 90 days of raw logs in a hot, searchable tier and a total retention of 13 months, which covers a full annual cycle plus a month to work an incident found at the end of it. That is a starting point to adapt, not a legal requirement and not a period BoundaryVault sets: retention is your documented policy decision. What you may not do is keep everything forever by default — an unbounded raw log is an unbounded store of whatever the agent touched, including credential-shaped arguments. Product behaviour as shipped in BoundaryVault, November 2026. Check a retained log with the free log scan.

Scan my log — free

What must an agent audit trail capture?

A retention period is worthless if the retained entries cannot be replayed. BoundaryVault's detector reads the shape agents already produce — JSON entries, native JSON or JSONL on the free tier — and a useful audit trail keeps every field in this table, on every entry, for the whole retention period:

FieldAccepted namesWhy it has to survive retention
Timestampts / timestamp / timeOrders the timeline; order breaks and clock jumps are integrity signals
Agentagent / agent_idAttributes the action and carries any per-agent scope
Tooltool / action / functionThe action judged against the declared allowed-tool set
Argumentsargs / arguments / paramsWhere credential grabs, wallet material and egress destinations appear
Sequenceseq / sequence / index / event_indexLets the integrity audit spot missing or duplicate values — the gaps that say a log is incomplete

Keep the declared scope in force beside the log, versioned with it: the global allowed_tools list, per-agent allowed_tools (which win over the global list), auth_flow_tools, the egress allowlist and the declared privilege level. Scope-escape, token-forge, undeclared-egress and privilege-escalation findings are only possible against a declared scope — retain the log without its scope and you have kept the actions but thrown away the boundary they are judged against. Each finding the detector returns carries its pattern, rule id (bv-<pattern>-v2.0.0), severity, timestamp, action index, agent, tool and a redacted evidence excerpt of at most 240 characters, across nine patterns: credential-grab, token-forge, scope-escape, wallet-touch, crossing-chain, undeclared-egress, privilege-escalation, handoff-crossing and custom-rule.

One boundary to plan around: BoundaryVault itself does not retain your raw log. Raw pasted logs are analyzed in memory and discarded; only redacted findings are kept, owner-scoped, and secret values are replaced with [REDACTED] at detection time. The retention system described in this guide is yours — the log store you run upstream of the scan.

Why is retention length a risk decision, not a storage decision?

Two failure modes pull in opposite directions, and the period you choose is the balance point between them. Too short, and the incident you discover in month four has no log left from month one: boundary crossings are usually found after the fact — that is the entire premise of agent log forensics — so a 30-day rotation quietly decides that anything discovered later is un-investigable. Too long, and your archive becomes the largest single collection of what your agents touched: argument values can include credential-shaped material, destinations and customer data, held for years past the point where anyone will ever replay them.

So set the period from your discovery horizon, not from disk prices. Ask how an incident would actually reach you — a customer report, a provider abuse notice, a rotated key that turns out to have leaked, a quarterly review — and how old the relevant actions could be by then. Your retention has to cover that lag plus the time to investigate. Then write the choice down as policy, with the reason, the tiers and the deletion date it implies. A period you chose on the record is defensible; a period that is just “whatever the default kept” is not a decision at all.

The storage math: a worked example

Example — fictional operator, illustrative numbers. Northbeam Outfitters runs a support agent handling 1,900 sessions a day. Each session logs about 38 events — tool calls, handoffs and replies — in the entry shape above.

StepArithmeticResult
Events per day1,900 sessions × 38 events72,200 events/day
Events per month72,200 × 30 days = 2,166,000≈ 2.2M events/month
Bytes per month2,166,000 events × ≈1.1 KB per event = 2,382,600 KB≈ 2.4 GB/month
13-month retention2.4 GB × 13 ≈ 31 GB (28.2M events in total)≈ 31 GB
Hot tier, first 90 days72,200 × 90 days × 1.1 KB≈ 7.1 GB hot
Archive tier, remaining ≈300 days72,200 × 300 days × 1.1 KB≈ 23.8 GB archived

The numbers drive the choice. Thirty-one gigabytes is not a storage problem — which is exactly why Northbeam can afford the investigation-friendly 13 months instead of a nervous 30 days. But the same table shows where the leverage is: the 1.1 KB average event size. If verbose arguments push that to 5 KB an event, the identical policy costs about 141 GB, and the honest fix is trimming what entries carry — not silently shortening retention until incidents fall off the end. Run this multiplication with your own session count and your own measured event size before you pick any period; a retention promise made without it is a guess.

Hot vs archive tiers: what goes where?

TierExample windowWhat it holdsAccess
HotFirst 90 daysFull raw entries, searchable and ready to paste into a scanOperators and incident responders
ArchiveDay 91 to month 13Full raw entries, compressed, with the scope config and policy version that were in forceRetrieved on a named incident or review, not browsed
Kept past raw deletionPer your policyRedacted findings and any disclosure packet built from them — never the raw secretsYour governance file

The tier boundary is a retrieval promise, not just a storage class: archived logs must come back complete, with sequence values and timestamps intact, or the archive cannot be replayed when it matters. Test a restore before you need one. And note what does not need tiering at all — the redacted findings. A finding's evidence excerpt is redacted at detection time, so the findings and the packet can be kept on the governance schedule you choose without extending the life of the raw secrets in the original log.

Tamper-evidence: what BoundaryVault does — and does not — do

Be precise here, because vendors blur it. BoundaryVault does not hash-chain your raw log, and nothing in this guide claims a chain over your entries. What the platform does is seal the evidence it produces and audit the log you hand it:

Evidence fingerprint. A disclosure packet carries an evidence_fingerprint — a SHA-256 hash over the redacted findings — and the packet id is derived from that fingerprint. If the evidence set changes, the fingerprint no longer matches, so a reviewer can tell the packet they are reading is the packet that was generated.

Integrity and gap audit. Every scan audits the log itself and reports signals: missing or duplicate sequence values, timestamp order breaks, clock jumps of more than a day, silent gaps (no actions for a stretch far longer than the log's median gap), a truncated final entry, duplicate entries and agent name form changes. The audit's own assessment, printed in the packet's integrity annex, is that these signals are indicators only — they show where a log looks incomplete; they are not proof of tampering. Retain sequence values and unbroken timestamps precisely so this audit has something to work with months later.

Deletion discipline: the end of retention is part of retention

A policy that only says how long logs are kept, and never how they die, has not finished. Delete on the schedule the policy states — raw entries and their backups together, so a “deleted” month does not survive indefinitely in a snapshot nobody counted. Delete the raw log first and the derived material on its own stated schedule: redacted findings and packets contain no raw secret values, which is why they can follow a different, longer governance schedule without keeping the secrets alive. Keep a deletion record — what was deleted, which period it covered, when — because “we deleted it per policy” is a claim an auditor will ask you to show, and the record is the showing. The one exception to scheduled deletion is a live incident: once you are investigating, preserve the logs, findings and scope config for that matter until the review closes, and record that hold the same way you record a deletion.

What do you hand an auditor?

Not the raw archive. For an incident, you hand over the disclosure packet built from the scan: format boundaryvault-disclosure/1.0, carrying the incident summary, the pattern entries, the timeline, numbered evidence references with the redacted excerpt from detection time, your operator notes, the blast-radius rotation worklist, the policy in force at scan time, the integrity annex and the evidence fingerprint that seals the set. Its transmission block records filed: false and no destinations — the packet is generated for operator review only, and handing it to anyone is always your explicit action, never the platform's.

Alongside the packet, keep ready: the retention policy itself (period, tiers, deletion rule), the declared scope config the packet names, and your deletion and hold records. Together they answer the auditor's three real questions — what happened, under what boundary, and can you prove the record is the one you kept. If scope escape is the finding under discussion, what scope escape means walks through how that judgement is made.

The retention checklist: five actions

  1. Capture the full entry. Timestamp, agent, tool, arguments and a sequence value on every entry — and version the declared scope config (allowed tools, per-agent lists, auth-flow tools, egress allowlist, privilege level) alongside the log it governed.
  2. Run your own storage math. Sessions a day × events a session × measured bytes an event, before you commit to a period — the worked example above is the template, your numbers replace Northbeam's.
  3. Set the period from your discovery horizon. Cover how late an incident could surface plus the investigation time — the 90-day hot / 13-month total split in this guide is a policy choice to adapt, not a requirement — and write the reason into the policy.
  4. Tier it and test the restore. Hot and searchable first, compressed archive after, scope config archived with the log; prove an archived month comes back complete, with sequence values and timestamps intact, before you rely on it.
  5. Delete on schedule, and record it. Raw entries and backups die together at the end of retention, findings and packets follow their own stated schedule, holds for a live incident are recorded — and every deletion leaves a record.

Run the free log scan · More agent-security tools from Ingenious AI

Related guides

Agent Log Forensics: Finding Credential Grabs After the Fact — how a retained log is replayed against declared rules to find the crossings you missed live.

What Is Scope Escape in an AI Agent? — the declared allowed-tool set, and why no declared scope means no escape findings.

Building a Disclosure Packet After an Agent Incident — the review-only packet you hand an auditor, and how it is validated.

Retention is also a promise to your future reviewers

One reader of your retention policy rarely gets named: the person who will run an incident review fourteen months from now, possibly you, possibly a successor who never met this agent. Every choice in the policy either helps or strands that reader. Keeping the scope config versions beside the logs helps them. Keeping findings but deleting the packets they fed strands them. Keeping raw logs while letting the export tooling rot — so the archive is technically retained and practically unreadable — is the worst outcome of all, because it looks like compliance until the day it is needed.

So test the policy from the reader's chair once a year. Pick a random month from the archive tier, restore it, scan it, and time the exercise. If the restore takes days or the format needs archaeology, the retention period on paper is longer than the retention you actually have — and the honest fix is to shorten the paper or repair the pipeline, in whichever order your risk allows.

Frequently asked questions

How long should you keep AI agent logs?

There is no retention period set by BoundaryVault, and this guide states no legal requirement — retention is a policy choice you make and document. A workable starting point for many operators is 90 days of raw logs in a hot, searchable tier and a total retention of 13 months, because 13 months covers a full annual cycle plus a month to investigate an incident discovered at the end of it. Shorten or lengthen it by your own discovery horizon: the question is how late you might learn about an incident and still need the log that proves what happened.

What should an AI agent log entry capture?

At minimum the fields BoundaryVault's detector reads: a timestamp (ts, timestamp or time), the agent (agent or agent_id), the tool called (tool, action or function) and its arguments (args, arguments or params), plus a sequence value (seq, sequence, index or event_index) when your framework emits one. Keep the declared scope that was in force alongside the log — the allowed_tools list, any per-agent lists, auth_flow_tools, the egress allowlist and the privilege level — because scope, egress and escalation findings are only possible against a declared scope.

Does BoundaryVault store my raw agent logs?

No. Raw pasted logs are never stored: they are analyzed in memory and discarded, and only the redacted findings are kept, owner-scoped. Secret values are replaced with [REDACTED] at detection time and never stored. Retention of the original log is therefore your own system's job — BoundaryVault keeps the findings and the disclosure packet, not a second copy of your log.

How much storage do agent logs actually take?

Less than most teams fear, and you can size it before you commit to a period. In the worked example in this guide, a support agent handling 1,900 sessions a day at about 38 logged events per session produces about 72,200 events a day — roughly 2.2 million events a month at about 1.1 KB per event, which is about 2.4 GB a month and about 31 GB for a 13-month retention. Measure your own average event size and run the same multiplication; verbose arguments, not event count, are what usually move the number.

How are retained logs and findings made tamper-evident?

BoundaryVault does not hash-chain your raw log, and it does not claim to. What it does is seal the evidence it produces: the disclosure packet carries an evidence fingerprint, a SHA-256 hash over the redacted findings, so a reviewer can tell if the evidence set changed, and every scan runs a log integrity and gap audit — missing or duplicate sequence values, timestamp order breaks, clock jumps, silent gaps, truncated entries and agent name form changes. Those are signals only, never proof of tampering, and the packet states that assessment in its integrity annex.