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