Research / Agent safety and security

Selective Revocation and Replay: Post-Compromise Recovery of Explicit Persisted State in Memory-Augmented LLM Agents

Introduces selective revocation and replay, which removes persisted prompt-injection influence while retaining benign agent state and, on retrieval memory, cuts post-detection cost from 17 to 9 extra LLM calls.

Published
11 March 2026
Author
Ali Uyar
DOI
10.5281/zenodo.18967060
Code
github.com/aliuyar1234/selective-revocation-replay

Abstract

Persistent indirect prompt injection becomes a recovery problem once malicious instructions are written into durable agent state. We study post-compromise recovery for explicit persisted state in a provenance-tracked, text-only, local-files agent runtime, assuming suspicious roots are given after compromise. Selective replay revokes persisted descendants of those roots and replays only dirty state-writing events when replay is sound, with fallback to coarse rollback otherwise. In a frozen deterministic matrix spanning 8 task chains, 2 memory architectures, 2 attack variants, 5 methods, and 1 ablation, selective replay is the only method that simultaneously achieves zero residual attack success and non-zero S4 retention on explicit attacks. On retrieval memory, it matches rollback’s retained state while reducing post-detection cost from 17 to 9 extra LLM calls. We then run a focused live confirmation on schema-constrained qwen2.5:14b over two explicit retrieval chains. Across all six unrecovered reruns, residual attack success remains 1.0; across all six selective-replay reruns, residual attack success falls to 0.0 while both S3 correctness and S4 retention reach 1.0. The strongest travel case requires only four revocations and two replayed writer events with no fallback. This is a narrow result about explicit persisted state, not a general solution to prompt injection detection or hidden-state repair.

Why it matters

Once malicious instructions are written into durable agent state, prompt injection becomes a recovery problem. Provenance makes the recovery selective: what descends from the injection is revoked and benign state is retained.

Cite

@misc{uyar2026selective,
  title     = {Selective Revocation and Replay: Post-Compromise Recovery of Explicit Persisted State in Memory-Augmented LLM Agents},
  author    = {Uyar, Ali},
  year      = {2026},
  doi       = {10.5281/zenodo.18967060},
  publisher = {Zenodo},
  url       = {https://doi.org/10.5281/zenodo.18967060}
}
AU-3
Root lamp: the flagged S1 file read, low once its descendants are outGrey stack: the poisoned note the S1 writer persistedS1 bar: gangs the two records that list that read as a parentLid lamps per chain: green = attack gone (S3) / fact kept (S4), red = notDial: extra LLM calls after detection; the key strokes once per replayed callThe paper builds a provenance-tracked agent runtime that, given a suspicious root after compromise, revokes the persisted records descended from it and replays only the dirty memory writes, falling back to rollback when replay would be unsound. On retrieval memory in 8 task chains, selective replay brings residual attack success to 0 in every chain and keeps the remembered fact in 6 of 8, as rollback does, for 9 extra LLM calls after detection instead of 17, while revoke-only, root delete and full reset lose the fact. Here each column is one chain and each drawer one persisted record, and the key strokes once per replayed call. In a live check with qwen2.5:14b on two chains, residual attack success stayed at 1.0 in all six unrecovered reruns and fell to 0.0 in all six selective-replay reruns, with S3 correctness and S4 retention at 1.0.