Sep 29 2026

The Security Risks Hiding in AI Agent Memory

The Security Risks Hiding in AI Agent Memory

Agent memory is the least-governed data store in most enterprises, and it is filling up with secrets. An agent that remembers can be taught. An agent that can be taught can be poisoned. And whatever it has learned sits somewhere, usually in plain text, usually outside any control you would recognize from your ISMS.

Last week I argued that the harness is the contract: every consequential path an agent can take should be declared, bounded, and leave evidence another party can verify. Memory is the part of the harness that breaks that model quietly. A tool call happens once and shows up in a log. A memory write persists, gets replayed in every future session, and can change behavior weeks after the input that caused it.

That is why a new Help Net Security interview with Vectorize CEO Chris Latimer deserves the attention of every CISO running agents in production. His headline advice is blunt: if you do one security check this quarter, make it agent memory. I agree, and I want to go further, into what that check should look like and how it maps to the frameworks your auditors already use.

What “agent memory” actually means

Agent memory is any state an agent writes during one run and reads back as trusted context in a later run. That last clause is the whole security problem. Retrieval-augmented generation reads from a corpus someone curated; memory reads from a corpus the agent itself wrote, often from inputs nobody reviewed.

Memory typeWhere it usually livesWhat piles up in itWho can write to it
Session / scratchpadContext window, temp filesTool outputs, pasted snippets, intermediate plansThe agent, every tool it calls
Long-term user memoryMarkdown files, local JSON, SaaS memory servicePreferences, project facts, credentials users pastedThe agent, on the user’s behalf
Vector memory storeEmbedded DB, managed vector serviceChunked documents, conversation summaries, embeddingsIngestion jobs, agents, sometimes other agents
Shared / team memoryShared server, team workspaceDecisions, runbooks, cross-user contextMany users and many agents
Skill, plugin, MCP stateExtension directories, MCP server storageConfig, cached tokens, instructionsThird-party code you installed

Notice the right-hand column. In a database you would never accept “anyone whose text the agent read” as the write-access policy. For most memory stores in production today, that is effectively the policy.

Four signals from the field

Latimer’s interview is short, but it lands four points that match what I see in agent design reviews.

  1. Secrets are migrating into memory. When he read through the memory banks of the coding agents he used, he found API keys, credentials, and sensitive documents that developers had fed in, and that the agents had promoted to long-term memory. The data your secure SDLC was built to protect now sits in plain text on workstations, in cloud memory services, and in markdown files.
  2. Extensions are the poisoning vector. He names plugins, skills, and MCP integrations as the likely entry points, because people install things that look useful without reading them. His attacker scenario targets first-time coders with a too-good-to-be-true plugin that quietly scans memory for credentials and ships them to an external endpoint.
  3. Provenance is the forensic question. After an incident, what you most need to know is where a memory came from: an MCP server, a tool response, or an insider. Better still is filtering hostile writes before they persist, which is the idea behind OWASP’s Agent Memory Guard.
  4. Access control is the gap vendors can’t close yet. Most products stop one user’s session from reading another user’s memories. Team memory and graduated access, the RBAC and ABAC patterns enterprises take for granted in databases and APIs, are mostly not there.

His quarterly audit prediction is the one to act on. He expects CISOs to find two things: no governance over which memory systems are in use, and a startling volume of keys, database passwords, and confidential business data sitting in those systems, ready to be exfiltrated.

That second finding is not an AI problem. It is a data-classification and secrets-management failure that AI has made faster and harder to see.

Six risks hiding in agent memory

Memory risk is durable risk. A prompt injection that lands in the context window dies with the session; one that lands in memory becomes a standing instruction.

1. Memory poisoning. Attacker-controlled text is written into memory and replayed as trusted context in future sessions. The entry point is rarely the chat box. It is a web page the agent summarized, a ticket it triaged, a tool response, or a plugin that writes directly to the store. The effect is delayed, so the incident and its cause show up weeks apart.

2. Secrets at rest in the wrong place. Every credential a developer pastes into a session is a candidate for promotion to long-term memory. Those stores rarely have encryption at rest, secret scanning, or retention limits. Your vault is hardened; the agent’s notes file next to it is not.

3. Cross-user and cross-tenant leakage. In multi-tenant products, the question is whether one customer’s memory can surface in another customer’s session. Tenant filters applied after retrieval can be talked around. They belong inside the vector query itself, enforced by the store, not the model.

