Home

/

Prompt Injection: Blast Radius

/

Cleaning up afterwards

Cleaning up afterwards

Chapter 12
Part III
3
min read

Cleaning up afterwards

Assume this happened. What can you actually do?

If memory records carry Origin and SourceTaskId, quite a lot. You can enumerate every record written by a task that touched a given ticket, see which ones are tainted, and review or delete them. The blast radius is a query.

Without those columns you are reading rows and guessing. There is no way to distinguish a note the model inferred from a customer's claim from a note your code wrote after a successful refund, because both are strings in the same column.

This is the argument for the provenance column that persuades people who were unmoved by the security case. It is the difference between an incident that takes an afternoon and one that ends in a decision to wipe all agent memory, which is what teams do when they cannot tell the good rows from the bad.

Expiry, again

Chapter 8 used expiry against authority. The same idea works against persistence.

A memory that never expires is an attack that never expires. Give model-written memory a lifetime, make it short by default, and require an explicit decision to extend it. Most agent memory is worth less after a week than teams assume, and the cases where it genuinely matters are worth declaring individually.

For the corpus, the equivalent is re-indexing with fresh provenance rather than trusting tags written by an older version of your pipeline.

The read path matters too

One asymmetry worth noting. Most of this chapter is about the write path, because that is where the poison enters. The read path is where it pays off, and it is cheaper to defend.

A memory record retrieved into the planner's context is untrusted content arriving through a channel your chapter 3 audit probably recorded as internal. Route it through chapter 7's quarantine like any other untrusted source, and the stored instruction never reaches the component that holds the tools.

Teams that cannot face re-architecting their write path can often do this instead, in an afternoon, and get most of the benefit.

What this costs

The agent gets less useful, and this one is not recoverable by cleverness.

An assistant that remembers everything feels better than one that remembers only what your code established. Users notice. The feature that made the demo work is partly what this chapter is removing, and that argument will be had in a product meeting rather than a security review.

The defensible position is not that memory is dangerous. It is that memory written by a model that reads untrusted content is an attacker-writable database, and it should be sized and scoped like one.

Chapter 13 turns to code nobody on your team wrote.

Sources for this chapter

ClaimSourceStatus
Vector and Memory Flaws as an OWASP 2026 category (LLM07)https://cybersecuritynews.com/owasp-genai-llm-top-10-2026/SECONDARY
Vector and Embedding Weaknesses in the 2025 editionhttps://genai.owasp.org/llm-top-10/PRIMARY
Data and Model Poisoning as a standing categoryAs abovePRIMARY

The laundering mechanism, the split between facts the system established and things the model concluded, the MemoryRecord shape with a persisted origin column, and the argument that corpus write access is equivalent to agent write access are the author's. The claim that provenance loss across a storage round trip is "the single most common way" a provenance system fails is experience rather than a measured finding. The assertion that most agent memory is worth less after a week is a judgement offered to be argued with.

the-three-year-bug
why-the-industry-shipped-anyway
injection-is-not-jailbreaking
why-the-confusion-persists
the-lethal-trifecta
running-the-audit
why-filtering-fails
measured-here-on-a-named-model
why-this-is-structural
what-solved-would-look-like
the-harness
provenance-every-value-knows-where-it-came-from
on-the-reference-agent
quarantine-the-planner-never-reads-the-mail
what-two-models-cost-in-practice
capability-authority-the-agent-cannot-widen
expiry-is-a-feature
the-gate-the-model-proposes-code-disposes
the-policy
failing-closed
egress-closing-the-exfiltration-leg
how-much-can-actually-leak
sandboxing-containing-the-code-the-agent-writes
the-sandbox-held-and-it-did-not-help
poisoned-memory-poisoned-retrieval
cleaning-up-afterwards
the-tool-supply-chain
mcp-and-the-rest
human-in-the-loop-that-isnt-theatre
when-there-is-nobody-there
testing-for-injection
measuring-coverage-not-pass-rate
red-teaming-agents
a-finding-worked-through
when-it-happens-anyway
what-the-logs-cost-you-in-an-incident-you-did-not-have
governance-procurement-and-the-regulator
writing-the-policy
end-to-end
what-it-actually-took
what-stays-broken
why-this-is-probably-structural
the-trifecta-audit-worksheet
action-schema-and-policy-reference
control-mapping
prompt-injection-sources
incidents
appendix-e-what-we-re-ran-ourselves
e4-the-control-that-keeps-e2-and-e3-honest

Download the full PDF for free?

Free download — no account required

Get the PDF
Get the PDF
Related Chapters
Free Download
Get the full PDF
All pages, including all code examples, diagrams, and the appendix reference card.
No spam. Unsubscribe at any time.
Your email won't be shared.
Oops! There's a problem with your request. We're working on fixing it. Please try again later.