LLM Agent Authorization Across Context Compaction
Fei et al. in Agents
The user named one payee. The summary authorized another
LLM Agent Authorization Across Context Compaction
The authorizer trusts a position, not a speaker
For each new request, a request-derived authorizer reads the latest user-message slot and turns it into a policy for permitted tool calls.
The compactor inserts a model-written summary as a user message. The next policy can therefore treat quoted tool or attacker data as the user's request.
All 1,108 automatic compactions recorded in Claude Code and Codex used the user role for summaries.
The generator's input changes at the boundary

Before compaction, the generator sees the user's question and refuses the attacker's account. After compaction, it sees a summary that recasts the blocked transfer as unfinished work, and the policy admits that account.
The stated payee did not anchor the policy
Across both policy generators, policies from the user's turns never admitted the notice's account.
The user named the landlord's account, then asked to pay rent; a notice gave a rival account as plain data. With gpt-4o and gpt-5.5 as policy generators, summary-derived policies admitted it in 91% and 59% of cases, respectively.
A data record, not an instruction, changed what the policy would allow.
Frontier compactors spot instructions, miss data

Across three suites and Claude Code and Codex prompts, gpt-5.4-mini and gpt-5.5 marked 219/220 kept injected-instruction summaries. For a plain-data notice, the policy named the account in 9/16 kept summaries from each compactor.
Text alone cannot prove who wrote a record
Text-only authorization cannot favor legitimate records beyond how distinguishable legitimate and forged transcripts are. If their distributions match, admission rates match; the bound is tight.
- pL
- Admission probability for a legitimately written record
- pA
- Admission probability for an attacker-written record
- TV(PL,PA)
- How distinguishable the two transcript distributions are
In these tests, naming never outran retention

Panel (a) plots naming against retention: across 1,472 AgentDojo summaries, every named identifier was retained. In panel (b), one added marking sentence cut naming from 61% to 39%.
A dropped identifier can still leave the door open
In the tested banking episodes, policies from summaries that dropped the account did not name it.
Across compactor conditions, 78 of 410 banking policies from summaries without the account still admitted the attacker's transfer. An open recipient field permits any payee.
An absent account can still be allowed by an open argument.
Two easy fixes lose safety or context
A prompt that drove account retention to zero still left the attacker's transfer admitted in 41% of banking episodes.
The authorizer then loses the earlier user request; with a follow-up asking for payment, its recipient can remain open.
Keep the agent's context separate from the authorizer's trusted input.
Separate what the agent reads from what authorizes

The agent keeps the full summary; in this setup, the policy generator receives only witnessed user turns. A failed integrity check returns ⊥, so the authorizer installs an empty policy.
A witnessed-request gate preserves attribution
- 1
Witness text on arrival
Ingest MAC-tags user turns and only deployer-trusted tool fields at arrival; retrieved third-party text remains unwitnessed.
- 2
Commit the full sequence
At compaction, a trusted packager copies witnessed bytes verbatim and commits to every witnessed item, in arrival order.
- 3
Verify or fail closed
The gate checks tags, order, and completeness, then releases the sequence or empties the policy input. Verification costs 0.25 to 0.40 ms per request.
The gate blocks attacks while the summary stays visible
40 attacked AgentDojo episodes; Progent refinement on. Agent saw summary; five admissions came from recipients the user's request left open.
A user-role filter can be fooled by writable history
Inside one process it handed the generator the same text as the gate; an agent-writable session or memory file can replay or splice user-role records.
Across eight adaptive attacks, the gate released the exact user sequence or emptied policy input; zero adversary-supplied or omitted items passed in 608 trials.
Witnesses, order, and completeness close distinct replay, splice, and omission paths.
What the guarantee does and does not cover
Isolate trusted state
The guarantee assumes keys, counters, ingest, and packager stay outside adversary control; a host where the agent can run code needs isolation.
Documents need provenance
User-delegated document values still need source authentication, such as signed tool outputs; request integrity alone cannot establish who wrote them.
Evaluation scope
Gate end-to-end tests used replayed AgentDojo episodes; production-harness integration, long sessions, cross-session memory, and multi-agent workflows remain to measure.
Why it matters
- Compaction is an authorization boundary: a correct policy can still enforce a grant shaped by the summary.
- Let the agent read the summary, but derive permissions from the complete, authenticated user-turn sequence.
- Open problem: how can an agent safely honor a user's delegation to a document without trusting a compactor's account of it?
15 slides, 4 min
6 days ago