4. Malicious extensions reading memory. A skill or MCP server runs with the agent’s access. If the agent can read its memory, so can the extension, and nothing stops it from sending what it finds to an external endpoint. This is supply-chain risk with a data-exfiltration payload.

5. Embedding and summary leakage. Teams treat embeddings as anonymized math. They are not; they can be inverted enough to leak source text. Summaries are worse, because they compress sensitive facts into short, retrievable sentences.

6. Unbounded retention. Memory stores grow without an owner, a retention schedule, or a deletion path. That turns a GDPR erasure request, a customer offboarding, or a legal hold into a question nobody can answer with confidence.

Where these risks sit in the threat frameworks

Every one of the six risks already has a home in the frameworks your security team uses. The work is connecting them to the memory store, which most threat models leave off the diagram.

Memory riskOWASP Agentic Top 10OWASP LLM Top 10 (2025)MITRE ATLAS
Memory poisoningASI06 Memory & Context Poisoning; ASI01 Agent Goal HijackLLM04 Data and Model PoisoningAI Agent Context Poisoning (AML.T0080); RAG Poisoning (AML.T0070)
Secrets at restASI03 Identity & Privilege AbuseLLM02 Sensitive Information DisclosureLLM Data Leakage (AML.T0057)
Cross-tenant leakageASI03 Identity & Privilege AbuseLLM08 Vector and Embedding WeaknessesLLM Data Leakage (AML.T0057)
Malicious extensionsASI04 Agentic Supply Chain Vulnerabilities; ASI02 Tool MisuseLLM03 Supply ChainAI Supply Chain Compromise (AML.T0010)
Embedding and summary leakageASI06 Memory & Context PoisoningLLM08 Vector and Embedding WeaknessesLLM Data Leakage (AML.T0057)
Unbounded retentionASI10 Rogue Agents (drift over time)LLM02 Sensitive Information DisclosureNot a technique; a governance gap

OWASP’s Agent Memory Guard is the reference implementation for ASI06. It sits between the agent and the store, screens every read and write, and maps each finding to allow, redact, quarantine, or block. In its published benchmark it caught 92.5% of 40 attack payloads with zero false positives, and its misses were API tokens slightly longer than its fixed-length patterns. Treat it as a strong first layer, not the whole defense.

The governance lens: memory is data, and data has owners

The fastest way to get memory under control is to stop treating it as an AI novelty. It is a data store. Your AIMS and ISMS already have controls for data stores; memory just hasn’t been put in scope.

FrameworkWhere agent memory landsWhat the auditor will ask for
ISO/IEC 42001A.7 Data for AI systems, especially A.7.5 data provenance; A.6.2.8 event logs; A.10.3 suppliersMemory inventory, provenance records per write, supplier assessments for memory vendors and MCP servers
ISO/IEC 27001:2022A.5.9 asset inventory, A.5.12 classification, A.8.12 data leakage prevention, A.5.33 protection of recordsMemory stores in the asset register, classified, with DLP and retention applied
NIST AI RMF 1.0MAP 4.1 third-party components, MEASURE 2.7 security and resilience, MANAGE 3.1 third-party monitoringEvidence that memory poisoning and leakage were tested and are monitored
EU AI ActArt. 10 data governance and Art. 15 robustness for high-risk systems; Art. 26 deployer obligationsProof that memory can’t silently degrade a high-risk system’s accuracy or robustness
GDPR / CCPAStorage limitation, right to erasure, deletion requestsA working deletion path that reaches memory, embeddings, and summaries

Having taken virtual data room organization through ISO 42001 Stage 2 on the first attempt, I can tell you what certification auditors reward: a complete inventory, named owners, and evidence that reviews actually happened. Agent memory needs exactly that, and in most organizations today it has none of it.

A control framework for agent memory: govern the lifecycle, not the model

Apply the harness test to memory: every write is a declared path, every store is bounded, and every read leaves evidence. That gives five control points across the memory lifecycle.

Lifecycle stageDeclaredBoundedVerifiable evidence
1. Admit (write)Allow-list of sources that may write to memory; extensions denied write by defaultSecret and PII scanning before persist; injection screening; size and growth limitsProvenance tag on every entry: source class, session, identity, timestamp
2. StoreEvery memory store in the asset register with an owner and classificationEncryption at rest; no plain-text markdown for anything above Internal; tenant partitioningAsset register entry; configuration evidence; SHA-256 baselines on protected keys
3. Retrieve (read)Read scope defined per user, team, and agent roleAccess filters enforced in the store’s query, not by the model; extensions get no read by defaultRead logs with requesting identity and entries returned
4. Retain and expireRetention schedule per memory classTTLs; deletion that reaches embeddings and summaries; legal-hold overrideDeletion job logs; erasure request test results
5. RespondIncident playbook covering memory poisoningQuarantine and point-in-time rollbackSnapshots; poisoning test results; post-incident provenance trace

