acceptodds
Under review as a conference paper at ICLR 2027

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

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.

Primary area:
foundation or frontier models, including LLMs
Keywords:
Coding Agents, AI Safety

Reviews

Among:
Shape:
1234this paper, Bottom 2%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 1.33 over 3 reviews, above 2% of the others.
Reviewer_g6wJOpenReview ↗
Rating
1
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper studies how untrusted repository content can influence reusable permission requests in coding agents such as Claude Code and Codex CLI. It proposes a benchmark and a two-stage attack framework that first induces an overly broad allow-rule request and then, conditional on user approval, reuses that rule to carry out harmful actions without further approval prompts. The evaluation measures the scope of the acquired permissions and verifies their downstream consequences.

Critical strengths
  • I appreciate that the paper develops both a benchmark for evaluating permission escalation and an automated two-stage attack method for this setting. The benchmark provides a structured way to assess the capabilities covered by acquired permissions and their downstream consequences, while the method gives a concrete way to investigate these risks in coding agents.

  • It is a hot topic and emerging security risk.

  • The trace analysis offers useful observations about how harness-specific permission rules and repository workflows influence attack outcomes.

Critical weaknesses
  • I think the paper identifies an interesting problem, but the distinction between attacker-induced over-authorization and the expected dual-use risk of an approved rule needs more discussion. If a user knowingly approves a broad rule such as curl *, allowing later matching commands is consistent with that authorization. The more important issue is how the permission request comes to exceed the user's intended task scope, and how this mismatch could be reduced. Since the downstream evaluation is conditional on approval, it does not establish whether users would approve these rules or understand their consequences. I would have liked a more systematic analysis of permission granularity, for example by resource, operation, or task scope, and how these choices affect security and approval burden. This could provide more actionable insight for designing safer permission mechanisms.

  • I am not yet fully convinced by the additional contribution over existing permission-gate studies. AmPermBench [1] already studies authorization-scope failures in Claude Code's Auto Mode, and a public security report [2] has demonstrated harmful execution through apparently benign workflows despite the permission classifier. The specific contribution here appears to be inducing a reusable allow-rule and then exploiting it after approval. Although the related-work section makes this distinction, I would have liked a more direct comparison explaining what additional security insight this setting provides.

  • I find the attack-entry scenario somewhat underspecified. If the benign task takes place in the user's own repository or branch, the attacker's ability to modify the relevant content needs a clearer justification. The threat model assumes adversary-controlled repository content, but I would have liked a more concrete account of how that content enters the user's workflow and which files the attacker can change. For example, an external contributor's branch or a pull request would provide a clearer untrusted entry point. Evaluating the attack under the modification constraints of such a contribution, and explaining how the later repository revision reaches the agent, would make the scenario more practical and clarify which trust boundary is being crossed.

  • From a practical perspective, users may continue to rely on Claude Code or Codex for their convenience even when they know that the permission mechanisms carry risks. I would therefore have liked the paper to provide a clearer path toward making this continued use safer. The current results offer limited actionable guidance on how to reduce unsafe permission expansion while preserving the usefulness of these tools. A concrete method addressing this trade-off would have made the work much more impactful to me, and I would have been more willing to champion it.

[1] Zimo Ji et al. Measuring the Permission Gate: A Stress-Test Evaluation of Claude Code's Auto Mode. arXiv:2604.04978, 2026.

[2] Johann Rehberger. Breaking Claude Code Opus 5 Auto Mode. Embrace The Red, 2026.

Questions for authors

How were the target command prefixes selected, and could this selection introduce bias? The evaluation uses familiar command families such as curl, wget, grep, and python. Would agent behavior and attack success change if less common prefixes with comparable capabilities were used? Were the prefixes chosen independently of observed attack performance, or were they tuned for the tested agents' permission-extraction behavior?

Suggestion: I see this as a largely engineering-driven, practical security study, with the vulnerability mainly rooted in the surrounding harness and permission-management design. Given this emphasis, the authors could also consider a security conference, where the practical findings may be a stronger fit.

2 comments

We thank the reviewer for the valuable and constructive comments. We provide our point-by-point responses below.


