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.
The 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.
The 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.
reported findingsupported
Researchers evaluated 12 real agent harnesses and reported consequences including manipulated tool invocation, denial of service, remote code execution and full agent compromise.
Researchers evaluated 12 real agent harnesses and reported consequences including manipulated tool invocation, denial of service, remote code execution and full agent compromise.
reported findingsupported
In the Codex demonstration, attacker-controlled repository instructions caused Codex to approve vulnerable code that it rejected in a control run without the malicious override.
In the Codex demonstration, attacker-controlled repository instructions caused Codex to approve vulnerable code that it rejected in a control run without the malicious override.
reported findingsupported
The paper defines MessageRole Context Privilege Escalation and Cross-Scope Context Privilege Escalation as two classes of context-assembly attack.
The paper defines MessageRole Context Privilege Escalation and Cross-Scope Context Privilege Escalation as two classes of context-assembly attack.
reported findingsupported
OpenAI'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.
OpenAI'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.
Implications
What remains unknown
The paper demonstrates exploitability in research setups; prevalence of real-world malicious repositories using the technique is not established.
DiggingBeagle. “Context privilege escalation let repository instructions blind an AI code reviewer.” First seen Sep 1, 2026. https://diggingbeagle.com/cases/context-privilege-escalation-let-repository-instructions-blind-an-ai-code-review/
DiggingBeagle is a non profit research project documenting AI security incidents, agent failures, vulnerabilities and AI-assisted operations. A case keeps its claims beside the sources that support, contest or limit them. Later updates stay visible, so a reader can see when the account changed.
We publish case reconstructions, dated reporting and analysis across records. Each has a different evidentiary role. About the project and our methodology explain how the work is reviewed.