← Lab /Security & privacy

Context privilege escalation attacks can fully compromise real-world AI agent harnesses

Attacker-controlled content can be escalated to higher-privileged roles, leading to full agent compromise and remote code execution

Security & privacy arXiv 1 Sep 2026 Measurement Prototype evidence Threat model

Published as “What's in Your Agent's Context? Context Privilege Escalation Attacks against AI Agent Harness”

Why it matters

The attacks enable attackers to compromise agents and achieve remote code execution on the host machine, highlighting urgent security gaps in widely deployed AI developer assistants.

Summary

The authors show that all 12 real-world AI agent harnesses they studied contain hundreds of vulnerable context sources that enable two new classes of privilege-escalation attacks (M-CPE and X-CPE), and they demonstrate end-to-end exploits that can lead to full agent compromise and remote code execution. Their automated tool CORA finds 463 sources, validates 282 of them, and confirms 58% of the attack paths, but the study also notes substantial false-negative and payload-capacity limitations that lower-bound the true attack surface.

What they found 2

  1. Among the verified sources, 183 (64.9%) are assigned the highest-privilege system role

    “Among the 282 verified sources (Table VI), 183 enter the system r0 role (64.9%)”

  2. Under GPT-5.5, 58% of candidate CPE paths are behaviorally verified

    “Under GPT-5.5, the corresponding results are 1315 (74%) and 1034 (58%).”

Caveats 5

  • Only 58% of candidate CPE paths are behaviorally verified, indicating many attacks fail to achieve the intended effect.
  • CORA’s source validation can miss sources that require complex configuration or have payload-capacity issues, providing a lower bound on the true attack surface.
  • The source validation requires CORA to construct environments where a random canary can be placed in the target source.
  • Some sources require complex agent configuration files or runtime requirements, and CORA may fail to produce a valid EnvSpec to set up the environment containing the target source.
  • The LLMs may fail to follow the generated instructions in high-privileged sources due to their security alignment and ability to follow instructions.

What’s new here 4

  • Systematic analysis of context-assembly designs in real-world AI agent harnesses.
  • Definition of two privilege-escalation attack classes (Message-Role and Cross-Scope).
  • Taxonomy of 16 concrete attack vectors spanning the identified classes.
  • CORA, an LLM-assisted pipeline that automatically discovers, validates, and exploits CPE vulnerabilities.

Threat model stated by the source

AdversaryThird-party content attacker and third-party component attacker
CapabilityControls external content processed by the agent or creates malicious tools/skills/plugins that the agent loads
AssumesAgents, vendors, and LLM providers are benign; The host OS is secure and up-to-date; The attacker has no direct access to the host machine