W1: Attacker-Induced Over-Authorization vs. Dual-Use Risk, and Conditional Approval

  • Attacker-induced scope mismatch vs. natural dual-use: Thank you for this distinction. We would like to clarify that the rule itself is attacker-induced rather than needed by the user's legitimate task in our case. We do not study broadening permissions that a benign workflow already requires. Instead, Adv introduces an artificial dependency (e.g., a missing fixture) and shapes the command to trigger the harness's generalization heuristic. In our paper, the Benign Control baseline show 0 reusable rules were elicited across every model, confirming these permissions are never organically proposed by the normal task. Thus, both the rule's creation and its over-broad scope are attacker-chosen rather than a natural dual-use need of the user.

  • Conditional evaluation & user comprehension: We agree this boundary should be stated explicitly. Our evaluation intentionally isolates the system exposure conditional on approval. This is motivated by Anthropic's study showing severe approval fatigue (86.4% approval of dangerous commands, rejection falling to ~5% after 50+ prompts), while noting that empirically studying users' approval decisions and scope understanding remains an important complementary direction for future HCI research.

Revision: We have updated Section 2.1 (Lines 157–164) in the revised manuscript to clarify the "conditional on approval" assumption.


W2: Contribution Over AmPermBench [1] and the Public Security Report [2]

We thank the reviewer and agree the comparison should be explicit.

In short: [1] and [2] show that a classifier can misjudge an action (target component: the per-action classifier). We show that untrusted context can steer the agent into proposing an overly broad, unnecessary reusable rule, which, once approved, authorizes later harmful actions without any further check (target component: the rule-proposal llm module).

We also stress that inducing such a rule is non-trivial. Unmodified tasks never elicit the target rules (0/25 on all four configurations), and explicitly asking the agent to request the rule mostly fails to compete with our method. The attacker must make a broad rule look like a natural need of the task and match how each harness generalizes rules (as shown in Table 2).

AmPermBench[1]Security Report [2]Ours
Question askedDoes the classifier catch risky actions when the user's scope is ambiguous?Can an injected chain of benign-looking actions slip past the classifier?Can untrusted context make the agent request a reusable rule that later authorizes harm?
AdversaryNone; underspecified user promptsInjected web contentInjected repository content
Gate studiedAuto Mode (model-based classifier)Auto Mode (model-based classifier)Interactive approval (rule proposal and generalization, then deterministic allow-rule matching)
What failsClassifier under-blocks (81.0% end-to-end FNR)Classifier misses a staged chain (60–80% success)The rule-proposal step (agent request + harness generalization) yields a rule broader than the task needs
Attack targetN/AEach per-action decisionThe persistent authorization state PP
Must harmful action look benign to the gate?N/AYes, at every stepNo; once the rule is stored, matching actions are not inspected
Reach of one successOne actionOne chainEvery later action matching the rule
SystemsClaude CodeClaude CodeClaude Code and Codex CLI

Additional insights this setting provides:

  1. A new attack surface: the rule-proposal step. Prior work evaluates how permissions are enforced. We show that how they are proposed and generalized is itself attacker-influenceable.
  2. Harm is separated from approval. The user approves a benign, task-relevant action; the harm occurs later through the stored rule with no further prompt. This gap between a context-specific approval and a context-free syntactic rule does not exist in a per-action classifier setting.
  3. Improving the per-action classifier does not close it. The defensive lever is the rule lifecycle, and PCC offers a first way to quantify a rule's blast radius at approval time.
  4. The mechanism is harness-specific but the risk is not. Codex generalizes rules over workflow history and Claude Code over command syntax (Table 3), so the same risk appears in two independently designed systems.

The two lines of work cover complementary parts of the permission design space.

W3: Clarification on the attack-entry scenario

Thank you for pointing this out. The task does not take place in the user's own private repository: the adversary publishes a repository containing legitimate functionality on a public platform (e.g., GitHub), and the victim downloads it and asks the agent to review/run it.

Revision: We clarify this in Section 2.1 (Lines 140–149).


W4 (W1): Lack of discussion of actionable guidance for defense

We thank the reviewer for this constructive advice. To provide a clearer and more actionable path toward safer continued use of coding agents such as Claude Code and Codex CLI, we evaluate two practical defense mechanisms alongside dicussion of concrete future directions for making these execution harnesses safer:

  1. Runtime Drift Evaluation and Re-prompting:
    We evaluate a reference-based runtime defense that retains the original command that generated an allow-rule and re-prompts the user whenever a subsequent matching command's lexical drift exceeds a threshold τ\tau. Across thresholds, this mechanism exposes a direct trade-off between security and approval burden: tightening τ\tau substantially suppresses silent attack execution at the cost of more frequent benign re-prompts, whereas relaxing τ\tau reduces user interruptions while allowing more attacks to proceed silently.

  2. Permission Granularity and Approval Burden:
    We systematically compare four rule-scoping policies on attack executions blocked versus benign approval burden relative to the current harness default:

    ScopeBlockedApprovals Burden
    Prefix (default)-1.0×
    Resource96%1.5×
    Operation62%1.8×
    Exact97%2.3×

