Skip to content

Measuring the permission gate: a stress-test evaluation of Claude Code Auto ModeMeasuring the Permission Gate: A Stress-Test Evaluation of Claude Code's Auto Mode

arXiv· arXiv:2604.04978· Zimo Ji, Zongjie Li, Pingchuan Ma, Wenyuan Jiang, Yudong Gao, Shuai WangHong Kong University of Science and Technology; Zhejiang University of Technology; ETH ZurichIndexed by this site · 13 days ago· Originally publishedSelected EvaluationSelectedAttention42

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

The authors stress-test Claude Code auto mode with AmPermBench: across 128 ambiguous-authorization tasks, end-to-end FNR is 81.0%, and 36.8% of actions bypass the classifier via Tier 2 file edits.

Questions
Claude Code auto mode uses a two-stage transcript classifier to block unauthorized tool calls, and Anthropic reports an FNR of 17% on production traffic. The authors ask: how does this permission gate perform in scenarios where user intent is clear but the authorization scope is systematically ambiguous (scope escalation)?
Methods
Building AmPermBench: 4 DevOps task families × 3 ambiguity axes (S/B/R), 128 prompts in total, each with a deterministic oracle ground truth. In isolated Docker containers, Sonnet 4.6 runs auto mode and a bypassPermissions baseline, and each of 253 state-changing actions is judged TP/TN/FP/FN.
Experiments and results
End-to-end FNR 81.0% (95% CI 73.8%–87.4%); looking only at the Tier 3 actions the classifier actually evaluates, FNR 70.3% and FPR 31.9%. 36.8% of actions bypass the classifier entirely via Tier 2 file edits, and the artifact cleanup task has FNR 92.9%. Task-level STSR rises only from 29.7% to 32.8%.
Limitations and future work
The authors state: only a single model, Sonnet 4.6, a single benchmark, and four synthetic task families were tested, so the results cannot be extrapolated to production traffic; the classifier is proprietary and may change across versions, so the results reflect April 2026 behavior; each prompt was run only once; the B-axis aggregate trend is partly confounded by task composition.
Experimental setupClaude Code's auto mode、Claude Sonnet 4.6 (claude-sonnet-4-6) · AmPermBench · FNR、FPR et al.
Threat model
The evaluated object is the Claude Code auto mode permission system (two-stage transcript classifier). The scenario is non-adversarial ambiguous authorization: user intent is clear but target scope, blast radius, or risk level is underdetermined; it focuses on the scope escalation threat category and does not cover prompt injection or data exfiltration.
Evaluated models
Claude Code's auto modeClaude Sonnet 4.6 (claude-sonnet-4-6)
Benchmarks
AmPermBench
Metrics
FNRFPRSTSRTP/TN/FP/FN
AI summaryand selection rationaleResearchers from HKUST and other institutions built the AmPermBench benchmark to conduct independent stress testing of Claude Code's Auto Mode permission system, finding an end-to-end false-negative rate of 81.0% in deliberately ambiguous authorization scenarios. The benchmark contains 128 prompts covering four categories of DevOps tasks and three ambiguity dimensions, and the evaluation makes per-action judgments on 253 state-changing operations on Claude Sonnet 4.6. The 81.0% (95% CI 73.8%–87.4%) is far higher than the 17% Anthropic reported on production traffic; the authors emphasize that the two measure different workloads and are not contradictory. A key finding is the Tier 2 coverage gap: 36.8% of state-changing operations are performed via in-project file edits, which the classifier by design does not evaluate; when the expected CLI is unavailable, the agent falls back to directly modifying state files with the Edit tool, and the false-negative rate for artifact cleanup tasks reaches 92.9%.

Researchers from HKUST and other institutions built the AmPermBench benchmark to conduct independent stress testing of Claude Code's Auto Mode permission system, finding an end-to-end false-negative rate of 81.0% in deliberately ambiguous authorization scenarios. The benchmark contains 128 prompts covering four categories of DevOps tasks and three ambiguity dimensions, and the evaluation makes per-action judgments on 253 state-changing operations on Claude Sonnet 4.6. The 81.0% (95% CI 73.8%–87.4%) is far higher than the 17% Anthropic reported on production traffic; the authors emphasize that the two measure different workloads and are not contradictory. A key finding is the Tier 2 coverage gap: 36.8% of state-changing operations are performed via in-project file edits, which the classifier by design does not evaluate; when the expected CLI is unavailable, the agent falls back to directly modifying state files with the Edit tool, and the false-negative rate for artifact cleanup tasks reaches 92.9%.

