What must a company log and keep when engineers use coding agents, and for how long?

Published · Updated · Checked against Anthropic, OpenAI, GitHub and Cursor enterprise documentation, 10 Nov 2026

Most regimes set an expectation that you log and can reconstruct what happened, not a number of days, and very few mention AI coding tools at all. The hard numbers that exist, such as three years under SEC Rule 17a-4(b) or six years under FINRA Rule 4511(b), apply to specific records of specific kinds of firm, and whether a coding-agent transcript is one of them is a question for counsel. So the useful move is to decide your own number from the incidents you must be able to reconstruct, then check it against the regimes that apply to you. This article is not legal advice.

The matrix

Texts quoted below were read on 2026-11-10 for HIPAA, SEC and FINRA. For the EU texts the cells paraphrase and give the article, and you should read the article itself before relying on it. SOC 2 and ISO 27001 control text is paywalled and was not read.

RegimeWhat the text actually says (quote, article)Does it set a retention period?Does the text mention AI?What it means for a coding-agent session recordConfidence
GDPRArt. 5(1)(e): personal data kept no longer than necessary for the purpose. Art. 32(1): security appropriate to the risk. Art. 33(1): notify the authority within 72 hours of becoming aware of a personal data breach, where feasible. ParaphraseNo fixed periodNoA transcript that contains personal data needs a purpose and an end date, which argues for a limit as much as for keepingMedium
EU AI ActArt. 26(6): a deployer of a high-risk system keeps the logs it controls for at least six months unless other law provides otherwise. Art. 12 is provider-side. ParaphraseSix months, for high-risk systems onlyYesAnnex III does not appear to list coding assistants, so the six months probably does not attach. See the AI Act and GDPR guideLow
NIS2Art. 21(2): cybersecurity risk-management measures; Art. 21(3): supply chain; Art. 23(4): early warning within 24 hours and incident notification within 72 hours, for in-scope entities with a significant incident. ParaphraseNo period for logsNoIf you are in scope, you need records good enough to describe an incident to a regulator in 72 hoursMedium
DORAArts. 9(1), 10(1), 17(3)(b), 28(1)(a), 30(2): protection, detection, incident handling and ICT third-party arrangements for financial entities. ParaphraseNone foundNoOnly if you are a financial entity. The ICT third-party rows matter more than any log periodLow
HIPAA45 CFR 164.312(b): "Implement hardware, software, and/or procedural mechanisms that record and examine activity in information systems that contain or use electronic protected health information."No for audit logs. 164.316(b)(2)(i) says retain documentation "for 6 years from the date of its creation", which is policies and records of actions, not logsNoIf a session can touch ePHI, activity recording applies to that system. Six years attaches to your documentation, not to the transcriptMedium
SEC 17a-417a-4(b): preserve "not less than three years, the first two years in an easily accessible place"; (b)(4) covers communications relating to the firm's businessYes, three years, for the records the rule listsNoWhether a session transcript is a business communication under (b)(4) is not answered by the text. Ask counselLow
FINRA 45114511(b): "at least six years" where no other period is specified. 4511(c): records "shall be preserved in a format and media that complies with SEA Rule 17a-4"Yes, six years by defaultNoSame question as the row above for a transcript. Ask counselLow
SOC 2 (CC6.1, CC7.2, CC7.3)Control text is paywalled; not readNot readNot readAuditors sample evidence, so the period is set by your audit window and your policyNot assessed
ISO 27001 (A.8.15, A.8.16)Control text is paywalled; not readNot readNot readLogging and monitoring controls, scoped by your own risk assessmentNot assessed

The vendors also keep their own windows. Anthropic documents 30 days of standard retention for commercial plans and a 6-year Activity Feed that holds no prompt text, GitHub's audit log keeps 180 days and excludes client prompts. OpenAI's Compliance API page defers retention periods to its Admin API reference, so no Codex period was confirmed. These are the vendor's copies, set by the vendor, and they stop when your contract does. The enterprise controls comparison sets them side by side.

What the matrix means in practice

Three patterns follow. First, a log is expected and a period is not stated, so the period is your decision and you need to be able to defend it. Second, personal data in the transcripts pushes the other way: GDPR Art. 5(1)(e) is as much a reason to delete as to keep, so the number should come with a deletion rule. Third, nothing here tells you to keep a full transcript. Many regimes are satisfied by showing who did what, when, with which tool and under which approval, which an audit event can do without storing prompt text.

Local files matter here. Claude Code keeps plaintext transcripts under ~/.claude/projects/ for 30 days by default, adjustable with cleanupPeriodDays, so a longer company number means someone must change that setting or copy the files before the default removes them. See why transcripts disappear after 30 days and the audit log guide.

Decide your number: worksheet

Incident I must be able to reconstruct: [for example, a leaked credential, a bad production change, a data subject request]
Oldest such incident I have actually had to reconstruct: [age in days or months]
How long after the event do we usually find out: [days]
Longest a regulator, customer or auditor could ask: [period, and the rule or contract that sets it]
Who can request deletion of a record: [data subject | employee | customer | none]
What the request overrides: [nothing | the retention number | only if no legal hold]
Record I keep: [full transcript | metadata only | both]
Retention number: [days]    Owner: [name]    Review date: [date]
Where it is stored and who can read it: [location | roles]
What triggers a hold on top of the number: [litigation | investigation | audit]

Delete what does not apply. Fill the first four lines before the number: the answer is usually the longest of the lookback windows you wrote down, not a figure copied from the matrix. The session data policy template turns the finished worksheet into policy wording.

Where Sealkeep fits

Sealkeep keeps a company-held copy of Claude Code and Codex session transcripts, sealed on the developer's machine and stored in a bucket the company chooses, so the retention number is yours rather than a vendor default. It does not cover Cursor or Copilot, only machines that run it, and is not a DLP, a real-time monitor or a compliance certification. Its encryption format has not been independently audited. It has no documented legal hold, scheduled deletion, redaction inside sealed archives or SIEM export, so those parts of your worksheet need another mechanism.

FAQ

None names them. The numbers in the matrix attach to specific records or entities, and the text does not say whether a transcript is one.

Does the EU AI Act's six months apply to us?

Art. 26(6) concerns deployers of high-risk systems, and Annex III does not appear to list coding assistants. Check your own use against Annex III and ask counsel before assuming it does or does not apply.

Can an employee ask us to delete a transcript that contains their personal data?

GDPR gives data subjects rights over personal data, but deletion is not absolute and a legal obligation or a claim can outweigh it. Decide in advance who answers such a request and what the worksheet says it overrides.

Should we keep the full transcript or only metadata?

Keep the smallest record that lets you reconstruct your named incidents. Metadata is easier to justify under data minimisation, and full text is what you need if an incident turns on what was typed or pasted.