Two rules do most of the work. Secrets never belong in memory: detect them at write time, block them, and rotate anything you find. No extension gets memory access it did not declare: a plugin that needs to read your agent’s memory should have to say so, and you should have to say yes.

Your 90-day plan: find it, bound it, prove it

Latimer’s informal audit is the right first step. Here is how I would turn it into a quarter of work that ends with evidence an auditor will accept.

Start with discovery, because you cannot bound what you have not found. Latimer’s prediction is that you will find unvetted memory tools on developer workstations and small shared servers, so scope the inventory to endpoints, not just production.

Five questions to ask any agent memory vendor

  1. Can you enforce access by team and role inside the store, or only by user session?
  2. Is every memory entry tagged with its source, and can I query by source after an incident?
  3. Do you scan for secrets and PII before a write persists, and what happens when you find one?
  4. When I delete a user, do their embeddings and summaries go too, and can you prove it?
  5. Can a third-party skill or MCP server read memory it did not request, and where is that logged?

If a vendor struggles with the first question, Latimer’s experience says you are not alone. Put the gap in your risk register and compensate with network isolation and aggressive retention until the product catches up.

The bottom line

Memory is what turns an agent from a tool into a colleague, and it is what turns a one-time injection into a standing compromise. The organizations that get this right will not have better models. They will have an inventory, an owner, a write policy, and a log, the same four things that have governed every other data store for twenty years.

If your agents remember, your governance has to remember too.

Not sure what your agents have been memorizing? DISC InfoSec runs a focused Agent Memory Risk Review: we inventory memory stores across endpoints and production, scan for exposed secrets, map findings to ISO 42001, the OWASP Agentic Top 10, and NIST AI RMF, and hand you a remediation plan you can take into your next audit. Book a free 30-minute call or email info@deurainfosec.com.

DISC InfoSec, ISO/IEC 42001 and 27001 Lead Implementer, CISSP, and CISM. We led VDR organization through ISO 42001 Stage 2 certification on the first attempt.


  • Meta title: The Security Risks Hiding in AI Agent Memory (and a 90-Day Fix)
  • Meta description: Agent memory is filling up with secrets and poisoned context. Six risks, their OWASP and ISO 42001 mappings, and a 90-day plan to govern it.
  • Primary keyword: AI agent memory security
  • Secondary: memory poisoning, OWASP ASI06, agent memory governance, ISO 42001 A.7.5, MCP security, Agent Memory Guard

Sources

Tags: AI Agent Memory


Sep 25 2026

AI Log Retention: Why Every AI Log Doesn’t Deserve the Same Shelf Life

Category: AI Log Retention,AI Logs — disc7 @ 2:29 pm

DISC INFOSEC  |  AI GOVERNANCE

AI Log Retention: Why Every AI Log Doesn’t Deserve the Same Shelf Life

Your AI logs are either your best evidence or your biggest liability. The retention period decides which.

Most teams I assess have exactly one AI log retention setting: whatever the vendor or the SIEM shipped with. Thirty days here. Forever there. Nobody chose it, and nobody can defend it to an auditor.

That worked when AI was a pilot. It does not work when AI redacts personal data in a deal room, answers customer questions from confidential files, or takes actions through agents. Controls are rarely why organizations fail an AI audit. Evidence is. And a log you deleted too early, or kept too long, is evidence working against you.

This post explains why AI logs need to be categorized by risk, what the EU AI Act, GDPR and ISO/IEC 42001 actually require, and gives you a generic five-tier retention schedule (Tier A = critical) you can adapt this week.

Why one retention period fails in both directions

A single retention period for all AI logs is wrong for almost every AI feature you run. It is either too short for the risky ones or too long for the harmless ones.

Keep everything too briefly, and you lose the ability to prove anything.

  • A customer finds a missed redaction eight months after the data room closed. Your redaction logs expired at 90 days. You cannot show what the model flagged, who approved it, or which model version ran.
  • A regulator asks you to reconstruct how an AI answer was produced. The retrieval and permission-check logs are gone.
  • For high-risk AI systems, the EU AI Act sets a floor of at least six months. Many vendor defaults sit below it.

