Context privilege escalation targets the harness that assembles an agent's instructions rather than the application the agent is reviewing. The researchers evaluated 12 real agent harnesses and described two classes: MessageRole Context Privilege Escalation, where content crosses an intended message-role boundary, and Cross-Scope Context Privilege…
Inspect the ClaimsCase · DiggingBeagle record
Context privilege escalation let repository instructions blind an AI code reviewer
Researchers identified context privilege escalation attacks across 12 real agent harnesses, including Codex and Claude Code. In a Codex demonstration, a malicious repository instruction file narrowed review scope so the agent approved a vulnerable pull request; the same vulnerable code without the malicious override was detected and rejected. The mechanism abuses how harnesses assemble and prioritize context, not a vulnerability in the target application itself.
Assessment profile
Assessment method- Setting
- research demonstration
- Exploitation
- demonstrated
- AI role
- AGAINST AI
Basis and provenance
The recorded controlled vulnerable-review/override comparison supports a research demonstration of context-assembly abuse. Scope across harnesses and generic locators do not establish present exploitation or independently verified fixes. Assessment is a desk review of the retained canonical Claims and cited Source metadata at their recorded cutoff, not a new external verification. Impact remains ungraded. Stored evidence uses source-level locators; passage-level corroboration remains required.
Assessed Sep 24, 2026 using diggingbeagle.assessment/1.
Evidence basis: CLM-CODEX · CLM-SCOPE · CLM-CODEX2 · CLM-TAXONOMY · CLM-MECHANISM · Context Privilege Escalation paper · OpenAI - Unrolling the Codex agent loop
At a glance
Instruction hierarchy is a security boundary. A policy can be correctly written at the system or project level and still be neutralized if a lower-trust scope is allowed to supply higher-precedence context. Agent security therefore needs provenance-aware instruction resolution, not just prompt filtering.
Read the implicationsThe paper demonstrates exploitability in research setups; prevalence of real-world malicious repositories using the technique is not established.
Limits and uncertaintyFull account
Context privilege escalation targets the harness that assembles an agent's instructions rather than the application the agent is reviewing. The researchers evaluated 12 real agent harnesses and described two classes: MessageRole Context Privilege Escalation, where content crosses an intended message-role boundary, and Cross-Scope Context Privilege Escalation, where lower-trust context from one scope gains authority over another.
The Codex demonstration makes the effect concrete. A repository supplied an AGENTS.override.md that narrowed what the reviewer should inspect. With the malicious override present, Codex approved vulnerable code; in a control review without the override, the same vulnerability was detected and rejected. OpenAI's own documentation independently confirms the relevant precedence behavior: more-specific repository instructions can override broader AGENTS instructions.
Mechanism and trust boundary
- 01
Place lower-trust instructions inside repository context
An attacker controls a repository instruction surface such as a more-specific AGENTS.override.md.
Boundary: repository content / agent instruction set
- 02
Harness assembles context with precedence
The coding harness promotes the more-specific repository instruction into effective model context.
Boundary: context provenance / instruction authority
- 03
Reviewer scope is manipulated
The malicious instruction narrows or redirects the model's review so relevant vulnerable behavior is no longer examined normally.
Boundary: attacker instruction / security-review policy
- 04
Downstream tools or judgments inherit the corrupted scope
The paper reports consequences across tested harnesses including manipulated tool calls, denial of service, RCE and full agent compromise.
Boundary: model context / executable authority
Timeline
- Sep 1, 2026Event type unspecified
Context privilege escalation research becomes public
The study reports evaluation across 12 real agent harnesses, including the Codex malicious-override demonstration.
Claims & evidence
CLM-CODEXThe CPE researchers report that a malicious AGENTS.override.md caused Codex review to approve manipulated vulnerable code, while a control review without the override detected the command injection.supported
Basis: reported finding
- supportsContext Privilege Escalation paperrole not specified
V-D Manipulated Pull-Request Review in Codex, attack and control comparison
CLM-SCOPEResearchers evaluated 12 real agent harnesses and reported consequences including manipulated tool invocation, denial of service, remote code execution and full agent compromise.supported
Basis: reported finding
- supportsContext Privilege Escalation paperrole not specified
Abstract, scope of twelve agent harnesses
CLM-CODEX2In the Codex demonstration, attacker-controlled repository instructions caused Codex to approve vulnerable code that it rejected in a control run without the malicious override.supported
Basis: reported finding
- supportsContext Privilege Escalation paperrole not specified
V-D Manipulated Pull-Request Review in Codex, attack and control comparison
CLM-TAXONOMYThe paper defines MessageRole Context Privilege Escalation and Cross-Scope Context Privilege Escalation as two classes of context-assembly attack.supported
Basis: reported finding
- supportsContext Privilege Escalation paperrole not specified
Abstract; III Context Privilege Escalations in LLM Agents
CLM-MECHANISMOpenAI's Codex documentation confirms that repository AGENTS/AGENTS.override instructions are aggregated into the model context with more-specific instructions taking precedence, establishing the relevant context-assembly behavior independently of the attack paper.supported
Basis: reported finding
- supportsOpenAI - Unrolling the Codex agent looprole not specified
Constructing the initial prompt, repository AGENTS.md and AGENTS.override.md instructions
Implications
Instruction hierarchy is a security boundary. A policy can be correctly written at the system or project level and still be neutralized if a lower-trust scope is allowed to supply higher-precedence context. Agent security therefore needs provenance-aware instruction resolution, not just prompt filtering.
Controls and mitigations
- Assign explicit trust levels to repository and workspace instructions before merging them into model context.
- Prevent lower-trust scopes from narrowing mandatory security-review policy or tool authorization.
- Expose the effective instruction stack to reviewers and logs so precedence changes are auditable.
- Run security-critical review under an independent policy channel that repository content cannot override.
Unknowns and contradictions
- The paper demonstrates exploitability in research setups; prevalence of real-world malicious repositories using the technique is not established.
Sources and citation
Material revision history
- Sep 18, 2026 · Published version · first publication · revision 4
- Sep 19, 2026 · Published version · material revision · revision 17Public fields changed: attack_path, implications, mitigations, narrative, timeline
- Oct 8, 2026 · Published version · material revision · revision 99Public fields changed: assessment_profile, claims