arXiv(opens in a new tab)cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.22987

From Approval to Abuse: Privilege Escalation Attacks on Harness-Protected Coding Agents

Xianglin Yang, Yechao Zhang, Jiahao Liu, Yulin Chen, Yuxin Cao, Bryan Hooi, Jiaheng Zhang

ABSTRACT

Coding agents use execution harnesses to constrain the consequences of prompt injection by enforcing permission boundaries. These systems deterministically intercept any out-of-sandbox action and prompt the user for approval. To reduce approval fatigue, users can approve allow-rules proposed by the agent, after which any future action matching the rule is allowed without a prompt. In this work, we show that this mechanism introduces a new risk: untrusted context can influence the permissions presented for approval, with consequences extending beyond the immediate task. We investigate privilege escalation targeting this permission-update process. Specifically, adversarial context planted in a repository can reliably steer an agent performing a routine task into requesting a plausibly justified, yet dangerously broad allow-rule. If the user approves the request, the saved rule can effectively blind the harness, enabling adversaries to execute malicious actions that would otherwise require approval, without triggering human oversight. Across production platforms, including Claude Code and Codex CLI, we demonstrate that agents successfully elicit the target allow-rules in 58% of experimental instances. Once acquired, these rules exhibit a massive semantic blast radius, covering 56.9% of category-specific capability test cases. To further quantify the downstream risk, we show that conditional on rule approval, our exploit achieves verified, silent goal completion in 47 of the 58 eligible instances (81.0%), undermining the safety promise of human-in-the-loop oversight.

1 INTRODUCTION

Prompt injection has emerged as a central security challenge for autonomous LLM agents (Greshake et al., 2023a; Zhan et al., 2024; Debenedetti et al., 2024). By embedding adversarial instructions into repositories, webpages, tool outputs, or other untrusted contexts, an attacker can hijack an agent's reasoning process, redirecting it away from the benign user's intended task and toward attacker-chosen behavior. To mitigate this pervasive risk, recent system designs have begun to decouple an agent's proposed actions from its executable authority via independent execution harnesses (Michael & Roesner, 2026; Bouras et al., 2026; Zhang et al., 2026). This architecture ensures that compromising what an agent wants to do does not automatically determine what it is allowed to execute. While these harnesses support diverse operational configurations, interactive, human-in-the-loop authorization has emerged as a primary line of defense. As illustrated in Figure 1, under interactive authorization, the harness pauses actions outside the current authorization boundary and requests user approval.

In the interactive setting we study, the harness enforces a deterministic authorization boundary: out-of-sandbox actions not already covered by an allow rule require user approval, whether benign or malicious. Because this strict interception halts the agent constantly even for everyday tasks, frameworks like Codex CLI and Claude Code introduce mechanisms to mitigate approval fatigue. As illustrated in Figure 2, when intercepting a routine command, the harness does not merely ask for a one-time decision. Instead, the system would infer and propose a generalized, persistent allow-rule based on the agent's current actions (e.g., choosing to "not ask again" for commands sharing the curl prefix). Once established, these rules unconditionally auto-allow any subsequent matching actions without further human oversight.

Reusable allow rules make the authorization boundary depend on previously approved requests, allowing a single approval to affect subsequent actions. The security of this design

Figure

(a) Interactive Approval

(b) Privilege Escalation

Figure 1: Privilege Escalation and Its Consequences. (a) The harness intercepts actions outside the current authorization boundary. (b) Adversarial context can influence an agent to propose an over-permissive reusable rule. If approved, the rule can authorize subsequent harmful actions without additional approval prompts.

therefore depends on how new permissions are proposed and approved, in addition to how existing permissions are enforced. Because an agent’s proposed actions and permission requests are shaped by its task context, untrusted repository content may influence the permissions presented for approval. This raises a question: can such content induce an agent performing a benign task to request reusable permissions that exceed the task’s needs?

In this work, we identify and study a privilege escalation risk arising from adversarial permission elicitation in harness-protected coding agents. We demonstrate that adversarial repository context can steer an agent performing a routine task toward proposing a plausibly justified allow rule whose scope exceeds the task's needs. If the user approves and stores such a rule, the resulting authorization state can cover harmful actions outside the original task that would previously have required approval. These matching actions can then proceed without another approval prompt while the rule remains active.

To establish the feasibility and consequences of this risk, we develop an automated two-stage experimental framework. The first stage (Permission Acquisition) evaluates whether adversarial repository context can elicit over-permissive rule requests during benign task execution and characterizes the additional capabilities these rules would authorize. The second stage (Authority Reuse) evaluates whether, conditional on approval, the resulting authorization state enables harmful operations that would otherwise require further user authorization.

We empirically evaluate this framework on Codex CLI and Claude Code. Our approach successfully elicits target allow-rules in 58% of instances, exhibiting a semantic blast radius that covers 56.9% of capability test cases. Conditional on rule approval, our exploit achieves silent goal completion in 47 of 58 eligible instances (81.0%), heavily outperforming the IssueTrojanBench (20/58) and Direct Injection (1/58) baselines. These findings establish the feasibility of adversarial permission elicitation in the evaluated systems and show that its consequences can extend beyond the original task through persistent authorization state.

In summary, our contributions are as follows:

• A new risk in coding-agent harnesses. We identify and characterize a security problem in reusable authorization: untrusted repository context can influence agents to propose permissions beyond the needs of the current task, with consequences for subsequent execution if approved.

• A framework for evaluating privilege escalation. We develop an automated two-stage framework to evaluate the elicitation of over-permissive requests, the additional capabilities covered by the proposed rules, and the downstream consequences conditional on approval.

• Empirical evidence from production coding agents. Through experiments with Codex CLI and Claude Code, we demonstrate the feasibility of adversarial permission elicitation and quantify the resulting expansion of authority and its downstream risks conditional on approval.

References (49)