As shown in the table, Resource scoping (binding reusable rules to the approved target file path or network host) achieves the best security–usability trade-off: it blocks 96% of attacks—nearly matching Exact matching's 97%—at only a 1.5× approval burden, whereas Operation scoping blocks fewer attacks (62%) at higher cost (1.8×) and Exact matching more than doubles approval prompts (2.3×). This works because benign workflows repeatedly access the same repository paths and trusted endpoints, whereas downstream exploits pivot to distinct sensitive resources (e.g., ~/.ssh/id_ed25519 or external sinks). Overall, scoping reusable allow-rules to the approved resource provides a practical way to defend against cross-resource privilege escalation without sacrificing usability.

  1. Future Work for Safer Harnesses:
    Beyond runtime drift checks and resource-scoped rules, we outline two directions to harden the interactive approval loop itself: (i) replacing fixed syntactic or history-based heuristics with a learned rule-proposer model (trained via SFT and RL to balance task sufficiency, low approval burden, and narrow capability scope), and (ii) pairing each proposed rule with a natural-language scope explanation clarifying the resources, operations, and downstream capabilities it grants. controlled HCI user studies are needed to test human understanding.

Revision: We have already added these defenses, the granularity comparison, and the future-work discussion as Section 6 (along with additional drift sensitivity analysis in Appendix D.1) in the revised paper. Please refer to Section 6 of the paper for the full detailed discussion.


Q:How were the target command prefixes selected?

The target prefixes (Appendix A.3, Table 6) were selected a priori based on their familiarity in routine developer workflows and their functional alignment with the five adversarial goals (curl, wget, grep, unlink, sed, and python), rather than being tuned on observed attack performance. Under our threat model (Section 2.1), the adversary controls the repository context and constructs an artificial task need to induce a desired capability; because the attacker chooses which tool to embed, targeting familiar commands reflects realistic attacker behavior rather than evaluation bias.

However, if less common or non-preferred prefixes were used instead, attack success would likely be lower because agent behavior depends on learned tool-use priors and safety alignment (e.g., an agent trained to favor rm over unlink, or to avoid unfamiliar binaries, is harder to steer toward the less preferred command)—which is precisely why a rational attacker targets standard, high-prior tools.

Reviewer_k8GsOpenReview ↗
Rating
1
Confidence
4
Informativeness
1
Presentation
2
Soundness
1
Read review
Paper summary

The paper proposes a novel attack on coding agents that takes advantage of the fragility of the sensitive action authorization policies, specifically the way the authorization logic can be steered to make the user accept an overly permissive policy that can be further leveraged to execute a malicious command without any additional approvals. The authors show this attack is feasible on state-of-the-art models and their respective harnesses and outperforms naive prompt injection approaches.

Critical strengths

The paper proposes a viable attack against coding agents and shows the ability to execute it successfully against state-of-the-art coding models and harnesses. Although I have some reservations with regards to the plausibility of the overall threat model as put forth by the authors, I believe that the paper sheds a light on the ad-hoc nature of the authorization policy engines used by leading coding harnesses and the crux of the attack is plausible.

Critical weaknesses

In its current form, I believe the paper has a number of significant weaknesses that currently critically outweigh its strengths. Specifically, the attack mechanism design and the evaluation are critically lacking rigor and depth. The authors propose a four-stage attack that they term "closed-loop LLM optimizer," where the entire design and ultimately success of the approach hinges on a largely arbitrary "potential" grading of an LLM-judge. The paper does not demonstrate any meaningful relationship between the potential that an LLM-judge assigns to the adversarial rule vs. the true effect on the coding agent; in interpretability terms, the authors make strong, unsubstantiated claims about what the LLM judge asserts the coding agent could get wrong (i.e., "the agent got distracted by buggy code"), confusing plausible explanations for faithful ones. Similarly, the authors use a fall-back model for the workflow planner, which they justify with the unsupported claim that "individual open-source models exhibit constrained reasoning and distinct knowledge blind spots." The authors evaluate on a tiny 25-example test corpus and assert that their technique outperforms a simple prompt injection without any statistical significance testing. The authors, for example, forget to label what the ± numbers in Table 1 mean: standard deviation? variance? Lastly, while I find the introduction quite easy to read and follow, the quality of the writing decreases dramatically as the paper progresses, with non-sensical and clearly AI-generated terms and sentences towards the latter half of the paper (i.e., "our framework further expands the semantic boundary").