Keep everything forever, and you create liability you did not need.

  • GDPR’s storage limitation principle says personal data is kept no longer than necessary. “We might need it someday” is not a purpose.
  • AI logs often carry prompts, pseudonymous user IDs, IP addresses and document references. Every extra year enlarges your breach blast radius.
  • Everything you keep is discoverable in litigation, and it costs money to store, search and secure.

The fix is not a better single number. It is a small set of numbers, each tied to how much harm a specific AI function can cause.

What the frameworks actually require

No framework hands you a retention table. Each one pushes from a different side, and your schedule has to satisfy all of them at once.

FrameworkWhat it requires for AI logsWhat it means for retention
EU AI Act (Reg. 2024/1689)Art. 12: high-risk systems must log events automatically so their operation can be traced. Art. 19 (providers) and Art. 26(6) (deployers): keep those logs at least six months, or longer if other law requires.Six months is the floor, not the target. Under the AI Omnibus timeline, Annex III high-risk obligations are set to apply from December 2027.
EU AI Act, Art. 18 and 73Technical documentation kept 10 years for high-risk systems; serious incidents reported to authorities.Incident-linked logs need a legal hold, not a timer.
GDPR (Reg. 2016/679)Art. 5(1)(c) data minimization; Art. 5(1)(e) storage limitation; Art. 5(2) accountability; Art. 17(3)(e) retention to defend legal claims; Art. 30 retention periods in records of processing.A ceiling as well as a floor. Every period needs a written purpose.
ISO/IEC 42001:2023Annex A control A.6.2.8 (recording of event logs); Clause 7.5 documented information; Clause 9.2 internal audit.An auditor will ask for your defined retention and evidence that deletion actually happens.
NIST AI RMF 1.0MEASURE and MANAGE functions expect traceability and incident response across the AI lifecycle.Retention must outlast your monitoring and incident review cycles.

Read together, the rule is simple: keep AI logs long enough to reconstruct and defend what the AI did, and no longer than that purpose requires. That is exactly why one number cannot work.

How to tier any AI log: four questions

Classify the AI function, not the log file. Every log that function produces inherits its tier. Score each function on four questions:

  1. Harm if wrong. If the output is incorrect, who gets hurt, and how badly? A mis-tagged folder is an annoyance. A missed redaction or a wrong credit decision is a breach or a rights violation.
  2. Reliance without review. Is the output used as-is, or does a human check it first? The less review, the higher the tier.
  3. Exposure. Can the function disclose personal data or confidential content, or change permissions, systems or money?
  4. Evidentiary value. Would you need this log to answer a regulator, defend a legal claim, or pass a customer’s due diligence?

Two or more “high” answers put a function in Tier A or B. Mostly “low” answers put it in Tier D or E. When in doubt, tier up; you can always justify shortening later with data.

The generic AI Log Categorization and Retention Schedule

Five tiers, from seven years down to six months. Periods run from the date of the log event and act as both the minimum and the default maximum.

TierTypical AI functionsWhy this tierKey log events (metadata only)RetentionPrimary basis
Tier A CriticalAI in decisions about people (credit, hiring, insurance, eligibility); privacy-protective AI (redaction, PII masking, DLP); agents that change systems, move money or send external messagesDirect harm to rights or data if wrong; outputs often relied on; primary evidence in breaches and legal claimsDecision or action taken; inputs referenced by ID; confidence scores; human approval, override or reversal; model, prompt and rule-set version; tool calls and their authorization7 yearsGDPR Art. 5(2), 17(3)(e), 22, 32–34, 82; EU AI Act Art. 12, 14, 19, 26(6); ISO 42001 A.6.2.8; claim limitation periods
Tier B HighCustomer-facing chatbots, RAG search and Q&A over confidential content, AI access-control decisionsCan surface content outside a user’s permissions; answers relied on; prompt-injection target; users interact with AI directlyQuery metadata; documents retrieved and permission-check result; cited sources; guardrail and injection detections; AI disclosure shown; feedback flags3 yearsEU AI Act Art. 12, 15, 50(1); GDPR Art. 5(1)(c), 25, 32; ISO 42001 A.6.2.6, A.6.2.8
Tier C ModerateGenerative content people rely on after review: translation, summarization, drafting of contracts or reportsErrors can mislead, but a human reviews and the source stays authoritativeJob ID; source and output hashes; languages or template; quality score; human edit or approval; model version2 yearsGDPR Art. 5(1)(e), 28, 32; EU AI Act Art. 50 transparency; ISO 42001 A.6.2.8
Tier D LowExtraction and enrichment feeding other systems: OCR, transcription, classification, entity taggingErrors mostly reduce quality downstream; no direct disclosureJob ID; document or file ID; page count; confidence; failures; engine version1 yearGDPR Art. 5(1)(c) and (e); EU AI Act six-month floor exceeded; ISO 42001 A.6.2.8
Tier E MinimalInternal productivity suggestions: auto-organize, tagging suggestions, autocomplete, performance telemetryHuman decides; no permission changes; lowest harm potentialSuggestion made; accepted or rejected; items affected; model version6 monthsEU AI Act Art. 19 / 26(6) baseline; GDPR storage limitation

