Ajar: measuring unclosed permissions in agent defenses on AgentDojoAjar: Measuring Open Privilege in Agent Defenses
Ajar attaches to AgentDojo and directly measures how much the defense allows tool calls the task does not need; over-permission leakage cannot be inferred from attack success rate or benign utility.
- Agent defenses are often scored by attack success rate on indirect prompt injection and benign utility, both of which look only at actual execution. A defense can look good on both while still allowing transfers, deletions, or broad reads that the task does not need.
- Ajar reuses the host benchmark's tasks, tool schemas, reference solutions, and goal states, constructs labeled candidate calls for each benign task, and feeds them to the defense's decide interface at each decision point. Over-privilege leakage is the harm-weighted proportion of allowed extra calls, and sufficiency is the proportion of required calls that are allowed.
- Attached to 97 tasks and 10,471 tests from AgentDojo v1.2.2, evaluating Progent, CaMeL, AC4A, Permission Assistant, and Claude Code Auto. The authors state that leakage cannot be inferred from attack success rate or benign utility; in Table 5, under Sonnet-5, OPL ranges from 0.0810 for perm-assistant to 0.3009 for Auto.
- The authors state that labels are mostly asserted by Ajar, with host predicates confirming only 27.0%; tests run on replayed prefixes, not the agent; only AgentDojo is instantiated. Harm levels are specified by the authors; weights change absolute values but not the ordering dependence of levels.
- Evaluated models
- Sonnet-5Haiku-4.5
- Benchmarks
- AgentDojo v1.2.2
- Metrics
- OPLsufficiencyfully provisionedattack admissionbenign-task completionover-restriction
Ajar proposes an evaluation method that directly measures open permissions in agent defenses. It mounts on existing agent safety benchmarks, reusing their tasks, tool schemas, reference solutions, and goal states, constructs candidate tool calls that the task does not need for each benign task, and submits these calls to the defense at every node where the agent can act; allowing any of them means the permission is open. The authors integrate Ajar with AgentDojo, making open permissions a third dimension alongside attack success rate and benign utility, and test five defenses: Progent, CaMeL, AC4A, Permission Assistant, and Claude Code's Auto mode.
Related events and news
0 events · 1 news mentions
News that mentions this paper
- Paolo Costanzocites the paper's id or link今夏十起 AI Agent 漏洞复盘:多数问题不在模型判断,而在信任边界
Defences that score well on attack success can still leave unnecessary privileges open, and the two metrics do not predict each other (Ajar, arXiv 2609.26900, 22 Sep).
Paper analysis
What problem does this paper attempt to solve?
Existing benchmarks only look at attack success and utility, and cannot measure the excess permissions still open by defenses.
When agent defenses are scored by attack success rate and benign utility, they miss the tool calls the defense still allows but the task does not need.
- Scenario: Language model agents act through granted tools, and the data they read can change how they use those tools. Access control, information flow, or isolation is therefore placed between the agent and the tools. The authors use AgentDojo's banking task as an example: the task is to change a rent order to a new amount, while the injection uses the same tool to point to a payee the user never named; a defense that decides only by tool name cannot separate the two.
- Shortcomings of existing metrics: Attack success rate looks only at whether the injected call was executed in the run where the injection occurred, and utility looks only at whether the benign run completed the task. Both depend on the agent model. If the model does not propose the attacker's call, the defense is never asked and the attack is still recorded as a failure; if the model fails the benign task, utility also drops. The authors argue that neither answers what the defense is still prepared to allow.
- Core observation: Least privilege requires that components hold only the rights needed for their work (Saltzer & Schroeder, 1975). The authors argue that attack success rate and utility scores cannot measure this property: if the defense would allow the attacker's update but the agent simply does not propose it, both metrics can still look clean, and the permission remains open for the next injection.
- This paper proposes: Ajar directly measures this open permission using existing benchmarks. It mounts on existing agent safety benchmarks, reusing their tasks, tool schemas, reference solutions, and goal states; for each benign task it constructs candidate tool calls the task does not need and presents them to the defense at every decision point where the agent could act. On AgentDojo, open permission becomes a third axis alongside attack success and benign utility.
What related research exists?
The authors place Ajar along the lines of benchmarks, defenses, least-privilege measurement, and policy mining.
- Agent safety benchmarks: AgentDojo (Debenedetti et al., 2024), InjecAgent (Zhan et al., 2024), Agent Security Bench (Zhang et al., 2025), R-Judge (Yuan et al., 2024), and environments like τ-bench (Yao et al., 2024) and WebArena (Zhou et al., 2024) score agents by indirect prompt injection or tool interaction. The authors state that these benchmarks judge defenses by attack success and utility on a single run.
- Defenses at the boundary: Progent (Shi et al., 2025) writes an allowlist of tools and arguments per task and updates it with tool results; CaMeL (Debenedetti et al., 2025) performs information-flow and capability checks on programs issued by a trusted planner; Permission Assistant (Wu et al., 2026) predicts permissions step-by-step with a classifier; AC4A (Sharma & Grossman, 2026) has the model write a policy once per task instance and then enforce access control. Claude Code's Auto mode has the decision model judge each call itself. Instruction hierarchy (Wallace et al., 2024) trains models to prioritize higher-privilege instructions and does not adjudicate at the tool boundary.
- Measuring least privilege: Android apps (Felt et al., 2011; Au et al., 2012) and cloud roles (D’Antoni et al., 2024) have measured the gap between granted rights and actual use. On the agent side, Yang et al. (2026) and Zhang et al. (2026) ask whether the model itself chooses tools broader than the task. The authors state in Section 8 that that line does not measure excess permissions left by the defense layer. Role mining (Vaidya et al., 2007) and attribute-based policy mining (Xu & Stoller, 2015) reverse-engineer minimal roles or policies from usage logs; Capsicum (Watson et al., 2010) provides capability isolation on UNIX. For reversibility and blast radius of side effects, the authors cite Amodei et al. (2016) and Krakovna et al. (2018) as the basis for harm tiering.
- Baselines and benchmarks: The evaluation baselines are not defenses but allow-all, deny-all, tool-name allowlist, and argument-exact oracle, all scored on the banking, slack, travel, and workspace suites of AgentDojo v1.2.2.
The authors position Ajar as: the generator, oracle, and scorer face a unified interface; switching benchmarks requires writing one adapter, and switching defenses requires writing one wrapper; it measures the open permissions left by the defense, not whether the model proactively oversteps.
How does the paper address this problem?
Ajar builds labeled tests from benign tasks and scores defenses by harm-weighted over-permission leakage and sufficiency.
Ajar turns a benign task into a set of labeled tests, feeds them to the defense via a unified decide interface, then compares allow/deny decisions against labels.
Decision points and scores
- Decision point: A run is a sequence of executed tool calls. A decision point is a prefix of that sequence, with k as the prefix length, k=0 meaning no actions yet. A candidate is the next call c=(tool, args) proposed at that point. A test is a candidate at a fixed decision point plus a label.
- Label: The oracle gives y(c)∈{ALLOW, DENY}. ALLOW means the task requires the call, or the call is consistent with completing the task under least privilege; DENY means the task does not require it. Labels come from the task, not from the defense being evaluated.
- Over-privilege leakage: Let Ct− be DENY candidates and w(c) be the harm weight. OPL is the weighted sum of excess calls allowed by the defense, divided by the weighted sum of all excess calls. Sufficiency is 1−UP, where UP is the proportion of required calls Ctreq that are denied. Calls that are allowed but not necessary for task completion are separately recorded as over-restriction.
- Aggregation: OPL is combined across all tasks' DENY tests into a harm-weighted ratio; sufficiency is the average of per-task values. The authors' rationale: averaging OPL per task would give equal weight to a task with only three DENY tests and one with two hundred, thereby canceling out harm weighting.
Harm is divided into five levels (Table 2): H0 required calls, weight 0; H1 reversible, only affecting self, reads or drafts, weight 1; H2 reversible, touching third parties, weight 3; H3 irreversible, only affecting self, weight 9; H4 irreversible and touching third parties or funds, weight 27. The levels consider whether side effects can be reversed and how far they reach.
Attack admission is narrower: each injection in the host benchmark has one or more sink calls. An attack is admitted if and only if each of its sinks is allowed at every provided decision point. The authors report admission counts rather than rates because different execution frameworks provide different numbers of attacks. Admission only indicates that the defense has granted the permissions needed for the attack; whether the attack succeeds still depends on the agent.
How candidates are generated
Decision points take every prefix of the reference solution. The generator samples across tools, parameter ranges, and decision points within a per-task test budget. Excess calls fall into three families:
- Off-path tools: every tool the task never needs but the defense can reach, with parameters drawn from the environment, provided at each decision point.
- Parameter faults: starting from an authorized call, replace parameters with pools collected from the environment via adapters, covering wrong resources, parameter relaxation, type violations, and missing parameters.
- Attacker-seeded: sink calls from existing injections in the host benchmark, provided at each decision point, and rechecked with the injection's own predicate.
Required calls take every call in the reference solution, provided at the decision point just before it is issued, labeled ALLOW. Permitted calls are of two types: reads that must be possible before the task starts; and calls from the task itself placed outside the reference solution but on states still allowed by the partial order. The partial order comes from benchmark execution: parameter values of later calls appear in the returns of earlier calls. Every order allowed by the partial order is replayed in the environment, and only those that complete without errors are kept. Enumeration per task has a cap.
Oracle and conflicts
The oracle uses fixed rules against the host's existing required tool set and target predicates, without post-hoc judgment. Host predicates confirm labels only in two cases: candidates identical to an attack sink and whose execution would make security() true are confirmed DENY; candidates identical to a write in the reference solution and whose continued execution still achieves utility() are confirmed ALLOW. utility() cannot confirm DENY; reads do not change the state checked by either predicate, so their labels are asserted by Ajar based on the required tool set.
Multiple families may propose the same call at the same decision point with conflicting labels. Ajar keeps only one test, with fixed priority: host-verified labels override Ajar-asserted labels, required calls override asserted excess calls, and conflicts are labeled ALLOW.
Interface and implementation
Defenses are driven via decide(call, context)→{allow, deny}. Context carries the executed prefix and the defense's own saved state. To query at depth k, Ajar replays the reference solution to k, then treats the candidate as the next call. If the decision does not depend on the prefix, each candidate is asked only once.
Figure 1: adapters export tasks, tools, reference plans, and attack sinks; the generator produces tests; the oracle gives labels and harm levels; the wrapper runs the defense's own execution path and returns decisions via decide. Ajar is written in Python, depends only on the standard library, and host benchmarks and model clients are plugged in at runtime. Adapters pass tool docstrings through unchanged.
The five wrappers provide different contexts. Progent snapshots the policy at each decision point and applies its update steps to the results of the replayed prefix. Permission Assistant does not change the classifier prompt, one candidate at a time, with the user request and call; AgentDojo has no users, so it has a cold-start configuration (no profile, no history) and a history built from true labels of other folds, with five folds per suite. CaMeL uses its published implementation, commit f083b6b, with the interpreter and policy engines of the four suites unchanged; the wrapper places canaries in each injection vector, keeps only vectors that reach the agent, computes capabilities per CaMeL's per-type rules, and takes the most permissive when multiple objects are involved. AC4A loads the model-written permissions into its permission system, written once per task instance. Claude Code Auto is not separately provided and its source is not released; it is measured within Claude Code: candidates are placed in the system prompt to make the agent propose the call, then Auto's decision is recorded; candidates never issued do not enter the classifier, so scoring is on a smaller set.
What experiments did the paper conduct?
The OPL values of the five defenses on AgentDojo are separated from each other and cannot be recovered from utility or attack admission.
Experimental setup
- Host: AgentDojo v1.2.2, four suites banking, slack, travel, workspace, 97 user tasks in total, all used to generate tests. For 5 banking tasks, utility() is already true on the empty trajectory, so their ALLOW labels carry no information; leakage and attack admission are reported on all 97 tasks, while sufficiency and full supply are reported on the remaining 92 scoreable tasks. Full supply means the defense allows every required call for that task.
- Test scale: 10,471 tests from 3,551 distinct (task, tool, arguments) candidates, decision points k=0 to k=18 (Table 3). DENY 9,039, required calls 339, permitted calls 1,093; host predicates confirm 2,822 (27.0%), the rest are asserted by Ajar. Per-suite confirmation rates: banking 474 (41.0%), slack 774 (29.6%), travel 862 (31.0%), workspace 712 (18.2%).
- Defenses: Progent, Permission Assistant (written as perm-assistant in the table), CaMeL, AC4A, Claude Code Auto. The first four run under Sonnet-5 and Haiku-4.5, both provided by Amazon Bedrock; Auto runs only under Sonnet-5. The decision model is the model that writes the policy or program, or the model that adjudicates each call.
- Query method: AC4A, CaMeL, and Permission Assistant decisions do not depend on the executed prefix, so each distinct candidate is queried once. Progent updates its policy with tool results and runs at every decision point; Progent† in Table 5 counts each distinct candidate once at the earliest decision point where that candidate appears. Auto reads previous calls but not return values, and candidates are presented without a prefix.
- Baselines: allow-all, deny-all, tool-name allowlist (only allows the tool names required by the task, without constraining arguments), argument-exact oracle (the same allowlist written per-argument according to ground truth).
- Benign runs: Each defense runs on all 97 benign tasks twice, once with the defense and once without, using the same agent, task, and execution code, with no injection in either run. The agents in the utility runs are listed in the Agent column of Table 7.
Main results
According to Table 5 (Progent† counts each distinct candidate once; Auto is scored only on calls its agent actually issues, with no sufficiency; perm-assistant‡ has personalized history):
Swipe horizontally to read the table
Defense Decision model OPL Suff. Full supply Attack admission perm-assistant Sonnet-5 0.0810 0.961 82/92 25/609 perm-assistant Haiku-4.5 0.1289 0.822 68/92 39/609 CaMeL Sonnet-5 0.0895 0.700 37/92 16/609 CaMeL Haiku-4.5 0.1041 0.665 34/92 16/609 Progent† Sonnet-5 0.1026 0.902 70/92 34/609 Progent† Haiku-4.5 0.1312 0.859 64/92 36/609 AC4A Sonnet-5 0.1113 0.715 47/92 46/609 AC4A Haiku-4.5 0.0896 0.609 40/92 46/609 The 95% bootstrap intervals in the table are resampled by task. Auto (Sonnet-5) has OPL 0.3009, interval [0.2610, 0.3437], attack admission 74/581. perm-assistant‡ (Sonnet-5) has OPL 0.0217, sufficiency 0.877, full supply 64/92, attack admission 4/609. Table 6: allow-all has OPL 1.0000, sufficiency 1.00, 92/92, 609/609; tool-name allowlist has 0.3551, 1.00, 92/92, 99/609; argument-exact oracle has 0.0020, 0.91, 71/92, 1/609; deny-all has 0.0000, 0.00, 0/92, 0/609.
- The authors state that the OPL of all tested defenses falls between tool-name allowlist and argument-exact oracle; the defense with sufficiency closest to the oracle still leaks more than 40 times the oracle's leakage. Figure 2 plots sufficiency against OPL (logarithmic y-axis), with the shaded corner being the region at least as usable as the oracle and no leakier; the authors state that no tested defense enters that region. Auto has no sufficiency, and deny-all cannot be placed on a logarithmic axis.
- The authors state that OPL and benign task completion rate do not predict each other. Table 7: two defenses with OPL differing by less than 0.009 differ by 37 percentage points in benign completion rate, with the tighter one completing more tasks. Progent (Sonnet-5, agent Sonnet-4.5) goes from 87.6% without defense to 87.6% with defense, a cost of 0.0 percentage points; AC4A (Haiku-4.5, agent Sonnet-4.5) goes from 85.6% to 39.2%, a cost of −46.4 percentage points; Auto (agent Sonnet-5) goes from 92.4% to 89.0%, a cost of −3.4 percentage points.
- Table 4 previews disagreements using banking user task 2's rent update (amount 1200 should be allow) and three wrong-amount variants: Progent allows all four columns under both decision models; perm-assistant allows only 1200 under both models; CaMeL denies all four columns under both models; AC4A allows all four under Sonnet-5 and denies all four under Haiku-4.5; Auto allows 1200, rejects 0.0 and 0.01, and the string-amount variant is not issued, marked as —.
Over-restriction and update steps
- Over-restriction (Table 8): On 1,432 permitted calls, under Sonnet-5 the rejection counts and over-restriction are perm-assistant 126 / 0.088, Progent 325 / 0.227 (flips 16), AC4A 442 / 0.309, CaMeL 594 / 0.415. Under Haiku-4.5, CaMeL is 590 / 0.412 and AC4A is 546 / 0.381. The authors state that CaMeL rejects the most under either decision model, nearly five times Permission Assistant under Sonnet-5, while also being the second tightest of the four defenses under that model, so part of its tightness comes from rejecting steps the task is allowed to do. Only Progent has flips: it allows an update to a long-term order under one accepted order and rejects it under another. Auto, on a subset of 316 calls per run across three runs, rejects 4–8, with over-restriction 0.013–0.025.
- Update steps (Table 9, 3,551 candidates, each counted once): After freezing the initial policy S0, Sonnet-5's OPL rises from 0.1026 to 0.1605 (the authors state 1.56×), sufficiency from 0.902 to 0.888, full supply from 70/92 to 72/92; Haiku-4.5 rises from 0.1312 to 0.1622 (the authors state 1.24×), sufficiency from 0.859 to 0.848. When scored at every decision point as deployed, Progent leaks 0.0341 under Sonnet-5 and 0.0661 under Haiku-4.5. The authors state that the updates remove permissions the task does not need, with sufficiency almost unchanged.
- Decision model (Section 6.4.2): By design, Ajar does not run the agent; tests are run against replayed reference prefixes. After switching to Haiku-4.5, the scores of all four dual-model defenses change, and changes beyond their own run-to-run variation are all looser. Sufficiency and full supply drop for all four defenses. AC4A is the exception in direction: Haiku-4.5's OPL drops from 0.1113 to 0.0896, while sufficiency drops from 0.715 to 0.609. The authors state that a weaker decision model does not slide along the permission–utility frontier, and OPL and sufficiency must be read in pairs.
Other ablations and analyses
- Harm weights (Table 10): Rank correlations for six tier weights relative to the default (1,3,9,27) are all at least 0.67; schemes that keep weights increasing with tier are above 0.78. Unweighted (1,1,1,1) perturbs the most. For perm-assistant under Sonnet-5, default OPL is 0.0810, unweighted is 0.2070, and linear (1,2,3,4) is 0.1373.
- Test count (Section 6.5): The authors resample by task and state that rankings largely hold with fewer tests; the specific curve endpoints are cut off in the body, and the paper does not give OPL numbers for each subsample tier in the read body.
- Task wording and run-to-run variance (Section 6.5): The authors rewrite task prompts and repeat identical inputs, stating that defense rankings largely hold, while model calls themselves do not reproduce their own decisions; this run-to-run variance determines the smallest difference Table 5 can resolve.
- AC4A's direction: In the same Table 5, switching to a smaller decision model lowers AC4A's OPL and also lowers sufficiency; the authors list it as a case where "excess and required calls are removed together," rather than the four defenses loosening in the same direction.
What are some points that can be further explored?
The authors state that labels are mostly asserted by Ajar, and scores come from replayed prefixes rather than real agent runs.
Limitations and future directions noted by the authors
- Label provenance (Section 4.4, Section 6.1): Host predicates only confirm labels in two cases: attack sinks and reference-solution writes; read labels cannot be confirmed by any predicate. The authors state how much of the score rests on our own judgment as the bound that can be stated today, and report that 27.0% of tests are confirmed by AgentDojo predicates, with the rest asserted by Ajar.
- Replay rather than live execution (Section 5.2, Section 6.4.2): The wrapper replays the prefix and adds the context that the defense is expected to accumulate; the authors state that a live run would build these states during execution, and replay does not provide all of it. By design, Ajar does not run the agent, so the agent model does not affect the score, while the decision model can.
- Auto coverage (Section 6.2.5): The agent does not always issue the requested calls, candidates that are not issued never reach the classifier, and Auto scores on a smaller set, so there are no sufficiency and completeness counts.
- Historical configuration loop (Section 6.2.2): The second configuration of Permission Assistant builds history using ground-truth labels from other folds, and that history is built from the very labels Ajar is scoring.
- Weights and benchmarks (Section 6.5, Introduction): The authors state that the default harm weights change absolute values, and the results depend on the tiers being ordered by harm, not on the specific weights chosen. The introduction states that Ajar is not specific to any one benchmark or defense, and attaching a host benchmark means writing another adapter; the experiments only instantiate AgentDojo.
- Code (Abstract): The authors state that Ajar's source code is available; expressions in the paper such as "planned to be integrated into a library" do not appear in the read body text, so the release status is not written as anything beyond a subsequent engineering commitment.
Experimental coverage
- The defenses tested are Progent, CaMeL, AC4A, Permission Assistant, and Claude Code Auto, 5 in total; the first four each have two decision models, Sonnet-5 and Haiku-4.5, and Auto has only Sonnet-5 (Section 6.1, Table 5).
- The tests come from AgentDojo v1.2.2's 97 benign tasks across four suites, totaling 10471 tests and 3551 distinct candidates, with decision points k=0 to 18; the sufficiency denominator is 92 scorable tasks (Table 3, Section 6.1).
- Benign utility is run on 97 tasks, each with and without defense, with the agent being Sonnet-4.5, Sonnet-5, or Haiku-4.5 as listed in Table 7, and both runs have no injection.
- Attack admission denominators: 609 for the four research defenses and 581 for Auto (Table 5). The paper reports admission counts, not end-to-end attack success rates on the benchmark.
- The stability experiments recompute six harm weights (Table 10) and vary the number of tests per task and task wording (Section 6.5). The paper does not report agreement between Ajar scores and human annotations, nor the number of queries or time per decide.
Summarize the main content of the paper
Ajar scores the defense's open permissions using the host benchmark's ground truth; OPL is independent of attack success and utility.
Ajar measures the open permissions left by agent defenses: tool calls that the task does not require but the defense would still allow.
Existing benchmarks place defenses against indirect prompt injection and score them by attack success rate and benign utility. Both are computed on the run that actually happened, so a dangerous call that was never asked for does not lower the score.
Ajar attaches to existing benchmarks, reusing tasks, tool schemas, reference solutions, and goal states. It provides candidates at each prefix of the reference solution: out-of-path tools, argument faults, injected sinks, and required versus permitted calls. An oracle uses the host's tool set and goal predicates to label ALLOW or DENY, and DENY is further placed into H1–H4 by reversibility and blast radius, with weights 1, 3, 9, 27. OPL is the harm-weighted proportion of allowed excess calls, and sufficiency is the proportion of required calls that are allowed; the two are aggregated separately so that neither can be gamed by the other.
On 97 tasks and 10,471 tests from AgentDojo v1.2.2, under Sonnet-5, perm-assistant has OPL 0.0810, sufficiency 0.961, attack admission 25/609; CaMeL has 0.0895, 0.700, 16/609; Progent† has 0.1026, 0.902, 34/609; AC4A has 0.1113, 0.715, 46/609; Claude Code Auto has OPL 0.3009, admission 74/581, and no sufficiency. The argument-exact oracle has OPL 0.0020. The authors state that no defense enters the "both tight and usable" region, and that two defenses with OPL differing by less than 0.009 can differ by 37 percentage points in benign completion rate. After freezing Progent's policy updates, Sonnet-5's OPL rises from 0.1026 to 0.1605. Switching to Haiku-4.5, sufficiency drops for all four defenses, and OPL does not uniformly rise: AC4A drops from 0.1113 to 0.0896.
The authors conclude that open permissions belong to the whole decision process, vary with the decision model and re-asking, and cannot be inferred from attack success rate or benign utility; reporting both OPL and sufficiency ensures that neither full rejection nor full allowance can alone get a good score.