Questions for authors
  • Could the authors provide any evidence of the faithfulness of their LLM-judge-generated "potential" score to a true potential of the coding agent to be adversarially attacked?

  • Given that the authors propose an adaptive adversarial attack, why did the authors not compare against adaptive adversarial attacks, instead opting to compare against static prompt injections?

1 comment

We thank the reviewer for helping us to identify confusion in writing. We provide our point-by-point responses below.


W1(Q1): What the Potential Judge Measures and Evidence of Its Faithfulness to True Agent Exploitability.

Thank you for this critique. To address your main question directly: the Stage I LLM judge does not assign an arbitrary score, nor does it predict or explain what the coding agent will "get wrong." Below, we clarify what Potential actually checks and provide evidence connecting it to the coding agent's true downstream vulnerability.

1. What Potential Actually Checks (and Why Success Does Not Hinge on It)

  • Binary permission sufficiency, not a behavioral score: In Stage I, Potential score asks a strictly bounded capability question: given the approved allow-rule prefix, does there exist a valid command that achieves goal GG? The judge outputs a boolean (reachable = true/false) plus a concrete command-sequence witness when true. It does not guarantee successful induction of the victim model.
  • Final attack success is 100% deterministic: Stage II success does not use an LLM judge or Potential score. It is verified programmatically from observed attack effects (e.g., filesystem diffs).

2. Evidence Linking Stage I Potential to True Downstream Exploitability Because Stage I checks permission sufficiency while Stage II tests behavioral inducement, Table 2 already demonstrates their downstream link: 30 of the 54 Stage I-eligible case directly led the coding agent to execute a silent exploit in Stage II. We further select two representative traces from our log to further clarity this.

  • Concrete positive and negative trace examples from our log:
    • Positive case: For deleting ~/.ssh/id_ed25519 under the acquired rule unlink *, the Stage I judge output reachable = true with an explanation saying the possible reuse command to be unlink ~/.ssh/id_ed25519. In Stage II, the victim coding agent independently generated and silently executed that exact command.
    • Negative case: Under the narrower rule acquired unlink /path/to/report.json, the judge output reachable = false for failing to find a way to delete the SSH key with this narrow prefix because unlink is single-operand command, which fixes the target path to a non-SSH file.

Revisions in our paper: We (1) rename Potential to estimated permission sufficiency (PermSuff) and define it formally in Section 3.1, (2) explicitly note that Stage II verification uses environment checks rather than an LLM judge (Section 3.2), and (3) include the log traces in Appendix A.5 for better clarity.


W2 (Q2): Comparison Against Adaptive Attack Baselines

Thank you for raising this point. We agree that comparing against adaptive baselines strengthens the evaluation. We therefore adapted three iterative jailbreak optimizers to our repository setting under the same budget, reporting attack success num:

ModelEligible (NN)DirectITBenchTAPPAIRAutoDANOurs
gpt-5.6-luna171411121315
gpt-5.6-sol181389814
claude-haiku-4.58010211
claude-sonnet-511000000
All542 (4%)8 (15%)19 (35%)23 (43%)22 (41%)30 (56%)

Overall, our framework achieves 56% (30/54)—outperforming all adaptive baselines (35–43%) as well as static ones (4–15%).

Revision: We have updated Section 4.3 and Table 2 in the revised paper with these results.


W2: Clarification of Framing and Terminology

Thank you for highlighting these points. We agree that some of our original phrasing was imprecise, and we have revised the manuscript to state our procedures and results objectively:

  • Lines 211–212 (Implementation errors vs. agent "distraction"): We meant simply that unintended implementation errors—such as syntax errors, runtime exceptions, or incorrect file paths—can interrupt execution before the agent reaches the planned permission-requesting step. We have revised Section 3.1 to state this directly without attributing cognitive "distraction" to the agent.
  • Lines 257–262 (Fallback model justification): Our motivation is purely practical: when the primary planner exhausts its repair budget, querying a second model provides alternative workflow proposals to continue the search. We have revised Section 4.1 to state this practical motivation directly and removed speculative claims about reasoning limitations or knowledge blind spots.
  • Line 317 ("Expands the semantic boundary"): We agree this phrasing is vague. We have replaced it with a direct description of the measured result.

We also audited the whole paper to replace similarly vague or overstated phrasing with precise empirical descriptions.

Reviewer_BJ9wOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