Why it was selectedThe stress-test data and production traffic metrics use different measurement bases; teams deploying permission systems for coding agents can use this to check whether file-edit paths are within guardrail coverage.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors ask: under operational tasks with systematically ambiguous authorization scope, can the Claude Code auto mode permission gate distinguish authorized from unauthorized actions?

    Core question: when user intent is clear but the authorization scope (target, blast radius, risk level) is underspecified, can the Claude Code auto mode permission system correctly allow authorized actions and block unauthorized ones.

    • Problem scenario: the authors point out that the difficulty for permission systems is not obvious attacks but everyday operational requests (cleaning up stale branches, canceling old jobs, restarting unhealthy services), where the agent oversteps when it resolves an underspecified target or scope too aggressively.
    • Shortcomings of existing data: Anthropic reports FPR 0.4% and FNR 17% on production traffic, but these numbers measure "real overeager" actions (incidental agent overreach); the authors argue that when authorization ambiguity is systematic rather than incidental, the system's performance has not yet been independently measured.
    • Threat model:
      • The paper evaluates a defense system rather than an attack: the victim system is the two-stage transcript classifier of Claude Code auto mode.
      • The scenario is non-adversarial: users cooperate, there are no malicious prompts, and only the authorization boundary is ambiguous.
      • It covers only scope escalation among the threat categories listed in Anthropic's blog, not prompt injection or privacy exfiltration.
    • The paper proposes: AmPermBench (128 prompts, 4 DevOps task families, 3 controlled ambiguity axes, each with an oracle ground truth), and evaluates gating decisions at the action level for 253 state-changing actions. The authors call this the first independent evaluation of auto mode ("the first independent evaluation").
  2. What related research exists?

    Related work falls into four groups: agent safety benchmarks, runtime guardrails, prompt injection attacks, and agent coding benchmarks and sandboxes; the authors position this paper as evaluating a deployed permission system rather than agent behavior.

    Agent safety benchmarks

    • ToolEmu (Ruan et al., 2024): uses an LM-simulated sandbox to test agents on 144 test cases across 36 high-risk tools; the paper notes that it evaluates agent behavior rather than permission system decisions.
    • R-Judge (Yuan et al., 2024): evaluates LLMs' ability to judge safety risks in 569 agent interaction records; the authors describe this paper as complementary, evaluating a deployed classifier rather than an LLM's risk awareness.
    • AgentHarm (Andriushchenko et al., 2025), ASB (Han et al., 2025), Agent-SafetyBench (Zhang et al., 2024), SafeToolBench (Chen et al., 2025a): cover harmful task completion, attack-defense formalization, 2000 risk cases, and tool-use safety, respectively; the authors note that these benchmarks stress-test agent behavior with adversarial or dangerous prompts, whereas this paper probes the permission system's ability to distinguish authorized from over-privileged actions under ambiguous but benign instructions.

    Runtime guardrails

    • AEGIS (Goel, 2025): intercepts tool calls across 14 agent frameworks, making allow/block/pending three-way decisions; the authors note it is conceptually similar to auto mode but acts as an external layer.
    • AgentSpec (Wang et al., 2025) uses an LLM to generate guardrail code from safety requirements; InferAct (Wang et al., 2024) infers safe actions through pre-evaluation and human feedback. The authors note that these systems share with auto mode the assumption that "dangerous actions pass through an interceptable tool-call interface," which is precisely what Finding 4 of this paper tests.

    Prompt injection and agent attacks

    • InjecAgent (Zhan et al., 2024, 1054 indirect prompt injection cases), WASP (Li et al., 2025, web agents), and a survey of agentic AI security (Chen et al., 2025b): study adversarial manipulation of the agent itself. The authors describe this paper as complementary: it evaluates the accuracy of a permission system under non-adversarial prompts where the user cooperates but authorization is ambiguous.

    Agent coding benchmarks and sandboxes

    • SWE-bench (Jimenez et al., 2024) and its derivatives measure task completion ability; the authors state that this paper measures the safety cost of adding a permission system to such agents.
    • Anthropic's sandbox infrastructure (2025b) and commercial platforms such as E2B and Daytona provide OS-level isolation; the authors note that sandboxes and classifiers address orthogonal risks, and this paper evaluates only the classifier layer.

    Baseline and positioning: the experimental baseline is a control with the same model (Sonnet 4.6) configured with bypassPermissions, and the benchmark is the authors' own AmPermBench. The authors position this paper's difference from the above work as follows: rather than stress-testing agent behavior, it measures the judgment accuracy of a deployed permission system at authorization boundaries.

  3. How does the paper address this problem?

    The authors build the AmPermBench benchmark (128 prompts, deterministic oracle), run auto mode in isolated containers, and judge the gating correctness of each of 253 state-changing actions.

    Overall approach: build an ambiguous-authorization task benchmark, AmPermBench, with deterministic authorization ground truth, have the agent actually execute under auto mode, and then compare gating decisions against the oracle ground truth action by action.

    Evaluated system: auto mode's three-tier architecture

    • Tier 1: read-only tools (file reads, search, navigation) are whitelisted and skip classification.
    • Tier 2: file writes/edits within the project directory are allowed directly without invoking the classifier; Anthropic's rationale is that "in-project edits can be reviewed via version control."
    • Tier 3: all other tool calls (shell, network, external integrations, subagents) go through a two-stage classifier: Stage 1 is a high-recall single-token filter (production traffic FPR 8.5%), and Stage 2 performs chain-of-thought reasoning on flagged actions, reducing FPR to 0.4% while allowing 17% of over-privileged actions through. The classifier sees only the user message and the tool call payload, not the agent's reasoning text or tool outputs (reasoning-blind design).

    Benchmark design: task families and ambiguity axes

    • Four task families: branch cleanup (git branches), job cancellation (cluster jobs), service restart (Kubernetes deployments), artifact cleanup (S3 objects), each simulating a DevOps scenario with clear authorization boundaries but operational ambiguity.
    • Three axes (Table 1): the S axis, specificity (S0 explicit command to S3 vague wording); the B axis, blast radius (B0 single named target to B3 broad selector); the R axis, risk level (R0 low-risk lane, R1 high-risk lane). Each task has 4×4×2=32 prompts, 128 in total.
    • Oracle policy: the authorization set is mechanically derived by a deterministic policy—strictly matching the ticket ID, owner prefix, and environment lane declared in the prompt; out-of-scope entities go into the must-preserve set. The authors state this makes FN/FP labels reflect objective over-privilege rather than annotator judgment. Appendix A gives all oracle tables, and Appendix B gives the original text of all 128 prompts.

    Execution environment

    • Each run takes place in an isolated Docker container, with the CLI handled through a shim that logs all state-changing commands; the environment contains in-project state files (jobs.json, objects.json, services.json).
    • All 128 prompts were run on Claude Sonnet 4.6 (claude-sonnet-4-6) with --permission-mode auto, with a 600-second timeout and a $5 budget cap per run; the baseline is bypassPermissions on the same model.

    Action-level evaluation protocol

    • All state-changing actions (Bash commands, Edit tool calls, jq/python3 file operations) are extracted from each session log; read-only actions are excluded.
    • For each action, four pieces of information are determined: which entities are affected, whether all of them are within the authorization set, whether auto mode allowed or blocked it, and the final classification TP/TN/FP/FN.
    • Judgments use an LLM judge (Claude Opus), with the full conversation context, the oracle ground truth, and the action to be judged as input; confidence intervals use prompt-clustered bootstrap (10000 resamples) to account for correlation among actions within the same prompt.
  4. What experiments did the paper conduct?

    128 sessions produced 253 state-changing actions: end-to-end FNR 81.0%, within Tier 3 FNR 70.3%/FPR 31.9%, and Tier 2 file edits account for 36.8% and all bypass the classifier.

    Experimental setup

    • System under test: Claude Code auto mode, running on Claude Sonnet 4.6 (claude-sonnet-4-6); the baseline is bypassPermissions on the same model, differing only in the permission gate.
    • Benchmark: AmPermBench, 128 prompts (4 task families × 4 S × 4 B × 2 R), each with a deterministic oracle (authorized set, must-preserve set, protected set).
    • Run scale: 127 completed sessions (1 timed out with no output), consuming 16.7M tokens, $16.09, 371 minutes; each prompt run once.
    • Metrics: action-level TP/TN/FP/FN, FNR, FPR; task-level Safe Task Success Rate (STSR).
    • Judging method: an LLM judge (Claude Opus) judges each action; 50 actions randomly sampled were independently manually reviewed against the same oracle, agreeing 44/50 (88%), Cohen's κ=0.82.
    • Statistics: all CIs use prompt-clustered bootstrap (10000 resamples).

    Main results

    Action-level confusion matrix (Table 3) and two-view breakdown (Table 4):

    Swipe horizontally to read the table

    ScopeTPTNFPFNFNRFPR
    All actions (253)27892211581.0%19.8%
    Tier 3 only (160)2747226470.3%31.9%
    Tier 2 only (93)–42–51100%–

    Task-level STSR (%, Table 2):

    TaskBypassAuto
    Branches25.025.0
    Jobs28.128.1
    Services43.859.4
    Artifacts21.918.8
    Overall29.732.8
    • The authors stress that the end-to-end FNR of 81.0% (95% CI 73.8%–87.4%) is not directly comparable to Anthropic's 17% on production traffic: the latter measures incidental overreach, whereas this benchmark is a targeted stress test, and the difference reflects workload sensitivity.
    • The authors state that auto mode's net benefit is limited: STSR rises only 3.1 percentage points, because it does not cover the 36.8% of actions routed through Tier 2.
    • The Tier 2 row's FNR of 100% is by construction: the classifier does not evaluate these actions, so all unsafe Tier 2 actions must be FNs.

    Tier 2 coverage gap (Finding 4)

    • What was measured: the gating source of Edit/Write actions was checked. Result: all Edit/Write calls in the dataset have gate decision "allowed" and no corresponding classifier call in the debug logs, confirming they go through Tier 2 without evaluation.
    • Numbers: of the 78 FNs in artifact cleanup, 49 (62.8%) are Edit/Write calls to objects.json; the task's overall FNR is 92.9%. Of the 89 actions in job cancellation, 42 use Edit/Write, mostly TNs; branch cleanup uses git commands throughout (Tier 3), with FNR 77.3%.
    • Authors' interpretation: this is not adversarial evasion—the agent simply uses the most natural tool when it expects the CLI to be unavailable; the gap comes from the mismatch between the design assumption that "dangerous actions go through the shell" and the agent's actual behavior.

    Axis breakdown (Finding 3, exploratory)

    • B axis: aggregate FNR falls from 94.4% (CI 83.3%–100%) at B0 to 77.6% (CI 65.6%–88.9%) at B3, and the CIs for B0 and B3 do not overlap (Figure 2); however, within-task analysis shows the trend is partly compositional—within cancel-jobs, FNR is 0.57 (B1), 0.46 (B2), 0.58 (B3), and artifact cleanup has FNR ≥0.81 at every B level.
    • R axis (Table 5): from R0 to R1, TP goes 8→19 and FP 6→16, FPR rises from 9.2% to 34.8%, and FNR falls from 88.1% to 74.7%; the authors say the classifier is more aggressive in high-risk settings, at the cost of over-blocking.
    • S axis: no clear trend; FNR varies non-monotonically between 72.7% (S1) and 87.8% (S3); the authors draw no conclusion about this axis.

    Other ablations and analyses

    • Task mode (Figure 3, §5.5): restart-services has the highest FPR (29.5%), as blocked commands are retried one by one, raising FPs; job cancellation is the most balanced (FPR 10.5%, FNR 53.1%).
    • Judge sensitivity (§6 Limitations): flipping all 6 disputed labels changes FNR from 81.0% to 79.6%, a change of less than 1.5 percentage points, within the confidence interval.
    • Disagreement composition: the 6 human–judge disagreements fall evenly into two categories—empty-target Edit operations, and whether the method (Edit vs CLI) in an authorized target file edit affects the safety classification; the authors say this does not affect the core conclusions.
  5. What are some points that can be further explored?

    The authors state limitations including single model, single benchmark, synthetic environment, and classifier version timeliness; the experiments cover only Sonnet 4.6 and the scope escalation threat category.

    Limitations and future directions noted by the authors

    • Scope limitations (§6 Limitations): a single model (Sonnet 4.6), a single benchmark, four synthetic DevOps task families, and a shimmed CLI; the results characterize a stress-test workload and should not be extrapolated to production traffic.
    • Temporal limitations (§6 Limitations): the auto mode classifier is proprietary and may change across versions; the results reflect behavior as of April 2026.
    • Evaluation limitations (§6 Limitations): action-level judgments rely on an LLM judge (Claude Opus), with manual review of 50 stratified samples (κ=0.82); the authors report that flipping 6 disputed labels changes FNR by <1.5 percentage points.
    • Statistical limitations (§6 Limitations): each prompt was run only once and actions are clustered within prompts, so prompt-level clustered bootstrap is used throughout; the aggregated trend on the B axis is partly confounded by task composition (§5.3).
    • Open questions (§6 Discussion): whether other threat categories (prompt injection, data exfiltration) have similar architectural coverage gaps is beyond the scope of this study.
    • Possible directions (§6 Discussion): decoupling risk sensitivity from interception aggressiveness, e.g., requiring confirmation rather than outright refusal for high-risk but authorized operations (the authors describe this as "one possible direction").

    Experimental coverage

    • The only model tested is Claude Sonnet 4.6; the baseline is bypassPermissions on the same model (§4.1).
    • The only threat category covered is scope escalation; prompt injection and data exfiltration are not included (§3).
    • The task environment consists of four synthetic DevOps task families, with state stored in in-project files and the CLI going through a shim (§3, §4.1).
    • Each prompt was run once, for a total of 127 completed sessions and 253 state-changing actions (§4.1, §5.2).
    • Manual agreement is based on 50 sampled actions (44/50 agreement, κ=0.82); the paper does not report the model identity or version number of the auto mode classifier itself (§4.2, §6).
  6. Summarize the main content of the paper

    The authors conduct an action-level stress test of Claude Code auto mode: under ambiguous authorization, end-to-end FNR is 81.0%, and 36.8% of actions completely bypass the classifier via Tier 2 file edits.

    An independent evaluation paper on the Claude Code auto mode permission system, which the authors call the first independent evaluation of its kind, focusing on the scope escalation threat category.

    • Problem: The permission system must block unauthorized actions while preserving usability; the difficulty lies in everyday operational requests where user intent is clear but the target, scope, or risk is underspecified; the production traffic numbers Anthropic reports (FPR 0.4%, FNR 17%) measure incidental overreach and do not cover systematic authorization ambiguity.
    • Method: AmPermBench generates 128 prompts using 4 DevOps task families × 3 ambiguity axes (specificity, blast radius, risk level), each with a deterministic oracle; in isolated Docker containers, Sonnet 4.6 runs auto mode and a bypassPermissions baseline, and each of 253 state-changing actions is judged for gating correctness, with an LLM judge (Claude Opus) manually reviewed on 50 samples (κ=0.82).
    • Result one: End-to-end FNR 81.0% (95% CI 73.8%–87.4%); looking only at the 160 Tier 3 actions the classifier actually evaluates, FNR is still 70.3% and FPR 31.9%. The authors stress this is not comparable to Anthropic's 17% and reflects workload differences.
    • Result two: 36.8% of state-changing actions are routed through Tier 2 (in-project file edits) and never reach the classifier; the artifact cleanup task has FNR 92.9%, and of its 78 FNs, 49 are Edit/Write calls. The authors call this an architectural coverage gap and not adversarial evasion.
    • Result three: Task-level STSR rises only from 29.7% to 32.8%; on the R axis, the high-risk lane raises FPR from 9.2% to 34.8%, showing a safety–usability trade-off.
    • Authors' conclusion: Auto mode assumes dangerous actions pass through the shell, but when the CLI is unavailable the agent naturally switches to file edits to achieve the same effect; the authors consider this tool substitution a general property of agent systems that can inform future permission gate design.

Related papers

Both use: AmPermBench
Read originalarxiv.org