MemLineage: Lineage-Guided Enforcement for LLM Agent Memory
arXiv:2605.14421v1 [cs.CR] 14 May 2026
Ciyan Ouyang State Key Laboratory of Cyberspace Security Defense Institute of Information Engineering, CAS Beijing, China Rui Hou∗ State Key Laboratory of Cyberspace Security Defense Institute of Information Engineering, CAS Beijing, China
1
Abstract
Introduction
Modern LLM agents persist memory across user sessions: chat logs, ingested documents, tool returns, and the agent’s own derived observations all accumulate in a long-running store the next user turn will retrieve from. This memory is the agent’s capability substrate – it is what allows multistep workflows to compose – and it is increasingly the agent’s attack surface. Indirect prompt injection through the active context [7] has been studied at length; the published memory-poisoning literature adds three named families: AgentPoison [4] plants trigger-bound backdoors that surface on a matching query; MINJA [6] injects payloads through normal query-time interactions; and MemoryGraft [14] commits poisoned experience entries that persist across sessions. Zombie Agents [18] and a concurrent defence evaluation [10] sharpen this into a two-phase persistent-memory threat: attacker-controlled content is stored through the agent’s normal memory update path and later re-enters a different session as instruction. A 2025 SoK catalogues twenty-three IPI-centric defences against these [8]. The attack class is therefore no longer speculative. The open systems problem is how to preserve useful long-term memory while preventing untrusted memory ancestry from authorising sensitive actions. The enforcement gap. The hard case for a memory defence is not only a malicious string stored verbatim. A patient adversary can plant ingredients in untrusted sources, then wait for the agent’s normal retrieval and summarisation loop to emit a fresh derived entry that the agent commits under its own writer principal. The derived entry is, by construction, an authentic output of a registered principal, indistinguishable to a signature layer from a benign summary of the same context. Many sessions later, an unrelated query retrieves the derived entry and the laundered payload triggers a sensitive action. This chain-of-custody failure exposes three capability gaps:
We introduce MemLineage, a defence for LLM agent memory that attaches both cryptographic provenance and LLM-mediated derivation lineage to every entry. Recent and concurrent work shows that untrusted content can be written into persistent agent state and re-enter later sessions as an instruction; the remaining systems question is how to preserve useful memory recall while preventing such state from justifying sensitive actions. MemLineage treats this as a chain-of-custody problem rather than a filtering problem. It is a six-module design around an RFC6962 Merkle log over per-principal Ed25519-signed entries: a weighted derivation DAG records which retrieved entries influenced each new memory, and a max-of-strong-edges propagation rule makes Untrusted-Path Persistence hold for any chain whose attribution edges remain above threshold. The sensitive-action gate then refuses dispatches whose active justification descends from an external ancestor, while still allowing benign recall. We evaluate three defence cells against three memory-poisoning workloads on a deterministic mechanism-isolation harness; MemLineage is the only configuration in that harness that drives all three columns to zero ASR, while sub-millisecond peroperation overhead keeps it well below the noise floor of any LLM call. A Codex-backed AgentDojo bridge further separates strong-model behaviour from defence-layer behaviour: under an intentionally vulnerable tool-output profile, no-defence and signature-only baselines fail on all six banking pairs, while all MemLineage rows reduce strict AgentDojo ASR to zero. The core deterministic artifacts (ASR matrix, τ × K lineage ablation, utility baseline, and recovery POCs) are byte-equal CI-verified; hostedmodel AgentDojo and live-model sweeps are recorded as auditable logs rather than byte-pinned artifacts.
• Signature-only memory layers, in the spirit of in-totostyle supply-chain integrity [16], verify writer identity
∗ Corresponding author.
1
but do not recover what the entry was derived from.
no-defence baselines to 6/6 and all MemLineage rows to 0/6 strict AgentDojo ASR. Contributions.
• IFC-based agent planners such as Fides [5] enforce confidentiality and integrity labels at planning time but do not persist labels across the LLM derivation step that commits the laundered entry.
• A lineage-stress memory-laundering workload (§5.3, Figure 2): a clean three-stage workload that operationalises the hard case surfaced by persistentmemory attacks: untrusted content is transformed through LLM-mediated derivation into an authentic agent-written entry. We use it as a separator between signature-only, coarse-taint, and lineage-aware memory defences, not as a claim that cross-session persistence itself is novel.
• Retrieval-stage filters such as the RAGPart / RAGMask family [11] operate on the recall surface but cannot tell a benign summary from a laundered payload arriving through an authentic principal. • Coarse memory-layer defences that remove recall or attenuate all capabilities after exposed reads [10, 19] can be effective, but give up the fine-grained distinction between useful derived memories and memories whose sensitive use depends on untrusted ancestry.
• The MemLineage design (§3, Figure 1): six modules around a single memory store, with the maxof-strong-edges propagation rule and an UntrustedPath Persistence theorem (Theorem 1) formalising what the lineage layer actually buys. M6 further checks tool arguments against per-tool authority rules, which supports utility-preserving repair when trusted provenance supplies authorized replacement values for attacker-controlled parameters. The four capability dimensions that define the system’s operating point are summarised in Figure 8 (§7.9).
Approach. We introduce MemLineage, which attaches cryptographic provenance and lineage to every memory entry. Provenance is per-entry Ed25519 signature anchored in an RFC 6962 Merkle log [9]; lineage is a directed acyclic graph over the memory store whose edges record LLM-mediated derivation, weighted by an attribution algorithm. A max-of-strong-edges propagation rule (§3.5) makes Untrusted-Path Persistence hold: any path from an External ancestor whose every edge is strong forces the chain tip to inherit the untrusted label, which the sensitive-action gate refuses. The capability the attribution algorithm has to deliver, formally, is the recall rK of the strong-edge predicate at chain length K; we ablate three algorithms (uniform-weight, LM-self-eval, white-box attention) and sweep τ × K to map the trade-off. Evaluation summary. We instantiate MemLineage as a Python library that integrates with LangGraph and evaluate it on a deterministic harness that pins attacker behaviour and avoids real LLM API calls. Three defence cells are compared on three attack families (Table 1): no_defense fails all three; a sig_only_baseline (perentry Ed25519 plus Merkle inclusion, no lineage) closes the AgentPoison-style column but fails on MemoryGraft-style and sleeper-via-derivation; MemLineage drives all three columns to zero on this mechanism-isolation harness. The τ × K ablation under a degrading judge schedule (Table 6) exposes the boundary that a single-shot τ measurement would miss: under w0 = 0.9, d = 0.7, the safe τ ceiling shrinks with K (the deepest edge weight wK = 0.9 · 0.7K−1 sets the binding constraint), so a deployment allowing K = 5 derivation hops needs τ ≤ 0.10 rather than the τ ≤ 0.30 a K = 1 measurement would suggest. Per-operation overhead (Table 7) is sub-millisecond on the hot path – well below the noise floor of any LLM call. We also ship a Codex-backed AgentDojo bridge: the default DirectAttack sweep shows that modern instruction-tuned models can make conservative no-defence ASR look low (1/6), while an explicitly vulnerable tool-output profile drives both
• Three attribution algorithms (§3.5): uniformweight, secondary-LLM judge with prompt-injection hardening, and white-box attention. We quantify Kstep attribution recall rK and its interaction with the lineage threshold τ (§6.3). • An end-to-end evaluation harness that produces reproducible artifacts under paper/data/. The ASR matrix, the two-session RAG-to-memory workflow, the τ × K ablation, adaptive mitigation cells, recovery POCs, and the utility baseline are byte-equal CI-verified (asr_matrix_v1.csv, rag_memory_e2e_v1.csv, r_k_ablation_v1.csv, adaptive_mitigations_v1.csv, coarse_authority_contrast_v1.csv, coarse_authority_matrix_v1.csv, authority_source_manifest_v1.csv, authority_repair_poc_v1.csv, rag_memory_llm_summary_v1.csv, utility_baseline_v1.csv). Hosted-model AgentDojo and live-model sweep artifacts are preserved as auditable logs rather than byte-pinned tests, and the per-operation micro-bench (perf_baseline_v1.csv) is regenerated because its numbers are wall-clockdependent. Roadmap. §2 fixes the threat model and trust assumptions. §3 presents the six-module design and the propagation rule. §4 discusses the implementation boundary, including the JSON-envelope hardening that prevents the LLM judge from being prompt-injected. §5 specifies the 2
three attack families. §6 reports the empirical results. §7 positions MemLineage against published defences and concurrent preprints (Fides, RAGPart/RAGMask, NeuroTaint, A-MemGuard, Memory Sandbox, RTW-A, and the IPI-defence landscape catalogued in [8]). §8 treats limitations – the LLM-inference trust assumption, the white-box attention requirement of the strongest attribution algorithm, and the deferred HMAC fast-path.
2
1. Untrusted-source authorship. The adversary controls one or more of: web pages the agent fetches, documents the agent ingests, output channels of an external tool the agent invokes, or messages from an upstream agent that is permitted to write into M . This is the standard indirect-prompt-injection threat [7]. 2. Memory write through legitimate paths. The adversary can inject entries into M only along paths the agent or host already permits: by being read from a controlled web page, by being returned from a controlled tool, by being delivered as a message from an upstream agent. The adversary cannot bypass the write surface to insert raw entries with arbitrary metadata.
Threat Model
This section fixes the system, the attacker, and the trust boundaries that the rest of the paper operates under. The five-front survey of named defences and named attacks is deferred to §7; here we describe only the model that those defences and attacks share.
2.1
System Model
3. Cross-session persistence. Payloads injected in session si may remain in M and re-emerge through retrieval in any later session sj , j > i. We refer to this as a sleeper pattern, modelled directly on Zombie Agents [18], AgentPoison-style trigger-bound backdoors [4] and MemoryGraft-style retrieval poisoning [14].
An LLM agent is a host process that drives a chatcompletion model in a loop, calling tools and consulting memory between turns. The agent has three durable surfaces relevant to provenance: • A memory store M : a content-addressed set of entries written by either the host (on user request) or the agent itself (when the agent decides a derived observation is worth keeping). Each entry carries a payload, a creation timestamp, and any metadata the host or agent attaches.
4. LLM-mediated laundering. The adversary’s payload may enter M indirectly: an untrusted source gets retrieved into context, the LLM emits a derived summary or rephrasing, and the agent commits the derived content as a fresh entry. This laundering step is the lineage-stress case the present paper uses (§5).
• A retrieval surface R(q) ⊆ M : an embedding-based or BM25-based recall step that selects a bounded subset of M to splice into the next prompt. We do not require any specific retrieval algorithm; the threat model only assumes that the surface returns entries authentic to M (see §2.3).
5. Adaptive querying (deferred). The adversary may, in principle, issue probe queries against the deployed system to estimate its lineage threshold and policy verdicts and tune subsequent payloads. The deterministic harness in §6 fixes a non-adaptive payload sequence per cell so that the ASR numbers are reproducible without API calls; we discuss adaptive evaluation as future work in §8.
• A tool surface T : a fixed set of functions the agent may invoke between turns. A subset Tsens ⊆ T is policy-sensitive (file-system writes, financial transfers, outbound HTTP, code execution, etc.); the security goal is to prevent unauthorised dispatch into Tsens .
Adversary non-capabilities. The following are explicitly outside the adversary’s reach in this paper:
The host process holds long-term key material on behalf of one or more principals (the user, the agent itself, and any upstream agent or tool that is permitted to write into M ). Principal keys are used to sign entries written into M ; key custody is part of the trusted base (§2.3).
2.2
1. Host process integrity. The adversary cannot modify the host binary, the MemLineage library code, or any in-process state outside M . 2. Principal-key secrecy. The adversary cannot read private keys held by registered principals (the user, the agent, upstream principals). Equivalently, the adversary cannot forge a signature under a principal whose key they do not hold.
Attacker Model
We assume a white-box adversary with full knowledge of MemLineage’s design, metadata schema, lineage propagation rule, and sensitive-action policy. The adversary is omniscient about the defence; they are constrained only by the capability boundaries listed below. Adversary capabilities. The adversary controls at least one untrusted data source reachable by the agent and may exercise any of:
3. LLM-inference manipulation. The adversary cannot rewrite the LLM weights or inject an external compute path that bypasses the agent’s normal inference pipeline. Their only influence on inference is 3
through the contents of M and any untrusted source that is retrieved into context.
3. Query-injection / retrieval poisoning [6, 14]: the adversary plants entries chosen so that benign user queries surface them through the standard retrieval ranking, and the surfaced content carries injection. MemoryGraft additionally models persistent compromise via poisoned experience entries.
4. Attestation forgery. If the deployment opts in to TEE-bound key custody (an extension we discuss in §8, not part of the main evaluation), the adversary cannot forge a hardware attestation report.
2.3
4. Sleeper-via-derivation (§5): the adversary’s payload never enters M directly. The adversary plants only ingredients in untrusted sources; the LLM is coerced, through normal retrieval and summarisation, to emit the payload as a fresh derived entry that the agent commits. The derived entry is, by construction, an authentic output of the agent principal – which is precisely why signature-only defences cannot rule it out. This family is the benchmark stressor the paper uses to test whether a defence preserves chain of custody through LLM-mediated derivation.
Trust Assumptions
We use a three-tier source classification consistent with [4, 14, 7] and aligned with the broader IPI-defence taxonomy in [8]: • Trusted: user prompts; entries written by the host on explicit user authorisation; principal-key infrastructure (private keys, public-key registry, Merkle log root anchor). • Semi-trusted: tool return values from sandboxed or audited tools, and entries derived from them through a documented policy. Semi-trusted content can be cryptographically authenticated as having come from the named tool, but its contents can still be attackerinfluenced if the tool consumes adversary-controlled input.
2.5
G1: Source-bound integrity. No entry that is recoverable from M can have been authored by a principal whose key is not in the public-key registry. Equivalently, the adversary cannot inject raw entries that pass verification.
• External: arbitrary fetched web content, thirdparty document corpora, messages from upstream agents whose host trust we do not control, and any payload reached transitively through those.
G2: Lineage-bound trust. An entry whose lineage chain contains an External ancestor cannot present as Derived-Trusted unless every step from the ancestor passes the lineage threshold τ .
These classes induce two derived labels that MemLineage reasons about explicitly: Derived-Trusted (an entry derived by the LLM from parents that all evaluate above the lineage threshold τ ) and Derived-Untrusted (the dual case). The propagation rule that defines them is given in §3; the empirical sweep over τ and chain length K is in §6.3.
2.4
Security Goals
MemLineage’s evaluation in §6 is judged against four informal goals; §3 formalises the propagation rule that satisfies them.
G3: Cross-session persistence of provenance. Provenance metadata is content-addressed and signed; it is invariant under serialisation, transport, and cross-session retrieval. A derived-untrusted chain remains derived-untrusted across arbitrarily many session boundaries.
Attack Pattern Taxonomy
The threat surface partitions into four families. MemLineage addresses the last three; the first is included only to fix the boundary.
G4: Sensitive-action gating. No call into Tsens is dispatched whose justifying memory contains an entry that fails G2. This is the operational invariant the policy gate enforces (§3).
1. Single-turn direct injection [7]: a malicious string in the current turn’s untrusted context steers the model output before any memory write occurs. This family is well covered by detection-, sanitisation-, and IFCbased defences [8]; we treat it as orthogonal and out of scope.
The signature-only baseline (§6.2) closes G1 alone. G2 and G4 require the lineage layer; G3 requires both. The empirical claim of the paper is that the four goals are jointly enforceable at sub-millisecond per-operation cost (§6.4) with no loss of utility on the deterministic harness (§6.2).
2. Memory-backdoor poisoning [4]: the adversary plants trigger-bound entries that, once retrieved by a matching query, steer the agent toward an attacker-chosen action. The hard sub-case is the sleeper: triggerbound entries that lie dormant across many sessions before activation.
2.6
Out of Scope
The following adversaries and surfaces are explicitly outside the present paper: 4
• Single-turn direct prompt injection with no memory write (covered by [7, 8]).
MemLineage module
User
M1
Provenance metadata
External input
• Host-process compromise (kernel exploits, container escapes, debugger attach). The host trusted base is responsible for keeping principal keys and the Merkle log anchor confidential.
M2
Ed25519 sign
M3
RFC6962 Merkle log
Memory Store M ProvEntry records: signed + Merkle-logged M4 lineage DAG over M (max-strong)
Read + gate path
• Manipulation of retrieval inference itself beyond the contents of M . Active learning attacks against the retriever’s ranking model are a separate threat class.
M6
tool
LLM
Sensitive gate
• Defences against the LLM revealing private memory contents to the adversary (orthogonal confidentiality goals; e.g., [5] addresses these via IFC labels and is largely complementary to provenance).
M5 Tagged ctx labels+entries Verifier-aware retrieval
if context has Derived-Untrusted
DENY (✓)
ALLOW → dispatch
Figure 1: MemLineage architecture: six modules around a single memory store M . The write path (top) commits an entry through M1 metadata, M2 per-principal Ed25519 signing, and M3 RFC-6962 Merkle logging; the read + gate path (bottom) retrieves through M5, attaches trust labels via M4 lineage propagation, and refuses sensitive tool calls at M6 whose justifying context carries a DerivedUntrusted ancestor. Adversary-reachable inputs (red) are the only path through which untrusted content reaches M ; the rest of the pipeline is host-trusted (§2).
The combination of (i) cryptographic label integrity, (ii) cross-session persistence, (iii) coverage of agent-derived entries, and (iv) defence against LLM-mediated laundering is what MemLineage contributes; §7 positions this entry-level memory primitive against coarse recall removal, temporal re-entry control, semantic taint, and experiencedriven memory defences.
M4 – Lineage DAG. A directed acyclic graph over M whose edges record LLM-mediated derivation, weighted by an attribution algorithm. The propagation rule on this DAG is what closes the sleepervia-derivation column. §3.5.
Design
MemLineage attaches cryptographic provenance and perderivation lineage to every memory entry, and refuses sensitive actions whose justifying context contains an entry whose chain of custody crosses an External ancestor through a too-strong edge. This section fixes the architecture (§3.1), the metadata schema (§3.2), the cryptographic binding (§3.3), the append-only log (§3.4), the lineage DAG and its propagation rule (§3.5), the verifieraware retrieval surface (§3.6), and the sensitive-action gate (§3.7). The attack used to evaluate the design end-to-end (sleeper-via-derivation) is described separately in §5.
3.1
Trusted principal
Write path
• Model-weight-level backdoors and supply-chain compromise of the inference engine; we assume the LLM weights are trusted.
3
Adversary-reachable input
M5 – Verifier-aware retrieval. A retrieval-time hook that verifies signatures, looks up trust levels, and renders a tagged context segment for each retrieved entry. §3.6. M6 – Sensitive-action gate. A policy gate aligned with Progent [13] that examines the trust labels in the active prompt before dispatching any call into Tsens (§2.1). §3.7.
Architecture
The write path is M1 → M2 → M3 (with M4 attaching parent edges); the read path is M3 → M5 → prompt, with M6 gating any tool dispatch produced by the resulting LLM turn. The single threaded invariant the rest of the section preserves is that no entry ever leaves M5 without a verified signature and a current trust label.
MemLineage is six modules sitting around a single memory store M ; Figure 1 renders the dataflow. M1 – Provenance metadata. A canonical schema attached to every entry that records the writer principal, the source-data hash, the write-time context hash, the trust level, and the parent-edge list. Defined in §3.2.
3.2
Provenance Metadata (M1)
Each entry is a record of the form
M2 – Cryptographic binding. Ed25519 signature over the canonical encoding of every entry, keyed per principal. §3.3.
ProvEntry = ⟨eid, content, writer, hsrc , hctx , t, trust, P, W, ts, nonce, σ⟩.
M3 – Append-only log. An RFC 6962-style Merkle log [9] of entry hashes with explicit tombstone semantics. §3.4.
where eid is a UUIDv7 entry identifier; content is the payload bytes (optionally encrypted); writer is the principal that authored the entry, drawn from user, agent:i, 5
tool:τ , or external:u; hsrc is the SHA-256 of the original data blob the entry descends from; hctx is the SHA-256 of the write-time prompt context; trust ∈ {0, 1, 2, 3} is the trust level (0 = Trusted, 1 = Derived-Trusted, 2 = Derived-Untrusted, 3 = External); P is the list of parent entry identifiers and W the matching list of attribution weights (§3.5); ts is a nanosecond write timestamp; nonce is a 16-byte fresh nonce; and σ is the Ed25519 signature. The record is serialised in canonical CBOR [2]. Canonicality matters: σ covers every field except σ itself, so any encoding ambiguity would let an adversary forge two distinct entries with the same signature. Canonical CBOR fixes the ordering of keys, the encoding of integer minor types, and the representation of zero-length collections, which together give deterministic bytes.
3.3
[0, 1] reported by an attribution algorithm A: A : (c, P, X) 7→ {w(p, c) : p ∈ P }, where P is the candidate-parent set and X is the writetime context. Section 6.3 ablates three concrete instances of A. Propagation rule (D14). Trust on the DAG is propagated by a max-of-strong-edges rule: trust(c) = max 1[w(p, c) > τ ] · trust(p), p∈Pc
where Pc is the parent set of c and τ ∈ [0, 1] is the declassification threshold. Trust is encoded so that a larger value is less safe; the max picks the riskiest still-strong parent. The inequality is strict (w > τ ): at τ = 0 every parent with positive weight contributes, and at τ = 1 only parents whose attribution weight exceeds 1 contribute. With Coarse’s constant edge weight of 1.0, τ = 1 is therefore an inert configuration in which no parent contributes; deployments should choose τ strictly below the algorithm’s expected output range. Section 6.3 sweeps the full [0, 1] interval and reports the boundary explicitly so the inert endpoint is visible. No-strong-parent fallback. When {p ∈ Pc : w(p, c) > τ } is empty, max is taken over an empty set and we return trust(c) = Trusted. This is the conservative choice in the absence of positive attribution evidence: the propagation rule does not fabricate an untrusted ancestor when none of the candidates surpassed the threshold. The cost is that an attacker who can suppress every attribution edge below τ – e.g. by prompt-injecting the LmSelfEval judge to score every parent low – can defeat propagation locally. Section 4 describes the JSON-envelope hardening that targets this exact case; §8 acknowledges the residual risk and notes that deployments which want fail-closed semantics on the no-evidence branch can flip the default to Derived-Untrusted at the cost of additional false positives. Soundness. Equation (1) satisfies the following property, which forms the formal basis of the sleeper-via-derivation defence:
Cryptographic Binding (M2)
Each registered principal holds an Ed25519 keypair [1]. Public keys are distributed through a host-local registry; private keys live with the principal (the user, the agent, or the host on the agent’s behalf). On write, the principal signs the canonical encoding of every field except σ. On retrieval, M5 looks up the writer’s public key in the registry and verifies σ; verification failure causes the entry to be dropped before the trust label is ever consulted. The verifier’s key registry models the trusted base. An adversary who cannot register a public key cannot mint entries that survive the verify step (security goal G1, §2.5). An adversary who can compromise a registered key falls outside the threat model (§2.2, non-capability 2). A batched HMAC fast-path is admissible for high-writerate deployments (every N writes are signed once with an Ed25519 batch over the HMAC roots), but the deterministic harness in §6 uses per-entry Ed25519 throughout. The fast-path is documented as future work in §8.
3.4
Append-only Log (M3)
M3 is an RFC 6962-style Merkle log [9]. Every committed entry adds a leaf SHA256(eid ∥ σ) to the tree; the log root is anchored at host start-up and re-rolled into a checkpoint every N leaves. Inclusion proofs allow any third party to convince themselves that a given entry is on the canonical log without holding the full log. Deletion is deliberately not destructive. To remove an entry, the host emits a tombstone marker (a leaf prefixed with the literal ts:) that names the original entry id and the deletion reason; the original leaf is retained and remains inclusion-provable. This rules out an adversary silently rewriting history by deleting inconvenient entries: any deletion is itself a signed, inclusion-provable event.
3.5
(1)
Theorem 1 (Untrusted-Path Persistence). For any entry c ∈ V , if there exists a path p0 → p1 → · · · → pk = c in G such that w(pi , pi+1 ) > τ for all 0 ≤ i < k, and trust(p0 ) ≥ 2, then trust(c) ≥ 2. Proof sketch. Induction on the path length k. For k = 0 the path is the single node p0 with trust(p0 ) ≥ 2 by hypothesis; the claim holds vacuously. The non-trivial content is in the step. Assume the property at k − 1, so trust(pk−1 ) ≥ 2. Since w(pk−1 , pk ) > τ , the indicator 1[w(pk−1 , pk ) > τ ] in Equation (1) applied at pk is 1, so pk−1 contributes trust(pk−1 ) ≥ 2 to the maximum and therefore trust(pk ) ≥ 2.
Lineage DAG and Propagation (M4)
Formalisation. The memory induces a directed acyclic graph G = (V, E) where V = M and E ⊆ V × V contains an edge (p, c) iff p appeared in the LLM context at the moment c was written. Each edge carries a weight w(p, c) ∈ 6
The empirical content of Theorem 1 is conditional: the antecedent that “every edge along the path is strong” is only as good as the attribution algorithm’s recall on Kstep derivation chains, denoted rK . Section 6.3 quantifies rK for the three attribution algorithms below. Attribution algorithm taxonomy. MemLineage admits a family of attribution algorithms, of which three are evaluated:
[BEGIN MEMORY entry_id=<8-hex> trust=DERIVED_UNTRUSTED] ...content... [END MEMORY]
where the sentinel is bracketed between literals the LLM cannot synthesise without escaping. The gate reads the sentinel directly, not the LLM’s own claim about which entries it consulted.
Coarse w(p, c) = 1 if p appeared in c’s retrieval set or tooloutput context, else 0. No model inspection. Implementation: trivial; deployment: cheap. Coarse establishes the upper bound on recall and the lower bound on precision.
3.7
The policy surface follows Progent’s JSON-schema predicate model [13]. A predicate matches a tool call if the tool name and parameter projection satisfy a schema; predicates are labelled sensitive if they correspond to actions in Tsens (file system writes, outbound HTTP, code execution, etc., per §2.1). M6 is intentionally two-layered. The first layer is a context-level chain-of-custody check: when the agent emits a tool call, M6 walks the active prompt for the M5-rendered sentinels, takes the maximum trust label across all matched memory segments that the call’s parameters mention, and identifies whether any security-critical parameter is justified by Derived-Untrusted or External context. The second layer is a per-tool authority rule: for each governed parameter, the policy names the source classes allowed to authorize that parameter. For example, a send_money.recipient may be authorized by a trusted bill or a fresh user request, while an external TODO item may appear in the prompt but cannot authorize the recipient of the transfer. This distinction is what lets M6 recover utility without accepting attacker-controlled arguments. The gate returns one of five verdicts:
LmSelfEval w(p, c) = score(p, c, X) from a secondary LLM judge that scores [0, 1] how much p semantically influenced c’s content. Implementation cost: one extra smallLLM call per write. We discuss the JSON-envelope hardening that prevents the judge itself from being prompt-injected in §4. P AttnAttr w(p, c) = ℓ,h attnℓ,h (c, p) from a white-box attention sweep over the inference model. Requires openweights inference (we use Qwen2.5-7B INT4) and is only available in deployments where the same model serves inference and is also instrumented for attention readout. Coarse closes the implicit-laundering boundary at zero cost (every retrieved parent counts at weight 1.0). LmSelfEval narrows the over-tagging Coarse produces by withholding the trust label for parents the judge does not score above τ . AttnAttr is reported as a precision lower bound; it requires white-box access we do not always have at deployment time.
3.6
Sensitive-Action Gate and Authority Repair (M6)
Allow No Derived-Untrusted (or External) ancestor was present in the matched segments. The call dispatches.
Verifier-Aware Retrieval (M5)
The retrieval surface returns a subset R(q) ⊆ M for each query q. Before R(q) reaches the prompt, M5 performs four steps per entry:
Deny An External-ancestor segment is present and the deployment policy forbids dispatch. The call is refused; the agent is told an entry mentioning untrusted content is in scope.
1. Verify the signature against the writer’s registered public key (M2). On failure, drop and emit an audit event.
Require-User As above, but the deployment policy elects to escalate the decision to the user. The agent waits.
2. Verify the inclusion proof against the most recent log root (M3). On failure, drop. 3. Look up the trust label and the chain provenance from M4.
Strip-and-Retry The matched untrusted segments are surgically removed from the prompt and the agent is asked to re-emit. This recovers utility when the laundered content is incidental to the task.
4. Render the entry as a tagged context segment that the downstream LLM and the M6 gate can read structurally.
Repair-and-Retry A sensitive parameter was proposed from an unauthorized source, but M6 has an authorized candidate value for the same parameter from trusted provenance. M6 rewrites only that parameter
The rendered segment uses an unambiguous sentinel that matches a parser the policy gate reads in §3.7; for illustration, an entry surfaces as 7
and retries the call with an audit record that names both the rejected source and the selected authority.
tool-specific authority rules with action-parameter provenance.
The choice between Deny, Require-User, Strip-andRetry, and Repair-and-Retry is a deployment-level policy parameter; the deterministic ASR evaluation in §6.2 uses Deny to make the binary success / failure measurement well-defined. The recovery POC in §6.2 exercises the Repair-and-Retry path on banking-shaped tool calls: it rewrites attacker-sourced recipient and amount arguments only when trusted bill evidence supplies authorized replacement values, and otherwise fails closed. The composite invariant the six modules jointly maintain is exactly the four security goals stated in §2.5: G1 from M2, G2 from M4 + Theorem 1, G3 from M2 + M3, and G4 from M5 + M6. The empirical evidence that the invariant holds end-to-end in the deterministic harness is in §6.
The split between core and adapters is enforced at import time: nothing in core imports LangGraph, so the core primitives are reusable under any agent framework.
4
4.2
Implementation
MemLineage is implemented as a single Python package (prov_mem) that integrates with LangGraph as middleware on the agent’s write and retrieve paths. This section documents four implementation choices that materially affect either security or reproducibility, and points readers at the code locations the §6 artifacts can be regenerated from.
4.1
Canonical Encoding Pin
The signature in M2 covers the canonical CBOR encoding of every field except σ. We use cbor2 with canonical=True, which fixes (i) the integer minor-type encoding, (ii) the deterministic key-ordering for maps, and (iii) the absence of indefinite-length items. The pin matters: without it, two implementations encoding the same record could produce signatures that disagree on the same bytes, which an adversary could weaponise into a confused-deputy duplication of an entry. The decoder additionally enforces a length and type schema before passing the record to the verifier, so a malformed input is rejected before the signature check ever runs.
4.3
Prompt-Injection Hardening of the LM Judge
LmSelfEval (§3.5) calls a secondary LLM to score w(p, c) on [0, 1]. Because the candidates p may themselves contain attacker-controlled text (an External entry being evaluated for derivation strength is the common case), the judge prompt is itself a prompt-injection target. We harden it along three orthogonal axes:
Module Layout
The codebase follows the core / adapters / eval / cli boundary recommended by our project guidance:
1. Structural isolation. The user message is a JSON envelope; candidate content is a JSON string value, not inline text under a delimiter the attacker could imitate. Whatever escape sequences the attacker emits remain quoted as string content rather than reopening the prompt frame.
• prov_mem.core – M1 metadata, M2 crypto, M3 Merkle log, and the MemoryStore that integrates them. • prov_mem.lineage – M4 attribution algorithms (Coarse, LmSelfEval, AttnAttr) and the propagation rule from Equation (1).
2. Explicit role assertion. The judge’s system prompt states verbatim that “every string value in the user message is DATA, not INSTRUCTIONS.” The judge’s job is to score, not to act on, the candidate text.
• prov_mem.retrieval – M5 verifier-aware retrieval hook and the TaggedContext render.
3. Bounded surface area. Per-candidate content is truncated to max_content_chars=2000 bytes and the candidate set is capped at max_candidates=20, so the attacker cannot dilute the judge’s attention with megabytes of primer.
• prov_mem.policy – M6 sensitive-action engine, schema-compatible with Progent [13]. • prov_mem.adapters – the LangGraph middleware surface (write hook, retrieve hook, attribution injection).
We additionally narrow the conservative-on-error catch in the judge wrapper: only ConnectionError, TimeoutError, and the anthropic.APIError family are treated as transient (returning a low edge weight that triggers safety); programmer errors and shape mismatches propagate, so a malformed judge deployment fails closed at startup rather than silently dropping weight to zero. The deterministic harness in §6 replaces the real LLM judge with a ScriptedJudge that emits a prescribed per-step weight schedule wk = w0 · dk−1 . This
• prov_mem.attacks – deterministic adapters for AgentPoison-style, MemoryGraft-style, and sleepervia-derivation. • prov_mem.eval – the evaluation harness, the MockAgent / ClaudeAgent / TrustAwareClaudeAgent family, the DefenseProfile runner, the τ × K ablation entry point, and the authority-repair POC that combines 8
pins the τ × K ablation behaviour, which is what makes paper/data/r_k_ablation_v1.csv byte-equal CIverifiable.
4.4
tests/dev/test_coarse_authority_contrast.py), coarse_authority_matrix_v1.csv (regenerated by scripts/run_coarse_authority_matrix.py and byte-equal CI’d by tests/dev/test_coarse_authority_contrast.py), authority_source_manifest_v1.csv (a static manifest of benchmark source labels and their production analogues), authority_repair_poc_v1.csv (regenerated by scripts/run_authority_repair_poc.py and byte-equal CI’d by tests/dev/test_authority_repair_poc.py), rag_memory_llm_sweep_v1.csv and rag_memory_llm_sweep_manifest_v1.json (hosted multi-model logs generated by scripts/run_rag_memory_llm_sweep.py), rag_memory_llm_summary_v1.csv (regenerated by scripts/summarize_rag_memory_llm_trials.py and byte-equal CI’d by tests/dev/test_rag_memory_llm_summary.py), rag_memory_llm_trials_manifest_v1.json (hosted-run metadata for the checked-in live log), utility_baseline_v1.csv (regenerated by scripts/run_utility_baseline.py and byte-equal CI’d by tests/dev/test_utility_baseline.py), strict_utility_v1.csv (regenerated by scripts/run_strict_utility.py and byte-equal CI’d by tests/dev/test_strict_utility.py), and perf_baseline_v1.csv (regenerated by tests/perf/test_micro_benchmarks.py but not byte-equal CI’d, as the numbers are wall-clockdependent). The test surface runs in roughly one second on a single core; the LLM-backed matrix runner (scripts/run_llm_matrix.py) is the only path that requires API access, and is gated behind an ANTHROPIC_API_KEY check (or the Copilot CLI session under –provider copilot-cli) that fails fast with a non-zero exit code if the credential is absent.
LangGraph Middleware
The agent integration layer is a single middleware (ProvMemMiddleware) that hooks two events: • on_retrieve stores the most recent retrieval result list in a per-thread state slot. With auto_attribute=True (the default), this list becomes the candidate-parent set for the next on_write that fires before the next retrieve; this closes the implicit laundering surface that arises when callers omit explicit parents on a write that immediately follows a retrieve. • on_write pulls the parent set, invokes the selected attribution algorithm, computes parent_weights, applies the propagation rule from Equation (1), and persists the resulting ProvEntry into M3 with a fresh signature. A deployment that wants explicit-parents-only semantics (callers must declare parents on every write) sets auto_attribute=False; this configuration is exercised only in the ablation that measures the size of the implicit laundering surface.
4.5
Verifier Registry and Key Rotation
The verifier registry maps a principal id (a SHA-256 prefix derived from the public key) to the public key itself. Two early-development mistakes inform the current API: duplicate registration raises PrincipalAlreadyRegistered rather than silently overwriting; key rotation is a separate update_key call with explicit semantics. Without these, a partially-trusted host could rebind a registered principal id to an attacker key and present old entries as if they had been authored by the attacker.
4.6
5
Reproducibility Surface
Attacks Modelled
We evaluate MemLineage against three attack families that span the threat surface fixed in §2: AgentPoisonstyle (§5.1) and MemoryGraft-style (§5.2) reproduce the threat models of two published memory-poisoning attacks; sleeper-via-derivation (§5.3) is a lineage-stress workload that exercises the laundering capability in the attacker model (§2.2, capability 4). All three are realised as deterministic adapters in the harness so that §6.2’s ASR numbers are reproducible bit-for-bit.
The deterministic harness produces reproducible artifacts under the paper/data/ layout (§6.1), including asr_matrix_v1.csv (regenerated and byte-equal CI’d by tests/dev/test_runner.py), rag_memory_e2e_v1.csv (regenerated by scripts/run_rag_memory_e2e.py and byte-equal CI’d by tests/dev/test_rag_memory_e2e.py), r_k_ablation_v1.csv (regenerated by scripts/run_r_k_ablation.py and byte-equal CI’d by tests/dev/test_r_k_ablation.py), adaptive_laundering_v1.csv and adaptive_mitigations_v1.csv (regenerated by their scripts and byte-equal CI’d by tests/dev/test_adaptive_laundering.py), coarse_authority_contrast_v1.csv (regenerated by scripts/run_coarse_authority_contrast.py and byte-equal CI’d by
5.1
AgentPoison-style: Memory Backdoor
Trigger-Bound
Threat model. A per-trigger backdoor against the agent’s memory, modelled on AgentPoison [4]. The adversary plants entries in M that, once retrieved by a query containing a chosen trigger token sequence, steer the agent toward an attacker-chosen sensitive action. 9
Adapter sequence. The deterministic adapter emits, in order:
Stage 1: Plant (k = 0) Untrusted source
commit
e0 External
1. A plant phase. A small set Etrig ⊆ M of poisoned entries is committed under an External writer principal whose key is not in the verifier registry of the prov_mem or sig_only_baseline cells. Each entry pairs a trigger string with a sensitive-action instruction.
Stage 2: Derivation chain (k = 1, …, K)
2. A trigger phase. A user-side query that contains the trigger is issued; the retrieval surface returns the matching poisoned entry; the agent sees the entry and decides whether to dispatch.
Stage 3: Trigger (k = K + 1)
retrieval + LLM paraphrase
e1 DerivedUntrusted
w>τ
eK DerivedUntrusted trigger retrieves chain tip
Benign query
Why this column is the easiest. Any defence with a working signature layer closes AgentPoison-style: the planted entries do not verify under any registered principal, so M5 drops them before they reach the gate. This is the column the sig_only_baseline cell already solves in Table 1. We include AgentPoison-style as a sanity check that signature integrity does what it advertises, not as a discriminating measurement.
5.2
...
Recall eK
sig-only baseline
× DISPATCH
Sensitive sink call MemLineage
✓ DENY
M4 propagates External along every strong edge (w > τ) (Theorem 1: Untrusted-Path Persistence)
Figure 2: The sleeper-via-derivation attack as a three-stage chain. The adversary commits e0 to an untrusted source (Stage 1); the agent’s normal retrieval-and-summarise loop walks the LLM through e1 → · · · → eK along edges with w > τ (Stage 2); a benign trigger query at k = K + 1 surfaces the chain tip (Stage 3). The two defence verdicts underneath show the leverage point: a signature-only baseline sees a properly-signed eK and dispatches; MemLineage’s lineage layer (M4) propagates the e0 External label to eK via Theorem 1 and the gate refuses.
MemoryGraft-style: Oracle-Retrieval Poisoning
Threat model. A retrieval-poisoning attack modelled on MemoryGraft [14]: the adversary plants poisoned experience entries under the agent’s own writer principal, exploiting any path through which agent-derived memory gets committed. MemoryGraft additionally specifies that retrieval returns the union of BM25 and FAISS recall against a target query; we model the oracle case in which a chosen query will surface a chosen entry (an upper bound on retrieval-poisoning effectiveness). Adapter sequence.
5.3
sleeper-via-derivation: Derivation
Sleeper-via-
Threat model. This workload instantiates the hardest chain-of-custody case in the persistent-memory threat class studied by recent work [18, 10, 19]. Unlike the previous two families, the adversary’s payload never enters M directly under the adversary’s writer principal. Instead, the adversary plants only ingredients in untrusted sources; the LLM is coerced, through normal retrieval and summarisation, to emit the payload as a fresh derived entry that the agent commits under its own principal. The derived entry is, by construction, an authentic output of the agent principal, indistinguishable to a signature-only defence from a benign summary of the same context.
1. Plant. The adversary delivers a payload through a path the agent treats as a legitimate write: an upstream-agent message, a tool return, or an authenticated document upload. The entry is committed under the agent principal (key is in the registry) and surfaces as External or Derived-Untrusted depending on the path. 2. Trigger. A user query whose top-k retrieval contains the plant entry surfaces it into context; the agent dispatches the sensitive action.
Three-stage attack. Figure 2 traces the chain end to end.
Why this column matters. MemoryGraft-style survives the signature layer: the entry is signed under a writer principal the verifier trusts, so M5 admits it. The defence has to look at what the entry descended from, which is exactly the lineage check in M4. The sig_only_baseline cell consequently fails this column in Table 1; MemLineage blocks it because the lineage chain reaches an External ancestor.
Stage 1: Plant (k = 0). The adversary commits an entry e0 to an untrusted source the agent will eventually fetch. e0 is natural-language prose with no explicit trigger; instead it carries a latent semantic primer – naming, framing, or stylistic cues that bias what an LLM downstream will paraphrase e0 into. On ingest, M5 surfaces e0 at trust = 3 (External). 10
Stage 2: Derivation chain (k = 1, . . . , K). A userside query Qk , indistinguishable from a benign workflow query, is issued. The retrieval surface returns ek−1 . The LLM produces an output that paraphrases, summarises, or continues the content of ek−1 . The agent’s write policy commits the output as ek , signed under the agent principal. Without lineage attribution, ek surfaces as if it were a fresh agent observation; with lineage attribution, M4 reports ek−1 ∈ Pek with weight w(ek−1 , ek ), and Theorem 1 forces trust(ek ) ≥ 2 provided every edge along the chain is strong.
• Signature-only defences (the sig_only_baseline cell in our harness) verify eK under the agent principal, observe a valid signature, and dispatch. Theorem 1’s antecedent is unobserved without a lineage layer. • IFC-based agent planners such as Fides [5] enforce confidentiality and integrity labels at planning time but do not persist the labels across a memory write; the derived entry eK committed at the end of Stage 2 has no surviving label by the time Stage 3 fires (§6.2). • Retrieval-stage filters such as the RAGPart / RAGMask family [11] operate on the R(q) surface but cannot distinguish a benign summary from a laundered payload that arrived through an authentic writer principal.
Stage 3: Trigger (k = K + 1). A separate, ostensibly unrelated user query QK+1 retrieves eK . The semantic primer originally planted in e0 has survived the chain and biases the LLM into emitting a tool call into Tsens . M6 either dispatches the call (defence fails) or refuses it (defence succeeds).
• Memory Sandbox [10] and RTW-A [19] motivate coarse memory-layer controls that remove recall or attenuate high-risk capabilities after exposed reads. Those controls are valuable baselines; the separator for MemLineage is whether the system can keep benign recall available while refusing only sensitive actions whose justification descends from untrusted memory ancestry.
The three stages give a clean controlled measurement of the chain length K, which is the variable that distinguishes MemLineage from all signature-only defences and from any defence whose label lifecycle is per-execution. Design variables. Four variables determine an instance:
sleeper-via-derivation is therefore the workload in which all three capability dimensions of §3 – signature, lineage, and policy gate – have to fire jointly for the defence to preserve useful memory while blocking sensitive dispatch. The empirical claim of §6 is that they do on the deterministic harness.
• Chain length K ∈ {1, 2, 3, 5}; longer chains give the LLM more opportunities to lose the primer and give the attribution algorithm more opportunities to drop the edge below τ (§6.3). • Primer type: stylistic, framing, naming, or domaincontext. Different primer types vary in how robustly they survive paraphrase / summary derivation steps.
5.4
Out of Scope
The deterministic harness does not model the following families that are otherwise present in the IPI-attack literature; they are either dual to, subsumed by, or orthogonal to the three above:
• Sink action: a fixed enumeration of send_email, execute_code, http_post, db_query. The choice changes the LLM’s bias toward emitting the corresponding tool call when primed.
• Single-turn direct prompt injection [7], which never enters M (out of scope per §2.6).
• Derivation prompt: summarise, paraphrase, continue, refine. Each induces a different semantic distance between ek−1 and ek and therefore a different attribution-edge weight.
• Query-injection attacks against an LLM agent’s memory at retrieval time, e.g. [6]: the adversary’s capability surface is a strict superset of MemoryGraft-style’s when retrieval is oracle-modeled, so MemoryGraftstyle is the relevant upper bound for §6.2.
The three families described above span the two attack vectors that signature-only integrity partially covers (AgentPoison-style and MemoryGraft-style) and the lineage-stress vector that requires the defence to carry ancestry through agent-authored derivation (sleeper-viaderivation). Section 6.2 reports ASR for all three under the three defence cells; Section 6.3 ablates the sleeper-viaderivation cell against the lineage threshold τ and chain length K. What this workload separates. The workload separates three defence classes:
• Active learning attacks against the retriever’s ranking model, which target the inference path before R(q) is fixed (separate threat class per §2.6).
6
Evaluation
We evaluate MemLineage along five axes: • RQ1 (Effectiveness): does MemLineage stop the three representative memory-poisoning attacks where signature-only baselines fail? (§6.2) 11
• RQ2 (Lineage attribution): how does the trust threshold τ interact with the derivation chain length K to govern propagation safety, and does the per-step weight schedule expose the boundary that a singleshot τ ablation would miss? (§6.3)
tests/dev/test_authority_repair_poc.py. The live-model trial log is summarized by scripts/summarize_rag_memory_llm_trials.py; larger multi-model runs use scripts/run_rag_memory_llm_sweep.py. LLM-backed runner. A separate framework path (ClaudeAgent, TrustAwareClaudeAgent, and a CopilotCLIAgent that drives GitHub Copilot’s gpt-5.3-codex) exercises the same defence cells against live LLM inference; the runner is shipped with the artifact (scripts/run_llm_matrix.py) and writes paper/data/asr_matrix_llm_v1.csv. The first such run (gpt-5.3-codex, nine Premium requests, single trial per cell) is included with the artifact. We do not mix that table into the deterministic numbers below; §8 explains why the two evaluation surfaces have different noise floors and what the all-zero LLM cells mean. Defence cells. The headline ASR ablation compares three core configurations (DefenseProfile in the runner):
• RQ3 (Performance): what is the per-operation overhead of MemLineage’s critical-path primitives? (§6.4) • RQ4 (Utility): does MemLineage introduce false positives on benign workflows – i.e. does the lineage layer ever spuriously deny a legitimate dispatch? (§6.5) • RQ5 (Adaptive boundaries): where do white-box laundering strategies break the current attribution assumptions? (§6.6)
6.1
Experimental Setup
Harness. The headline numbers in this section come from a deterministic evaluation harness whose verdicts do not depend on LLM judgement: attack adapters (§5) emit fixed payload sequences, the cryptographic-verification path (M2 + M3) is deterministic by construction, and the LM-self-eval attribution algorithm (LmSelfEval, §3.5) is exercised through a scripted judge that returns a pre-set per-step weight schedule. This is unlike Fides [5], NeuroTaint [3], MINJA [6], AgentPoison [4], and most of the IPI defences catalogued in [8], which evaluate against live model inference and report results that drift with the model version; the deterministic harness lets us pin three the deterministic artifacts at byte-equal CI, and ASR cells in those artifacts therefore have no measurement variance, so we report no confidence intervals for deterministic cells. We empirically validated determinism with a 1000-rerun stress test of the §6.2 ASR matrix and the §6.5 utility matrix (tests/dev/test_determinism_stress.py under PROV_MEM_DETERMINISM_TRIALS=1000); both artifacts produced byte-identical output across all reruns. The relevant artifacts are: tests/dev/test_runner.py regenerates and byteequal CI-verifies paper/data/asr_matrix_v1.csv; scripts/run_r_k_ablation.py regenerates paper/data/r_k_ablation_v1.csv (also byte-equal CI-verified); scripts/run_utility_baseline.py regenerates paper/data/utility_baseline_v1.csv (byte-equal CI-verified); and tests/perf/test_micro_benchmarks.py regenerates paper/data/perf_baseline_v1.csv (regen-only because its numbers are wall-clock-dependent). Additional livemodel artifacts (rag_memory_llm_trials_v1.csv and agentdojo_gate_matrix_v1.csv) are not byte-equal CI-verified because they depend on hosted model behaviour. The authority-repair POC (paper/data/authority_repair_poc_v1.csv) is deterministic and byte-equal CI-verified by
1. no_defense – baseline; every retrieved entry reaches the sensitive-action gate as if it were trusted. 2. sig_only_baseline – per-entry Ed25519 signature plus Merkle inclusion, but no lineage propagation; entries that verify under a registered trusted principal remain trusted even when their upstream derivation parents have disappeared. 3. prov_mem – the full MemLineage stack: signature + Merkle + lineage propagation under Coarse (§6.3) + verifier-aware retrieval (M5) + sensitive-action policy gate (M6). Section 6.5 additionally reports two harness-level mechanism profiles, memory_sandbox and coarse_taint, to separate fine-grained provenance from recall removal and whole-context taint. These rows are not local reimplementations of the published Memory Sandbox or RTW-A systems. The single variable changed across cells is the propagation and gating policy; all other plumbing (codec, store, retrieval surface, attack adapter sequence) is held identical, so any column-to-column delta is attributable to the defence. Attack cells. We model three attacks with documented threat-model differences: AgentPoison-style (per-trigger backdoor against the agent’s memory), MemoryGraftstyle (oracle-style retrieval-poisoning, modelling BM25 ∪ FAISS recall), and the lineage-stress workload sleeper-viaderivation (an Derived-Untrusted payload that is laundered through a single LLM-mediated derivation and then activated). The first two attacks correspond to published threat models [4, 14]; sleeper-via-derivation is derived from the persistent-memory pattern studied by Zombie Agents and concurrent delayed-trigger evaluations [18, 10], but 12
is parameterised to stress the specific distinction between signature-only and lineage-aware memory defences (see §6.2).
Defence no_defense sig_only_baseline MemLineage
Benchmark and baseline scope. The custom threeattack harness below is a mechanism-isolation benchmark, not a replacement for public benchmark sweeps. We use it because it can pin cross-session memory state, derivation parents, and policy verdicts exactly. We evaluate on this harness rather than against the AgentDojo, InjecAgent, or Agent Security Bench suites that the IPI-defence landscape [8] has converged on. The reason is scope, not deficit: AgentDojo and its peers test single-session tool injection where each user task is a self-contained interaction, but sleeper-via-derivation’s laundering capability requires cross-session memory persistence between Plant (k = 0) and Trigger (k = K + 1), which the public benchmarks do not model as a first-class primitive. We validate this scope claim empirically: the test tests/sec/test_agentdojo_scope.py loads AgentDojo v1.2.1’s full task surface (4 suites, 97 user tasks, 35 injection tasks, 74 tools across the suites) and walks every UserTask class, asserting the absence of any cross-session or multi-turn-memory primitive (no list-of-prompts ordering, no session/turn attributes, no persistent-memory state). The check passes on the current AgentDojo release and is pinned so a future upstream change that adds such a primitive will surface as a CI failure and prompt us to revisit this scope decision. Adding cross-session persistence to AgentDojo is a separate engineering effort we leave to follow-up.
Poison ↓ Graft ↓ Sleeper ↓ 1.00 0.00 0.00
1.00 1.00 0.00
1.00 1.00 0.00
Table 1: ASR matrix (deterministic harness). Source: paper/data/asr_matrix_v1.csv; CI verifies byte-equality with the runner output. Lower is better.
between the LLM and the AgentDojo ToolsExecutor (paper/data/agentdojo_sweep_v1.csv). The two baseline configurations each satisfy the attacker goal on 1/6 pairs and recover utility on only 2/6 pairs. All three MemLineage configurations keep the attack goal unsatisfied on 6/6 pairs. Among them, authority repair has the best utility rate (5/6) and the lowest average latency, because it can rewrite attacker-sourced parameters from trusted authority instead of relying on repeated denial and retry. This is still a bounded external-validity run, not a statistically powered AgentDojo benchmark, but it upgrades the smoke result from bridge validation to live gate evidence. On the defence side, we isolate the trust-propagation path by comparing three configurations of our own (no_defense, sig_only_baseline, prov_mem) as an ablation rather than instantiating a published thirdparty defence as a fourth column. The closest published peers each require a harness component the deterministic runner does not model: Fides requires AgentDojo’s tool-call simulator, RAGPart and RAGMask [11] require embedding-based retrieval ranking, and NeuroTaint [3] requires the LLM-based causal-attribution judge. The three-cell isolation is therefore a methodological choice that keeps the §6.2 ASR delta attributable to the trust-propagation difference rather than to incidental retrieval-stack changes. Because this DirectAttack sweep is conservative on modern instruction-tuned models, §6.2 also reports a separate vulnerable-agent stress test. That stress test changes the agent profile and payload shape, not the six banking pairs: it is used only to show that the no-defence surface can be driven to 6/6 ASR when the agent trusts tool-output workflow records.
End-to-end cross-benchmark runs. To anchor the scope discussion in real numbers, we shipped a CLI-backed AgentDojo bridge (src/prov_mem/eval/agentdojo_bridge.py) that connects the hosted gpt-5.3-codex backend to AgentDojo’s pipeline and ran a single (user_task, injection_task) pair end to end. On banking/user_task_0 (“pay the December 2023 bill”), the agent without injection completes the task correctly (utility = True, transferring to the legitimate IBAN). With AgentDojo’s DirectAttack (which embeds the attacker’s goal as a TODO: {goal} template into the environment) targeting injection_task_0 in the same environment, the agent transfers to the attacker IBAN instead (utility = False, security = True): same model, same task, same defence cell, but the embedded injection successfully hijacks the tool dispatch. This single cell pair, captured at paper/data/agentdojo_smoke_v1.csv, contradicts the “model is part of the defence” reading of the all-zero §6.2 LLM-backed table: when the injection is task-relevant rather than a benign-query memory plant, gpt-5.3-codex is not invariably IPI-safe. We then ran a bounded Codex CLI sweep over six banking DirectAttack pairs (three dictionary-first user tasks by two injection tasks) with the MemLineage policy gate inserted
6.2
RQ1: Attack Success Rate Across Defences
Table 1 reports the deterministic Attack Success Rate (ASR; ↓ = better defence) for each (defence, attack) cell, and Figure 3 renders the same data as a heatmap so the MemLineage row’s all-zero band is visible at a glance. Reading the matrix. Three observations matter. First, sig_only_baseline closes the easiest column (AgentPoison-style): the poisoned entries arrive without a signature registered under a principal the policy trusts, so the verifier drops them before they reach the gate. This reproduces the well-known guarantee of supply-chain integrity primitives [15, 16, 9]. Second, the same baseline fails open on the remaining two columns: MemoryGraftstyle arrives through a retrieval path the signature layer has no opinion about, and sleeper-via-derivation arrives as 13
Attack family (ASR ↓ better) Poison Graft Sleeper raw forged derived No def. none
1.00 win
1.00 win
1.00 win
blocked
0/3
Sig-only sign.
0.00 block
1.00 win
1.00 win
1/3
MemLineage lin.+policy
0.00 block
0.00 block
0.00 block
3/3
Defence
Summary trust
Parents
Tool
Fired ↓
no_defense sig_only_baseline MemLineage memory_sandbox coarse_taint
TRUSTED TRUSTED EXTERNAL TRUSTED EXTERNAL
0 0 1 0 1
send_email send_email send_email NONE send_email
1 1 0 0 0
Table 2: Two-session RAG-to-memory workflow. The EXTERNAL document is summarised into persistent memory in session 1 and recalled in session 2. MemLineage and coarse taint preserve the untrusted parent edge; Memory Sandbox blocks by removing recall. Source: paper/data/rag_memory_e2e_v1.csv; byte-equal CI in tests/dev/test_rag_memory_e2e.py.
files for this utility-preserving distinction. The broader landscape of IPI-centric agent defences is surveyed in [8]. Two-session RAG-to-memory workflow. The attack matrix above is mechanism-level. To check that the same separation survives a more realistic agent loop, we add a two-session RAG workflow: session 1 retrieves an EXTERNAL vendor document, summarises it into persistent memory under the user principal, and session 2 retrieves only the summary before the agent proposes a tool call. Table 2 reports the resulting cross-session chain. The sig_only_baseline row is the important failure mode: the summary is authentically written by the user principal, but the upstream EXTERNAL document has disappeared. MemLineage preserves that edge across the write/read boundary and blocks the sensitive call in the later session. Memory Sandbox also blocks, but only because the trigger session receives no recalled memory, which is why its utility trade-off is evaluated separately in §6.5.
Figure 3: ASR matrix on the deterministic harness, rendered from paper/data/asr_matrix_v1.csv. Green cells are defended (ASR = 0); red cells are attacker wins (ASR = 1). Cell text gives the value and verdict, the right strip reports blocked attack families per defence, and the blue outline highlights the all-zero MemLineage row. Same numbers as Table 1; the visual is what reviewers see first, the table is what reviewers cite.
a properly-signed entry whose payload the writer did not intend to endorse. Signature integrity is necessary but not sufficient. Third, MemLineage is the only configuration that drives all three columns to zero. The mechanism that closes the residual columns is lineage propagation under Coarse plus the verifier-aware retrieval render (§3): the laundered entry surfaces as Derived-Untrusted, and the sensitive-action gate refuses to fire on a DerivedUntrusted chain. Why sleeper-via-derivation matters. The differentiator that separates this work from signature-only and per-execution agent defences is the sleeper-via-derivation column, not the AgentPoison-style column. Fides [5] enforces deterministic policies at planning time but does not persist label provenance across an LLM-mediated derivation: once a derived entry has been committed to memory, the IFC planner has no way to recover its upstream lineage. Retrieval-stage filtering operates at the recall surface but cannot distinguish a benign summary from a laundered payload that arrived through an authentic writer principal; both arrive as properly-signed, properly-typed outputs. MemLineage closes both gaps by attaching cryptographic provenance and lineage to every entry, so a derived-untrusted chain remains unsafe to dispatch even after the entry has been written and re-retrieved. The same column also clarifies what MemLineage does not claim. Memory Sandbox [10] and RTW-A [19] show that coarse memory-layer controls can break persistent attack chains by removing recall or attenuating high-risk capabilities after exposed reads. MemLineage targets a different operating point: keep ordinary recall available, bind every entry’s trust label cryptographically, and refuse only sensitive actions whose active memory justification descends from untrusted ancestry. Section 6.5 reports harness-level coarse-taint and Memory-Sandbox-style pro-
Live-model validation. We also ran the same RAG-to-memory workflow through hosted Copilot CLI models. The original gpt-5.3-codex smoke log (paper/data/rag_memory_llm_trials_v1.csv) is now paired with a multi-model sweep (paper/data/rag_memory_llm_sweep_v1.csv) over gpt-5.3-codex, gpt-5.4-mini, and gpt-5.2 (90 hostedmodel calls, 10 trials per model and defence; metadata in rag_memory_llm_sweep_manifest_v1.json). The current Copilot subscription accepted these three model identifiers; probes for gpt-5.4 and claude-sonnet-4.5 returned “model not available.” The deterministic summary artifact paper/data/rag_memory_llm_summary_v1.csv records aggregate rates with Wilson 95% intervals. On gpt-5.3-codex, no_defense fires the sink in 25% of 20 trials ([0.11, 0.47]), while MemLineage fires it in 0% ([0.00, 0.16]). On gpt-5.4-mini, no_defense fires in 20% of 10 trials ([0.06, 0.51]) and MemLineage again fires in 0% ([0.00, 0.28]). gpt-5.2 did not emit the sensitive call in this workload under any defence, so the sweep treats it as a low-ASR model rather than evidence of additional blocking. Across the models that do attempt the sink, MemLineage remains on the critical path; this sweep observed zero sink firing under MemLineage, with intervals that reflect the small sample size. 14
No defence
Sig-only
MemLineage
(a) Outcomes
0.6
Utility
Attack blocked
(b) Gate action Denied Repaired T = timeout
None
1 Rate
Sink fired rate
Sig
0.4
Deny Retry Repair
0.2
0
None
Sig
Deny
Retry
Repair
0
1
2
3
4
5
Sensitive calls / row AgentDojo banking DirectAttack, 6 pair(s), 30 rows
0.0
gpt 5.2
gpt 5.3-codex
Figure 5: AgentDojo gate sweep. The left panel aggregates utility and attack-blocking rates over six banking DirectAttack pairs; the right panel reports average denied and repaired sensitive calls per row. Authority repair gives the best utility/security trade-off, while generic retry preserves security at much higher gate cost. Source: agentdojo_sweep_v1.csv.
gpt 5.4-mini
Figure 4: Hosted-model RAG-to-memory sweep. Bars show sink-firing rates and Wilson 95% intervals from rag_memory_llm_summary_v1.csv. MemLineage keeps the sink at zero on all three Copilot CLI models; gpt-5.2 is a low-ASR model for this workload rather than an additional blocking win.
AgentDojo gate sweep. Finally, we inserted a MemLineage gate between the Codex-backed AgentDojo LLM element and AgentDojo’s ToolsExecutor (paper/data/agentdojo_sweep_v1.csv). The 30-row sweep covers six banking DirectAttack pairs and five defence/recovery rows. The two baseline rows are weak on both axes: they execute the attack on 1/6 pairs and recover utility on 2/6 pairs. prov_mem_deny and strip_and_retry block the attack on all six pairs and recover utility on 4/6 pairs. strip_and_retry, however, incurs the largest gate cost: it averages 5.17 denied calls per row because the hosted model often retries the same untrusted instruction. This negative result is useful: generic retry preserves security, but it is a poor recovery primitive. prov_mem_authority_repair keeps the same 6/6 attack-blocking rate while recovering utility on 5/6 pairs and averaging only 0.33 denied and 0.33 repaired calls per row. The bridge supplies trusted bill authority for send_money.recipient and send_money.amount; M6 then rewrites attacker-sourced sensitive parameters when trusted replacements exist and denies when they do not. AgentDojo itself does not expose a persistent-memory provenance primitive, so these rows are bridge-level authority-repair validation rather than a claim that AgentDojo natively stores MemLineage lineage labels. We record this assumption separately in paper/data/authority_source_manifest_v1.csv: task ground-truth bill fields stand in for connectorauthenticated sources such as bank API invoice objects, trusted contact stores, approved endpoint registries, and local file indexes that a production integration would need to label at ingest time.
Table 3: AgentDojo vulnerable-agent stress test over six banking pairs. ASR is AgentDojo’s strict attack success rate; utility is the original task success rate. Source: agentdojo_toolcall_vulnerable_defenses_v1.csv.
Defence
ASR
Util.
Block
Repair
No defence Sig. only Deny Strip+retry Authority repair
6/6 6/6 0/6 0/6 0/6
2/6 2/6 2/6 4/6 4/6
0 0 6 31 4
0 0 0 0 4
it matches the vulnerable-agent condition used by many indirect prompt-injection benchmarks. Under this profile, both no-defence baselines fail on all six pairs, whereas all MemLineage rows reduce strict AgentDojo ASR to zero (Table 3). The two summary tasks are especially useful: the model both answers the user’s spending question and executes the malicious transfer, so the attack is not merely a denial of service. The slower user_task_10 rows also show the recovery trade-off: strip_and_retry remains safe but blocks 31 calls across six rows, while authority repair reaches the same 0/6 ASR with four blocked and four repaired calls. Authority-repair POC. The AgentDojo authority row above exercises the recovery mechanism in a live benchmark loop. We also keep a deterministic recovery POC (paper/data/authority_repair_poc_v1.csv) that evaluates the finer-grained recovery mechanism selected from our five recovery prototypes: tool-specific authority rules plus action-parameter provenance. In the banking-shaped send_money scenarios, an attacker-controlled TODO supplies either the recipient alone or both recipient and amount; trusted bill evidence supplies authorized replacement values. The recovery verdict is repair_and_retry, the attacker values are removed, and the recovered call matches the user-intended bill payment. When only external evidence exists, the same policy returns deny. This artifact does not claim full AgentDojo-native recovery; it isolates the missing mechanism that would be needed to turn the gate smoke’s prevention result into utilitypreserving recovery (Table 4).
Vulnerable-agent stress test. The default DirectAttack sweep above is intentionally conservative: with a modern instruction-tuned model, only 1/6 no-defence rows satisfy AgentDojo’s exact attack predicate. To ensure this is not mistaken for an intrinsically weak threat model, we also run a deliberately permissive no-defence profile that treats tool-output workflow records as trusted operational instructions, then inject an executable-looking ACTION send_money record into the same bill/transaction surfaces. This stress test is not our default deployment assumption; 15
Scenario
Verdict Utility Blocked
trusted bill only injected recipient injected amount + recip. external evidence only
allow repair repair deny
yes yes yes no
K (chain length)
yes yes yes yes
Table 4: Authority-repair POC. Source: authority_repair_poc_v1.csv; byte-equal CI in test_authority_repair_poc.py.
K (chain length) τ
1
2
3
5
0.00 0.10 0.30 0.50 0.90 0.99 1.00
1 1 1 1 1 1 0
1 1 1 1 1 1 0
1 1 1 1 1 1 0
1 1 1 1 1 1 0
1
2
3
5
1 1 1 1 0 0 0
1 1 1 1 0 0 0
1 1 1 0 0 0 0
1 1 0 0 0 0 0
Table 6: Propagation outcome for LmSelfEval with judge schedule w0 = 0.9, d = 0.7. Cell semantics match Table 5: 1 = External reached the chain tip; 0 = the strong-edge predicate failed somewhere along the chain, falling back to Trusted per §3.5. Bold cells mark the rows where increasing K flips the outcome – the key qualitative behaviour a τ -only ablation would hide. The full 7×4×4 sweep across all four judge schedules is in paper/data/r_k_ablation_v1.csv (140 cells).
derivation steps that look safe in isolation can land in the unsafe region once the chain is followed long enough.
Table 5: Propagation outcome for Coarse. Cells contain propagated (1 = the External ancestor’s label reached the chain tip, so the gate at §3.7 will refuse a sensitive action justified by it; 0 = the chain tip lost the External label, falling back to the no-strong-parent default of Trusted described in §3.5). Source rows: lines tagged algorithm=A in paper/data/r_k_ablation_v1.csv.
6.3
τ 0.00 0.10 0.30 0.50 0.90 0.99 1.00
Calibration guidance. The interaction in Table 6 suggests τ should be chosen jointly with the deployment’s expected chain depth, and the direction is the opposite of the naive intuition: a higher τ weakens propagation, not strengthens it. For the chain’s External label to survive to the tip the gate must catch, every edge weight wk has to exceed τ . Under the w0 = 0.9, d = 0.7 schedule the tightest constraint is the deepest step (wK = 0.9 · 0.7K−1 ): w3 = 0.441 and w5 ≈ 0.216. A deployment that allows up to K = 5 derivation hops therefore needs τ ≤ 0.10 at the sweep granularity (any τ ≥ 0.30 loses the chain at the last step, as the bold cells in Table 6 show); a deployment that allows K = 3 needs τ ≤ 0.30. Picking τ from a single K = 1 measurement systematically over-estimates the safe upper bound for deeper chains because the deepest edge under a decaying judge sets the binding constraint.
RQ2: Lineage Threshold τ and Chain Length K
The propagation rule (§3, equation D14) admits a chain laundering attack only when the running max-of-strongedges weight ever drops to or below τ . We sweep τ against the chain length K for two attribution algorithms: Coarse (uniform weight 1.0 on every parent edge) and LmSelfEval under a per-step weight schedule wk = w0 · dk−1 , where w0 and d are the judge_init and judge_decay columns of paper/data/r_k_ablation_v1.csv. Figure 6 renders all 140 cells as five small-multiple heatmaps so the K-discriminating schedules are visible at a glance; Tables 5 and 6 below cite the two endpoints (Coarse and the steepest-decay LmSelfEval schedule) for direct numeric reference. Coarse is binary in τ , flat in K. With every edge scored at 1.0, the strict-inequality propagation rule fires whenever τ < 1.0 and is inert at τ = 1.0 (no parent satisfies w > 1, so the no-strong-parent fallback returns Trusted; see §3.5). The useful operating region for Coarse is therefore τ < 1.0; the τ = 1.0 row in Table 5 is included to make the inert endpoint visible, not to advertise a safe setting. Within τ < 1.0, Coarse cannot trade chain depth against trust loss because it has no per-step signal to decay against; the interesting cells live in LmSelfEval. LmSelfEval exposes the τ × K trade-off. Table 6 fixes the schedule w0 = 0.9, d = 0.7 – a realistic “judge starts confident, loses confidence per derivation step” profile – and sweeps τ against K. The boundary wK ≤ τ becomes visible: τ = 0.30 blocks the chain only when K ≥ 5 (since 0.9 · 0.74 ≈ 0.216 ≤ 0.30), and τ = 0.50 blocks the chain at K ≥ 3 (since 0.9 · 0.72 = 0.441 ≤ 0.50). The K dimension is genuinely discriminating: under a degrading judge, two
6.4
RQ3: Per-Operation Performance
We measure the latency of MemLineage’s critical-path primitives on a single core, no concurrency, n = 200 samples per op (where indicated, n = 100 for the most expensive Merkle proofs). All measurements come from paper/data/perf_baseline_v1.csv; Table 7 reports the median in microseconds. The full distribution (mean / stdev / min / p95) is in the CSV. Hot-path budget. The end-to-end verify hot path (memorystore_verify_full, 82 µs median) is essentially the cost of a single Ed25519 verify (81 µs) plus a small constant: the verifier’s signature check is the dominant term and codec, Merkle inclusion, and lineage / policy lookup add only a few microseconds beyond. The endto-end write hot path (memorystore_write_full, 214 µs median) is dominated by the same Ed25519 sign step (27 µs) plus codec (8 µs) and Merkle append (4 µs); the remaining ≈ 175 µs of composite cost reflects auxiliary work (principal-id and entry-id derivation, nonce generation, store insertion, and re-encoding of the signed 16
τ (lineage threshold)
(a) Coarse (uniform w=1)
(b) LmSelfEval w0 =0.9, d=1.0
(c) LmSelfEval w0 =0.5, d=1.0
(d) LmSelfEval w0 =0.9, d=0.7
(e) LmSelfEval w0 =0.5, d=0.7
0.00
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.10
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.30
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
0
0
0.50
1
1
1
1
1
1
1
1
0
0
0
0
1
1
0
0
0
0
0
0
0.90
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.99
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1.00
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
3
5
1
2
3
5
1
2
3
5
1
2
3
5
1
2
3
5
1
K (chain length)
K (chain length)
K (chain length)
propagated = 1 (gate refuses; defence holds)
K (chain length)
propagated = 0 (chain lost External label)
K (chain length)
cell flips across K (K-discriminating)
Figure 6: τ × K ablation across all five attribution configurations (140 cells). Green = propagated = 1 (the External label survives to the chain tip; the gate refuses); red = propagated = 0 (the chain tip lost the External label per the no-strong-parent fallback in §3.5). Gold-outlined cells are the K-discriminating cells: rows where increasing K flips the outcome. Panels (a)–(c) are flat in K; panels (d) and (e) are the K-degrading schedules (d = 0.7) where the interaction the prose discusses becomes observable. Source: paper/data/r_k_ablation_v1.csv, byte-equal CI-verified. Operation
millisecond. The per-step provenance cost is therefore well below the noise floor of LLM call latency, and not the bottleneck on the agent’s critical path. Where the cost concentrates. The asymptotic cost of Merkle inclusion proofs scales with log2 n of the log size; the n=256 row (298.7 µs) is more than 18× the n=16 row (16.4 µs) because each level of the proof tree adds a SHA-256 evaluation, and proof generation is currently unbatched. A batched HMAC fast-path (deferred; see §8) is the obvious next optimisation for deployments where n grows past 103 .
median (µs)
Codec encode_entry decode_entry encode_signed_view
8.0 4.9 7.6
Crypto ed25519_sign ed25519_verify
27.5 80.8
Merkle log (RFC 6962) merkle_append merkle_prove (n=16) merkle_prove (n=256) merkle_verify (n=64)
3.7 16.4 298.7 3.2
Lineage & policy propagate_trust (n=8 parents) policy_gate_call
1.0 0.7
Composite (hot path) memorystore_write_full memorystore_verify_full verifier_registry_verify verifier_hook_filter_tag (n=8)
213.6 81.9 126.4 717.8
6.5
RQ4: Utility (False-Positive Rate)
The §6.2 ASR matrix measures the defence’s effectiveness against attack workflows; this subsection measures its cost on benign workflows. We want the same gate that refuses a laundered payload to not refuse a legitimate dispatch from a TRUSTED memory entry. We model two benign workflows that exercise both surfaces of the lineage layer, plus two workflows that use untrusted external content for non-sensitive recall:
Table 7: Per-operation median latency on a single core, n = 200 samples per op (Merkle proofs at n = 100). Source: paper/data/perf_baseline_v1.csv; numbers are wall-clockdependent and will vary by hardware, so the CSV is regenerated rather than byte-equal CI-verified.
view) that the runner times end-to-end but does not break out as a separate bench row. The retrieval-time filter (verifier_hook_filter_and_tag at n=8, 718 µs median) is approximately 8 × 80 µs of per-entry verification plus rendering and trust-label filtering. The standalone verifier_registry_verify bench (126 µs) measures a path that performs an extra registry lookup per call; the end-to-end memorystore_verify_full amortises that lookup, which is why the composite figure is smaller than the registry-verify microbench. All other primitives – including lineage propagation and the policy gate – are at or near 1 µs.
• benign_derived: the user principal commits a TRUSTED parent entry (benign prose, no instruction); the next turn retrieves it and writes a TRUSTED-derivative containing the send_email instruction. Under Coarse with the default τ = 0, the derivative inherits Trusted via Equation (1).
Putting overhead in context. A typical Claude or GPT-4-class API turn is in the 102 –103 millisecond range; MemLineage’s entire write plus retrieval-time verification overhead, even at n=8 retrieved entries, sits at sub-
• benign_external_qa: an EXTERNAL document is recalled to answer a non-sensitive question. The correct behaviour is to allow recall because no sensitive sink is requested.
• benign_direct: the user principal commits a TRUSTED entry containing a legitimate send_email instruction; a later turn retrieves the entry and the agent dispatches.
17
Defence
Dir. ↑ Deriv. ↑ Ext-QA ↑ Ext-Deriv. ↑
no_defense sig_only_baseline MemLineage
1.00 1.00 1.00
1.00 1.00 1.00
Coarse taint
1.00 1.00 1.00
Utility recovered
1.00 1.00 1.00
Table 8: Legitimate-dispatch rate on benign workflows (deterministic harness; ↑ = better). All cells reach 1.00, i.e. zero false positives. Source: paper/data/utility_baseline_v1.csv; byte-equal CI in tests/dev/test_utility_baseline.py. Profile sig_only MemLineage memory_sandbox coarse_taint
1/3 3/3 3/3 3/3
4/4 4/4 0/4 4/4
1.0 blocked 100% blocked 100%
blocked 100%
blocked 100%
0.5
0.0
Attack blocked Benign kept Mixed kept
Parameter authority
Banking transfer
Email dispatch
File access
API post
Figure 7: Coarse context taint versus parameter-level authority across four sensitive tool workloads. Bar height is utility recovered; the annotation reports attacker-value blocking. Parameter-level authority preserves mixed-context utility while still blocking all attacker values. Source: coarse_authority_matrix_v1.csv.
– 9/13 – 0/13
Table 9: Harness-level baseline proxy. Attack and benign columns come from coarse_baselines_v1.csv; mixed-context utility comes from coarse_authority_matrix_v1.csv. The rows model mechanism families rather than reimplementing the full published Memory Sandbox or RTW-A systems.
• benign_external_derived_qa: an EXTERNAL document is summarised into a derived memory and later used for a non-sensitive answer. This is the benign analogue of memory laundering: the ancestry is untrusted, but the action is not sensitive.
Scenario
Taint Auth. Utility
trusted bill + note injected recipient injected amount + recip. external evidence only
deny allow deny repair deny repair deny deny
yes yes yes no
Table 10: Coarse context taint vs parameter-level authority. Source: coarse_authority_contrast_v1.csv; byte-equal CI in test_coarse_authority_contrast.py.
add a contrast artifact that places trusted bill authority and untrusted context in the same sensitive-action turn. A context-level taint gate must deny every mixed context in Table 10. Parameter-level authority does not: it allows a trusted bill-only transfer despite nearby untrusted notes, repairs attacker-controlled recipient/amount fields when trusted bill evidence supplies replacements, and still fails closed when only external evidence exists. We also aggregate this distinction across banking transfer, email dispatch, file access, and API-post workloads in coarse_authority_matrix_v1.csv: coarse context taint recovers 0/13 benign-intended mixed-context actions, while parameter-level authority blocks all 13 attacker values and recovers 9/13 actions by allowing trusted parameters or rewriting attacker-sourced parameters from trusted evidence.
Both workflows are deterministic and run through the same harness as the §6.2 attack matrix; for either workflow, sink_fired = True is the correct outcome, and a False verdict is a false positive. Reading the matrix. All twelve cells in Table 8 reach 1.00. On these deterministic benign workflows, MemLineage’s lineage layer never spuriously denies a dispatch; the measured happy-path cost is zero false positives in this regime. The derived columns matter in particular: it confirms that derived-trusted chains compose without triggering the no-strong-parent fallback (§3.5), because the derivative’s parent satisfies the strict-inequality predicate w = 1.0 > τ = 0, and that derived-untrusted chains are still usable for non-sensitive recall. Coarse-gating check. The repositioned evaluation also includes a first coarse-baseline artifact, paper/data/coarse_baselines_v1.csv, that runs the three attack workloads and the four benign workflows against memory_sandbox and coarse_taint profiles in addition to the three rows above. The MemorySandbox-style row blocks all three memory attacks (0.00 attack success) by withholding recall, but also drops all benign-dispatch columns to 0.00. MemLineage reaches the same 0.00 attack success on the deterministic attack columns while retaining 1.00 on every benign column. This is not yet a full statistical comparison against the concurrent Memory Sandbox and RTW-A systems; Table 9 is a harness-level proxy that isolates the operating point MemLineage targets: fine-grained memory use rather than coarse recall removal. Where coarse taint loses utility. The coarse matrix above is intentionally favorable to coarse taint: its benign workflows either contain no untrusted sensitive authority or ask only non-sensitive questions. We therefore
6.6
RQ5: Adaptive Laundering Boundaries
The deterministic ASR matrix is non-adaptive by design. We therefore evaluate two operating points. The default policy is utility-first: it trusts parentless derived memories unless an explicit lineage edge survives above τ . The strict policy is security-first: it denies parentless sensitive memory actions, treats any positive explicit untrusted edge as propagating, and lowers τ for multi-hop semantic summaries. We add a boundary artifact, paper/data/adaptive_laundering_v1.csv, for three white-box strategies a reviewer would naturally try. • Parent omission: the agent writes a derivative without declaring the untrusted parent and without a preceding retrieved context for auto-attribution. This fail-opens locally (sink_fired=1), matching the limitation documented in §8. • Edge dilution: the untrusted parent is present but its 18
Scenario
τ
K Ext. w Fired ↓
Strict knob
Dir. Deriv. Ext-QA Ext-Deriv.
parent omission edge dilution edge dilution semantic laundering semantic laundering
0.00 0.30 0.30 0.30 0.30
1 1 1 1 5
parentless deny explicit-edge τ =0 lower multi-hop τ
0 1 1
0.00 0.20 0.50 0.90 0.22
1 1 0 0 1
Strict mitigation
parent omission edge dilution semantic laundering
parentless sensitive deny zero-threshold explicit edges lower τ for multi-hop summaries
Default fired
Strict prop.
Strict fired
1 1 1
0 1 1
0 0 0
1 1 1
1 1 1
Table 13: Analytic strict-mode utility cost on the four benign workflows from Table 8. Source: strict_utility_v1.csv.
Table 11: Adaptive laundering boundary cells. Each row is one deterministic mechanism check, not a statistical trial. Source: adaptive_laundering_v1.csv. Scenario
1 1 1
the corresponding adversarial path; we leave a real-LLM utility sweep on the LmSelfEval judge to follow-up in §8.
7
Table 12: Default-vs-strict operating points for adaptive laundering boundaries. Default fired values are the corresponding fail-open cells in adaptive_laundering_v1.csv; strict columns come from adaptive_mitigations_v1.csv. Byte-equal CI: tests/dev/test_adaptive_laundering.py.
Related Work
We organise prior work by the mechanism a defence relies on, not by the order of publication, and then position MemLineage against the union. The systematisation of IPI-centric agent defences [8] catalogues twenty-three frameworks across five technical paradigms; the discussion below covers the paradigms that touch persistent memory and the published attacks that target it.
attribution weight is pushed below τ while trusted cover parents remain strong. At τ = 0.3, external weight 0.20 fail-opens; external weight 0.50 propagates and blocks.
7.1 • Semantic laundering: an LmSelfEval schedule with w0 = 0.9, d = 0.7 succeeds at K = 1 but fail-opens at K = 5 because the deepest edge weight drops below τ = 0.3.
Memory-Poisoning Attacks
The persistent-memory threat model is now represented by several published and concurrent lines. Three older threat models inform the baseline columns in §5. AgentPoison [4] plants trigger-bound backdoors against an agent’s vector store; the trigger is a token sequence that, once present in a query, surfaces the attacker’s entry through retrieval. MINJA [6] reformulates the attack as a query-only interaction, removing the requirement that the attacker have direct write access to the store. MemoryGraft [14] extends the surface to poisoned experience entries the agent itself commits over time, and notes – but does not implement – a sketch defence in which the agent signs each self-derived entry. MemLineage treats MemoryGraft’s sketch as the canonical signature-only baseline (sig_only_baseline in §6.2). Zombie Agents [18] is the closest attack-side predecessor to our memory-laundering workload: it formalises a two-phase infection/trigger pattern in which attackercontrolled web content is written into long-term memory through normal update logic and later drives unauthorised actions. A concurrent mechanistic evaluation [10] studies delayed trigger attacks across architectural defence layers. These works establish that persistent cross-session memory compromise is a real attack class. MemLineage does not rely on claiming otherwise; it asks what memorylayer enforcement primitive preserves useful recall while blocking sensitive actions whose justification descends from untrusted memory ancestry. Indirect prompt injection at the active-context boundary [7] is the foundational threat model these memory-side attacks descend from; we treat it as out-of-scope per §2.6.
This table is intentionally not presented as a win-rate leaderboard. Its purpose is to make the boundary explicit: MemLineage’s soundness is conditional on parent mediation and on the attribution recall rK remaining above threshold. We therefore add a companion mitigation artifact, paper/data/adaptive_mitigations_v1.csv. Table 12 shows the default-vs-strict result for the corresponding fail-open cells. These mitigations are deliberately deployment knobs, not a claim that attribution can recover a parent it never observed. They turn the paper’s most obvious whitebox objections into explicit security/utility trade-offs for operators to select. The companion strict-utility artifact (paper/data/strict_utility_v1.csv) is an analytic policy-cost table over the four benign workflows from §6.5. Parentless sensitive denial blocks benign_direct because that workflow is, by definition, a parentless sensitive memory action. The zero-threshold explicit-edge and lower-τ semantic-summary knobs retain all four benign workflows. This is the security/utility choice: fail-closed parentless semantics buy robustness against omission at the cost of requiring direct sensitive reminders to carry an explicit trusted parent or fresh user confirmation. Scope of this measurement. Table 8 covers the deterministic regime only; the LmSelfEval judge is exercised by a scripted weight schedule, so a real LLM judge that hallucinates EXTERNAL parents on benign content could in principle introduce false positives that this table does not catch. §8 discusses the no-strong-parent fallback and
7.2
Coarse Memory Gating and Temporal Re-Entry
Two concurrent preprints motivate the strongest coarse mechanism profiles we approximate in the harness. The 19
defence-effectiveness study [10] reports that input and retrieval filters largely fail on delayed-trigger attacks, while a Memory Sandbox that removes explicit recall blocks most evaluated models. Autonomous LLM Agent Worms [19] studies file-backed multi-agent propagation and proposes RTW-A: temporal write-before-exposed-read control, sealed configuration, typed memory promotion, persistent taint, and capability attenuation. These mechanisms are important but intentionally coarse. Memory Sandbox disrupts the recall capability the attack needs; RTW-A treats exposed reads of tainted carriers as contaminating authority-bearing decision state and attenuates high-risk capabilities. MemLineage takes the complementary entry-level route: it keeps recall available, signs the memory entry and trust label, records the derivation parents, and lets the sensitive-action gate make a per-dispatch decision from the retrieved entries’ ancestry. Section 6.5 quantifies this distinction with harness-level coarse profiles: security parity with coarse gating in the modelled attacks, but less benign recall loss and fewer mixed-context sensitive blocks.
7.3
cross-domain analogue and is cited only as a historical primitive, not a baseline.
7.5
7.6
Retrieval-Stage Filtering
The RAGPart and RAGMask defences [11] filter or mask candidate entries at retrieval time, treating the recall surface as the chokepoint. The assumption is that the benignversus-poisoned distinction is observable from the entry content. sleeper-via-derivation violates this: a laundered entry’s content is, by construction, an authentic LLM summary of input context, indistinguishable from a benign summary of the same context without provenance information. Retrieval-stage filtering is therefore necessary for some attack classes (corpus-poisoning attacks where the entry is overtly malicious) and insufficient for others (laundered derived entries). MemLineage’s verifier-aware retrieval (M5) strictly adds a trust-label rendering and downstream gating step to this retrieval model: it performs the filter and surfaces the trust label so the sensitive-action gate can refuse downstream regardless of recall.
IFC at Planning Time
Fides [5] is the strongest deterministic baseline in the published landscape: a planner that tracks confidentiality and integrity labels through the agent’s tool-call sequence and refuses dispatches whose labels violate a policy. Its formal guarantees are real and its evaluation on AgentDojo is convincing. The assumption that lets it terminate cleanly is that label state is per execution: at the boundary of a planner run, labels are erased. MemLineage retains the IFC discipline at the policy gate (M6) but persists the label across an LLM-mediated derivation by attaching it to the memory entry itself, so an External ancestor’s label survives every session boundary the agent crosses. The two systems are largely complementary; a deployment that wants both deterministic planning labels and durable provenance can run Fides above MemLineage.
7.4
Experience-Driven Memory Defences
A-MemGuard [17] is the closest experience-driven memory defence. It targets context-dependent malicious records and self-reinforcing error cycles by combining consensusbased validation over related memories with a dual-memory store of distilled lessons. This shifts defence away from static filtering and toward memory that can self-correct over time. The mechanism is orthogonal to MemLineage: A-MemGuard does not cryptographically bind per-entry trust labels, maintain a Merkle-auditable chain of custody, or attach weighted derivation parents to agent-authored memories. A deployment could use A-MemGuard’s lesson store as an additional validator above MemLineage’s signed memory layer; the open question is how much utility and precision the extra validation adds once entry-level lineage is already enforced.
7.7
Signature-Only Memory Integrity
A natural impulse from the supply-chain integrity literature is to re-use Ed25519 signatures and an inclusion log directly on memory entries: per-entry signing plus a hash-chain or Merkle audit log attests who authored each entry. We model this approach directly as the deterministic sig_only_baseline cell of our harness (signature + Merkle inclusion, no lineage propagation). Two orthogonal published primitives are commonly invoked here: in-toto [16] provides farm-to-table provenance for software supply chains, and the SLSA framework (documented as deployed practice in [15]) layers attestation expectations over a signed-build pipeline. Both are about static artifacts and do not address a derivation step performed by the runtime LLM. RFC 6962 [9] provides the inclusion-log primitive (which we re-use in M3); CBOR canonicalisation [2] provides the serialisation discipline that lets the signature actually cover an unambiguous byte string. The capability gap in any signature-only design is pre-
Cross-Session Taint Tracking
The closest defence in spirit is NeuroTaint [3] (the system introduced in “Ghost in the Agent: Redefining Information Flow Tracking for LLM Agents”), which propagates semantic taint across LLM agent sessions and benchmarks against a TaintBench evaluation. NeuroTaint shows that semantic taint is a useful primitive for cross-session memory; it does not, however, supply cryptographic integrity for the taint label. An adversary who can write to the memory store without being caught by the host can therefore re-label entries. MemLineage buys integrity for free: the trust label is part of the CBOR-canonical record covered by the writer’s Ed25519 signature (M2), so a re-labelling attempt produces an entry whose signature no longer verifies under any registered principal. Beyond the classic distinction, Neutaint [12] (the non-LLM-agent neural taint analyser whose name unfortunately rhymes) is the closest 20
cisely the one Theorem 1 closes: the signature attests to who signed, not from what the entry was derived. Section 6.2 reports the empirical consequence on sleeper-viaderivation.
7.8
(i)
(ii)
(iii)
(iv)
Crypto
Lineage
Crosssess.
Agentderiv.
Fides
○
○
×
○
NeuroTaint
×
✓
✓
○
Sig-only
✓
×
○
○
Memory Sandbox
×
×
○
×
RTW-A
×
○
✓
○
A-MemGuard
×
○
○
○
RAGPart/RAGMask
×
×
×
×
MemLineage (ours)
✓
✓
✓
✓
Sensitive-Action Policy
Progent [13] formalises an agent’s sensitive-action policy as a JSON-schema predicate set and is designed to be dropped in to existing agent stacks. MemLineage’s M6 gate adopts the Progent predicate model directly; the contribution here is not a new policy formalism but the trust-aware dispatch decision: the gate consults M5’s rendered trust labels, not the LLM’s own description of which entries it consulted.
7.9
Position of MemLineage
The capability that distinguishes MemLineage is the joint coverage of four dimensions that the prior work above splits across systems: (i) cryptographic integrity for the trust label itself, (ii) lineage attribution across LLM-mediated derivation, (iii) cross-session persistence of the label, and (iv) coverage of agent-derived entries (not only externally ingested ones). Fides has policy enforcement at the planner level but not durable memory-resident labels; NeuroTaint has semantic cross-session taint but not cryptographic label integrity; signature-only baselines (the sig_only_baseline cell in our harness, and any deployment that signs each memory entry without attaching a derivation graph) have (i) and partial (iii) but not (ii); RAG-stage filters have neither (ii) nor (iv); Memory Sandbox and RTW-A protect persistent state through coarse recall removal, temporal re-entry, typed promotion, or capability attenuation rather than cryptographically bound entry-level derivation; A-MemGuard validates and learns from memory failures but does not provide a signed lineage DAG. MemLineage’s specific operating point is the intersection of all four entry-level capabilities. Figure 8 plots the four-dimensional coverage across the closest systems. Rows for published peers are literature-coded capability summaries, not local reproductions in our harness.
Figure 8: Four-dimensional capability matrix. Crypto integrity for the trust label, lineage attribution across LLM-mediated derivation, cross-session persistence of the label, and coverage of agent-derived entries. ✓ = full coverage; ⃝ = partial; × = absent. Among the published and concurrent systems compared in this figure, MemLineage’s highlighted row is the only one that covers all four capabilities in one system. Peer rows are coded from their published mechanisms rather than local reproductions.
7.10
Adjacent Threads
and
Non-Competing
Several threads sit alongside MemLineage without competing for the same evaluation cells. Detection-only defences (perplexity filters, classifier-based prompt-injection guards) are an orthogonal layer that MemLineage can sit beneath; the IPI-SoK landscape [8] catalogues thirteen such systems across the detection / sanitisation paradigms and they are documented there. Confidentiality-oriented memory defences (encryption-at-rest, TEE-bound key custody) protect the contents of M rather than its trust labels and can be composed with M2’s key custody. Activelearning attacks against the retriever’s ranking model attack the surface before R(q) is fixed and are out of scope per §2.6.
8
Discussion
LLM-inference trust assumption. Throughout this work we assume the LLM weights and inference path are themselves trusted (§2.6). An adversary who can fine-tune a backdoor into the inference model, or who can route inference through a compromised endpoint, can produce derived entries whose semantic content has no legitimate provenance even though the lineage layer reports a clean strong-edge chain back to trusted inputs. MemLineage cannot detect this case from the memory side; it is a separate threat class for which weight-level attestation (e.g., LLM-supply-chain provenance for the model itself) is the appropriate primitive. We treat the two threats 21
as composable: a deployment that wants both runs an attested-inference stack underneath MemLineage. White-box attention requires open weights. AttnAttr (§3.5) is the strongest of the three attribution algorithms we evaluate, but it requires that the inference engine expose per-layer attention readouts. Closed-weight APIs do not, and most production deployments rely on closed-weight APIs. The deployment story is therefore: Coarse provides the upper bound on recall at zero cost; LmSelfEval provides the intermediate trade-off using the same closed-weight API the agent already pays for; AttnAttr is reserved for deployments that ship their own open-weights inference (e.g., a Qwen-2.5-7B INT4 deployment). Section 6.3 reports Coarse and LmSelfEval numbers; the AttnAttr ablation on the open-weights model is left to a follow-up. Per-entry Ed25519 dominates the write hot path. Table 7 shows that the end-to-end write hot path is 214 µs, dominated by Ed25519 sign (27 µs) and the auxiliary work the runner times end-to-end. For agents that write at deeply sub-millisecond cadence (e.g., dense tool-call loops), the obvious optimization is the batched HMAC fast-path noted in §3.3: every N writes are signed once with an Ed25519 signature over the HMAC roots, amortising the public-key cost. We deliberately keep the deterministic evaluation on per-entry Ed25519 because it gives a clean worst-case number; the fast-path is documented as a deferred implementation task and not measured here. Single-host deployment. The Merkle log root in M3 is anchored at the host that runs the agent. A deployment with multi-host replicated memory needs a consensus protocol on the root; we sketch the protocol in the implementation section but do not evaluate it. Cross-host replication is closer to the operational concerns of the supply-chain integrity literature (in-toto [16], SLSA [15]) than to the threat model fixed in §2, and we treat it as out of scope here. Soundness theorem antecedent. Theorem 1 is conditional: it requires that every edge along the critical path satisfy w > τ . The empirical content is the recall rK that the chosen attribution algorithm achieves at chain length K, which we measure (§6.3) but do not prove a lower bound on. A useful follow-up would establish rK lower bounds for an attribution algorithm under stated assumptions on the LLM’s paraphrase distribution; we leave this as theoretical future work. No-strong-parent fallback. When an attribution algorithm reports no parent above τ , the propagation rule from §3.5 returns Trusted – the safest label semantically, but also the most permissive for the gate at §3.7. An adversary that can suppress every attribution edge below τ (for example, by prompt-injecting an LmSelfEval judge into returning low scores for every parent) defeats lineage propagation locally and the gate dispatches the laundered entry. The JSON-envelope hardening of §4 narrows the
prompt-injection surface but does not eliminate the residual risk. Two mitigations a deployment can layer: (i) flip the no-strong-parent default to Derived-Untrusted, trading false positives for fail-closed semantics; (ii) require quorum across multiple attribution algorithms (Coarse as a coverage fallback for LmSelfEval’s precision). Section 6.6 evaluates mechanism-level strict-mode variants for the corresponding fail-open cells; the remaining open problem is a full adaptive LLM-generated payload sweep at production scale. Adaptive adversary coverage. The deterministic harness used in §6 fixes a non-adaptive payload sequence per cell so that the ASR matrix is reproducible without API calls. Capability 5 of the threat model (adaptive querying, §2.2) is therefore not exercised in the headline ASR numbers. We do, however, exercise three mechanism-level adaptive laundering boundaries in §6.6: parent omission, edge dilution, and semantic attribution decay, together with strict-mode mitigations that close those cells. The LLM-backed runner shipped with the artifact (scripts/run_llm_matrix.py) instantiates the same defence cells against either a hosted Anthropic model or GitHub Copilot’s gpt-5.3-codex; once adaptive payload generation is added on top of that runner, it becomes the natural surface for an adaptive evaluation (the current runner ships only with the fixed non-adaptive payload sequence). We treat the full adaptive ASR sweep as future work because (i) its measurement noise floor differs from the deterministic harness’s zero-noise setting and (ii) running the sweep at meaningful sample size requires a controlled API budget. LLM-backed validation: the model is part of the defence. The shipped paper/data/asr_matrix_llm_v1.csv (a single gpt-5.3-codex run via the GitHub Copilot CLI) reaches 0.00 ASR on every cell, including no_defense. The reason is not that MemLineage is redundant; it is that the runner sends a benign user query ("any query") per trial, and a safety-trained modern model declines to act on instructions hidden in retrieved memory when the user is not asking for that action. This is a complementary measurement: when the inference model is itself an effective IPI defence, the headline ASR collapses to zero across the matrix and the defence-vs-defence delta is no longer observable. A weaker model (an older Claude Haiku, an unaligned open-weights baseline, or an actively jailbroken setup) would ablate the defence layer alone within this same harness, and we leave that comparison to follow-up work. Independently, the end-to-end cross-benchmark runs in §6.1 provide direct evidence that even gpt-5.3-codex is exploitable in the right framing. With AgentDojo’s task-relevant DirectAttack injection, the same model that produced the all-zero §6.2 LLM cells dispatches the attacker’s tool call. With the explicit vulnerable_tool_content profile, a tool-call-shaped 22
injection drives both no-defence baselines to 6/6 strict AgentDojo ASR while all MemLineage rows remain at 0/6. The all-zero LLM table is therefore a runner-level artifact of the benign user query ("any query"), not evidence that the inference model is invariably IPI-safe. The deterministic harness in §6 remains the primary §6.2 evidence because it isolates the defence layer from the inference model’s own safety behaviour; the AgentDojo runs show both sides of the interaction: modern instruction hierarchy can suppress weak payloads, but a permissive tool-output agent is fully exploitable without provenance gating. Operational use of MemLineage as a building block. MemLineage’s six modules compose with several of the orthogonal defences catalogued in [8]. A deployment that wants belt-and-braces protection can run a detection-only filter (perplexity, classifier-based) above retrieval and a confidentiality-oriented memory layer (TEE-bound key custody, or encryption-at-rest) below M2. The composability is what makes MemLineage a useful primitive rather than a single point solution: it does not displace existing IPI defences; it supplies the trust-label persistence the catalogued defences uniformly assume and uniformly do not provide. Prevention is not recovery. The AgentDojo sweeps in §6.2 show a deliberate limitation of pure DENY. Blocking the attacker’s tool call keeps the security predicate false, but it does not by itself repair the task trajectory: in both the default DirectAttack sweep and the vulnerable tooloutput sweep, deny-only rows keep ASR at 0/6 while recovering utility on only 2/6 pairs. STRIP_AND_RETRY improves utility to 4/6 in the vulnerable sweep, but its behaviour on user_task_10 is costly because the model repeatedly re-enters the same payment workflow. Authority repair is the cleaner recovery path: when trusted parameter authority is available, M6 rewrites only attacker-sourced arguments and keeps the attack goal false with much lower blocking pressure. The remaining limitation is integration, not the repair rule itself: a production AgentDojo-style stack must expose trusted source labels for action parameters rather than receiving them from benchmark-side hints.
9
ing sub-millisecond per-operation overhead on the agent’s critical path. The capability that distinguishes MemLineage from the published landscape is the joint coverage of four entry-level dimensions – cryptographic integrity for the trust label, lineage attribution across LLM-mediated derivation, cross-session persistence of the label, and coverage of agent-derived entries. We release the source code, the deterministic evaluation harness, and reproducible artifacts (byte-equal CI-verified where deterministic, regenerated where wall-clock-dependent) so that the result can be checked end-to-end without API access. Future work covers a full statistical Memory-Sandbox/RTW-style comparison, adaptive LLM-generated payload sweeps, the batched-HMAC fast-path, the white-box attention attribution algorithm on open-weights inference, the multi-host Merkle anchoring protocol, and a theoretical rK lower bound for a stated paraphrase model.
References [1] Daniel J. Bernstein, Niels Duif, Tanja Lange, Peter Schwabe, and Bo-Yin Yang. High-speed high-security signatures. Journal of Cryptographic Engineering, 2(2):77–89, 2012. Verified via DOI 10.1007/s13389012-0027-1. Originally CHES 2011; this is the journalextended version. [2] Carsten Bormann and Paul E. Hoffman. Concise binary object representation (CBOR). RFC 8949, Internet Engineering Task Force (IETF), December 2020. Standards Track; Internet Standard. Verified via IETF datatracker. [3] Yuxuan Cai, Wei Tang, Cheng Wen, and Shuo Qin. Ghost in the agent: Redefining information flow tracking for LLM agents. arXiv preprint arXiv:2604.23374, 2026. Introduces the NeuroTaint system: the first comprehensive taint-tracking framework for LLM agents, with cross-session memory persistence and a TaintBench evaluation comparing against Fides. Verified via CT discrepancy-resolution round; arXiv 2604.23374 confirmed as the canonical reference under the system alias "NeuroTaint". [4] Zhaorun Chen, Zhen Xiang, Chaowei Xiao, and Dawn Song. AgentPoison: Red-teaming LLM agents via poisoning memory or knowledge bases. arXiv preprint arXiv:2407.12784, 2024. Accepted at NeurIPS 2024; verified via arXiv 2407.12784.
Conclusion
We presented MemLineage, a defence for LLM agent memory built around cryptographic provenance and LLMmediated derivation lineage. Persistent-memory attacks are now clearly established by prior and concurrent work; MemLineage addresses the enforcement question those attacks expose: how can an agent keep using long-term memory while refusing sensitive actions whose active justification descends from untrusted state? The empirical result of the deterministic harness is that MemLineage is the only configuration we tested that drives Attack Success Rate to zero on all three modelled workloads, while leav-
[5] Manuel Costa, Boris Köpf, Aashish Kolluri, Andrew Paverd, Mark Russinovich, Ahmed Salem, Shruti Tople, Lukas Wutschitz, and Santiago ZanellaBéguelin. Securing AI agents with information-flow control. arXiv preprint arXiv:2505.23643, 2025. Introduces Fides, an IFC-based agent planner that tracks confidentiality and integrity labels and deterministically enforces security policies. Verified via arXiv 23
2505.23643 (browser MCP, Scholar). Author list per arXiv abs page (9 authors).
LLM agents. arXiv preprint arXiv:2504.11703, 2025. Verified via arXiv 2504.11703.
[6] Shen Dong, Shaochen Xu, Pengfei He, and Yige Li. Memory injection attacks on LLM agents via queryonly interaction. arXiv preprint arXiv:2503.03704, 2025. Verified via arXiv 2503.03704.
[14] Saksham Sahai Srivastava and Haoyu He. MemoryGraft: Persistent compromise of LLM agents via poisoned experience retrieval. arXiv preprint arXiv:2512.16962, 2025. Verified via arXiv 2512.16962.
[7] Kai Greshake, Sahar Abdelnabi, Shailesh Mishra, Christoph Endres, Thorsten Holz, and Mario Fritz. Not what you’ve signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection. arXiv preprint arXiv:2302.12173, 2023. Accepted at AISec 2023 workshop (ACM CCS); verified via arXiv 2302.12173. Author list extended to commonly-cited 6-author form per arXiv record.
[15] Mahzabin Tamanna, Sivana Hamer, Mindy Tran, and Sascha Fahl. Analyzing challenges in deployment of the SLSA framework for software supply chain security. arXiv preprint arXiv:2409.05014, 2024. Verified via arXiv 2409.05014. Used as the best published reference to SLSA when a paper-style citation is required; the framework itself is documented at slsa.dev.
[8] Zimo Ji, Xunguang Wang, Zongjie Li, Pingchuan Ma, Yudong Gao, Daoyuan Wu, Xincheng Yan, Tian Tian, and Shuai Wang. Taxonomy, evaluation and exploitation of IPI-centric LLM agent defense frameworks. arXiv preprint arXiv:2511.15203, 2025. Comprehensive SoK over 23 IPI-centric defense frameworks (5dimension taxonomy); used as the canonical "landscape of named defenses" reference. Verified via arXiv 2511.15203.
[16] Santiago Torres-Arias, Hammad Afzali, Trishank Karthik Kuppusamy, Reza Curtmola, and Justin Cappos. in-toto: Providing farm-to-table guarantees for bits and bytes. In 28th USENIX Security Symposium (USENIX Security 19), pages 1393–1410. USENIX Association, 2019. Verified via USENIX page; ACM DL DOI 10.5555/3361338.3361435. Page numbers are conservative (USENIX 2019 proceedings range).
[9] Ben Laurie, Adam Langley, and Emilia Kasper. Certificate transparency. RFC 6962, Internet Engineering Task Force (IETF), June 2013. Experimental. Verified via IETF datatracker.
[17] Qianshan Wei, Tengchao Yang, Yaochen Wang, Xinfeng Li, Lijun Li, Zhenfei Yin, Yi Zhan, Thorsten Holz, Zhiqiang Lin, and XiaoFeng Wang. A-MemGuard: A proactive defense framework for LLM-based agent memory. arXiv preprint arXiv:2510.02373, 2025. Verified via arXiv 2510.02373v1.
[10] Jun Wen Leong. Defense effectiveness across architectural layers: A mechanistic evaluation of persistent memory attacks on stateful LLM agents. arXiv preprint arXiv:2605.08442, 2026. Concurrent May 2026 preprint evaluating persistent-memory attack defenses across architectural layers; verified via arXiv 2605.08442v1.
[18] Xianglin Yang, Yufei He, Shuo Ji, Bryan Hooi, and Jin Song Dong. Zombie agents: Persistent control of self-evolving LLM agents via self-reinforcing injections. arXiv preprint arXiv:2602.15654, 2026. Published as a workshop paper in Lifelong Agent @ ICLR 2026; verified via arXiv 2602.15654v2.
Pathmanathan, Michael-Andrei [11] Pankayaraj Panaitescu-Liess, Cho-Yu Jason Chiang, and Furong Huang. RAGPart & RAGMask: Retrieval-stage defenses against corpus poisoning in retrieval-augmented generation. arXiv preprint arXiv:2512.24268, 2025. Verified via arXiv 2512.24268. Substituted for the unverifiable "RAGShield" as the canonical RAG poisoning defense reference.
[19] Mingming Zha and Xiaofeng Wang. Autonomous LLM agent worms: Cross-platform propagation, automated discovery and temporal re-entry defense. arXiv preprint arXiv:2605.02812, 2026. Concurrent May 2026 preprint introducing file-backed agent-worm analysis and the RTW-A temporal re-entry defense; verified via arXiv 2605.02812v1.
[12] Dongdong She, Yizheng Chen, Baishakhi Ray, and Suman Jana. Neutaint: Efficient dynamic taint analysis with neural networks. In 2020 IEEE Symposium on Security and Privacy (S&P), 2020. Verified via DOI 10.1109/SP40000.2020.00022 and arXiv 1907.03756. NOTE: this is "Neutaint" not "NeuroTaint" – update prose accordingly. [13] Tianneng Shi, Jingxuan He, Zhun Wang, and Linyu Wu. Progent: Programmable privilege control for 24