# LLM Agent Authorization Across Context Compaction

> This paper shows how compaction can make request-based agent permissions treat a model-written summary as the user's words. A witnessed-request gate gives the authorizer authenticated user turns while the agent reads the summary; no attacker action completed in 40 attacked AgentDojo episodes.

- arXiv: https://arxiv.org/abs/2611.32194
- Authors: Zeming Fei, Hongming Fei, Yi Xu, Xiaoyang Wang, Ying Zhang
- Published: 2026-11-26
- Topic: Agents
- Visual carousel: https://instaxiv.com/p/2611.32194
- Explanation by InstaXiv, a secondary educational summary. Cite the original paper for exact results. InstaXiv is not affiliated with or endorsed by arXiv or Cornell University.

## The user named one payee. The summary authorized another

**91%** gpt-4o: attacker admission, summary vs user-text

## The authorizer trusts a position, not a speaker

**Before compaction:** For each new request, a request-derived authorizer reads the latest user-message slot and turns it into a policy for permitted tool calls.

**After compaction:** 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

![Figure 1](https://cdn.instaxiv.com/figures/2611.32194/figure1.webp)

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. (Figure 1)

## The stated payee did not anchor the policy

**User's own turns:** Across both policy generators, policies from the user's turns never admitted the notice's account.

**Compacted summary:** 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

![Figure 6](https://cdn.instaxiv.com/figures/2611.32194/figure6.webp)

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. (Figure 6)

## Text alone cannot prove who wrote a record

$$
\begin{gathered}p_L-p_A\le \cyan{\operatorname{TV}(P_L,P_A)}\end{gathered}
$$

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.

- $p_L$: Admission probability for a legitimately written record
- $p_A$: Admission probability for an attacker-written record
- $\operatorname{TV}(P_L,P_A)$: How distinguishable the two transcript distributions are

## In these tests, naming never outran retention

![Figure 3](https://cdn.instaxiv.com/figures/2611.32194/figure3.webp)

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%. (Figure 3)

## A dropped identifier can still leave the door open

**Name absent:** In the tested banking episodes, policies from summaries that dropped the account did not name it.

**Recipient unconstrained:** 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

**Suppress identifiers:** A prompt that drove account retention to zero still left the attacker's transfer admitted in 41% of banking episodes.

**Move summary out:** 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

![Figure 2](https://cdn.instaxiv.com/figures/2611.32194/figure2.webp)

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. (Figure 2)

## 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

| Method | Attacker actions | User tasks |
| --- | --- | --- |
| Summary in slot | 7 | 9 |
| **Gate, same summary (7 fewer actions)** | **0** | **13** |

_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

**Metadata filter:** 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.

**Witnessed gate:** 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.

Best used when: Use it when request-based permissions must survive compaction or writable histories without treating generated summaries as user intent.

## Key takeaways

- 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?

## Links

- arXiv: https://arxiv.org/abs/2611.32194
- PDF: https://arxiv.org/pdf/2611.32194

## Citation

```bibtex
@article{fei2026llm,
  title   = {LLM Agent Authorization Across Context Compaction},
  author  = {Fei, Zeming and Fei, Hongming and Xu, Yi and Wang, Xiaoyang and Zhang, Ying},
  journal = {arXiv preprint arXiv:2611.32194},
  year    = {2026},
  url     = {https://arxiv.org/abs/2611.32194}
}
```