Two things sit outside the tiers on purpose. AI configuration and model changes (enabling a feature, swapping a model, editing a system prompt or guardrail) are change records; keep them with your release records, typically five years. Raw prompt and output payloads captured for debugging are off by default, enabled per change request, and deleted within 30 days.

Six rules that make the schedule hold up in an audit

A table on its own is a policy. These rules turn it into evidence.

  1. Log metadata, not content. Record what happened, when, for whom and under which model. Do not store document text, OCR output, translations or full prompts in logs. Long retention is only defensible when the log is lean.
  2. Legal hold beats the timer. Any log tied to an AI incident, a personal data breach, litigation, a regulatory inquiry or a data subject request is frozen until released, then kept for the longer of its tier or the incident record.
  3. Dependencies inherit the higher tier. When OCR feeds redaction, the OCR job reference lives in the Tier A redaction log. Otherwise your Tier D deletion quietly breaks your Tier A evidence.
  4. Reclassify on change. A new model, a new provider or a new purpose triggers a re-tier before release. If a Tier E tool gains the power to change permissions, it is no longer Tier E.
  5. Put your vendors in scope. Your model provider may keep prompts and outputs on its own clock. Contract for no retention beyond processing and no training on customer content, and verify the settings at onboarding and every annual review.
  6. Prove deletion. Automate expiry, log the deletion job itself, and sample it in your internal audit. “We have a retention policy” fails; “here is last quarter’s deletion evidence” passes.

From the field: what a virtual data room taught us

Financial data rooms are the hard mode of compliance. When we took a Virtual Data Room organization through ISO/IEC 42001 certification and later rebuilt its Records Management Standard for AI, the same pattern showed up that I now see everywhere:

  • The existing retention table covered contracts, audits and training records. It said nothing about AI.
  • Five AI features (redaction, OCR, search, organize and translate) all shared one default log setting.
  • Redaction was clearly the highest-risk function, yet its logs had the same life as auto-organize suggestions.

The fix was the tiered approach above: redaction at seven years, AI search at three, translation at two, OCR at one, auto-organize at six months, with a metadata-only logging rule that fits a content-blind platform. The policy change took days. Configuring the SIEM to honor five retention periods is the real work, so start that conversation with engineering early.

Five steps to implement this quarter

  1. Inventory every AI function in production, including vendor features you switched on.
  2. Tier each one with the four questions and record the rationale.
  3. Write the schedule and the six rules into your records management standard, with an owner for AI logs.
  4. Configure log retention and automated deletion per tier in your SIEM and at each model provider.
  5. Audit it: sample one log per tier, confirm content minimization, and show deletion evidence in your next management review.

Get the AI Log Retention Kit

I’ve packaged everything in this post into a ready-to-edit AI Log Retention Kit:

  • The Tier A–E retention schedule as an editable Word table
  • Drop-in policy language for a records management standard (scope, roles, the six rules, legal hold)
  • The four-question tiering worksheet for your AI inventory
  • An auditor-ready evidence checklist mapped to the EU AI Act, GDPR and ISO/IEC 42001

Comment “RETENTION” below and I’ll send it to you. Prefer a second pair of eyes on your own AI features? Book a free 30-minute AI log retention review at calendly.com/hd-deurainfosec and we’ll tier your AI functions together.

Hugh “Disc” Deura is Principal Consultant at DISC InfoSec, an ISO/IEC 42001 Lead Implementer, CISSP and CISM, and led a Virtual Data Room organization to ISO 42001 certification on its first Stage 2 audit.

This post is general guidance, not legal advice. Sector rules (for example, financial services recordkeeping) and national law may require longer periods.

#AIGovernance #ISO42001 #EUAIAct #GDPR #AISecurity #RecordsManagement #Compliance

Tags: AI Logs retention