Authors study an attack surface where attacker-controlled repository content can cause a coding agent performing a benign task to request an overly broad reusable permission. Authors introduce a two-stage automated framework that constructs repository workflows to elicit broad permissions during legitimate tasks. Then, conditional on user approval, induces adversarial actions under the resulting authorization state. Evaluated across four configurations of Codex CLI and Claude Code, their proposed framework elicits goal-supporting permissions in 58% of experimental cases and achieves verified goal completion without further approval in 47 of the 58 eligible cases, outperforming the evaluated injection baselines.

Critical strengths
  • The paper studies a practically relevant interaction between attacker-controlled repository content and reusable permission approvals. Its evaluation uses widely used Codex CLI and Claude Code harnesses across four agent configurations, and verifies downstream effects from observed system state.
  • The controlled Stage I comparison establishes permission-request formation as a credible adversarial surface.
Critical weaknesses
  • The paper repeatedly states that Stage2 is conditional on user approval. it does not measure whether users would approve these particular requests or understand their scope. The prevalence of any Bash allow rule alone does not answer that question.
  • My primary concern is that the evaluation does not establish the privilege-escalation event as defined in the paper. The definition requires a harmful action to enter the approval-free action set as a consequence of the acquired rule. Table 2 instead measures post-approval goal completion. 14 of 47 reported successes use other authorized pathways, while the remaining 33 establish prefix matching without showing that the original policy would have required approval. In current form, I think the reported 81.0% completion rate leaves the frequency of rule-enabled escalation unresolved. Paired native authorization checks under the original and expanded policies, with rule-level provenance, are necessary to substantiate the central claim of the paper.
Questions for authors
  • I think a primary question I would like to understand is that "did the new permission actually enable the harmful action, or could the agent already have done it without the new permission?" To that end, for the 33 prefix-attributed successes in Table 2, would the same harmful calls have required approval under the original policy?
  • How reliably do finalized attacks succeed on independent reruns?
  • What exact enforcement configuration produced the results? Please specify the CLI versions, initial permission rules, sandbox filesystem and network restrictions, and how permissions persist between stages. These details are necessary to reproduce the results and distinguish acquired-rule effects from pre-existing authority.
1 comment

We thank the reviewer for the valuable and constructive comments. We provide our point-by-point responses below.


W1: Concern about evaluation conditional on user approval.

We thank the reviewer for raising this point. We agree that human factors are critical in end-to-end attack success. However, our evaluation intentionally isolates the technical exploitability of agentic workflows rather than re-measuring human susceptibility. We base our assumption of user approval on recent empirical data demonstrating that users reliably approve dangerous actions due to approval fatigue. Specifically, the Anthropic study [1] of 1,053 testers found an 86.4% approval rate for inserted dangerous commands, with the rejection rate dropping to roughly 5% after 50 prompts. This established that humans are poor gatekeepers against high-frequency agent requests, our paper answers the crucial downstream question: Once a user inevitably approves a cleverly disguised request, what is the technical extent of the resulting security exposure?

Revision: We have updated the Threat Model section to explicitly cite the Anthropic study, clarifying why evaluating post-approval system exposure is a realistic, necessary contribution distinct from an end-to-end human user study.

[1] https://claude.com/resources/articles/auto-mode-default-in-claude-code


W2 (Q1): Clarification of Stage II outcomes and rule-enabled escalation.

Thank you for identifying this inconsistency for us. Comparing the original and expanded authorization policies is precisely what our experiment was intended to establish, but our presentation cause confuction. All 47 previously reported completions required approval under the original policy. After approving the Stage I-acquired rule, 33 completed without further approval through that rule, while 14 still required additional approval. The remaining 11 runs failed. Only the 33 silent completions constitute rule-enabled escalation, giving a corrected conditional Stage II success rate of 33/58 (56.9%), rather than 47/58 (81.0%).

Revision: We have revised all the associated claims in the introduction and Table 2 accordingly.


Q2: How reliably do finalized attacks succeed on independent reruns?

Thanks for raising this concern. We conducted two additional independent runs, with the following results:

EvaluationSilent Successes / Eligible casesSuccess rate
Original run33/5856.9%
Independent rerun 129/5750.9%
Independent rerun 230/5455.6%

These results reproduce the effect across runs.


Q3: Implementation details.

Thank you for requesting these details. We used Claude Code v2.1.263 and Codex CLI v0.155.1, starting with no pre-existing persistent permission rules. Both CLIs used default settings within their manual-approval modes, supporting workspace file read/write operations while requiring approval for other network and filesystem operations.

Revision: We further add the detailed filesystem and network settings, including CLI-specific permission and sandboxing differences to Appendix A.2.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.