AI Agent Permissions Need Deterministic Enforcement
Tech
AI Agents
AI Security
Permissions
MCP

AI Agent Permissions Need Deterministic Enforcement

Design an AI agent permission system that limits the impact of model mistakes, reduces approval fatigue, and produces verifiable action receipts.

Uygar DuzgunUUygar Duzgun
Jul 26, 2026
11 min read

AI agent permissions should contain mistakes even when the model makes the wrong decision. The production design is straightforward: give each run a narrow capability set, enforce it outside the model, reserve human approval for consequential actions, and record enough evidence to verify what happened.

Audience: Advanced practitioners building tool-using agents, coding agents, or MCP servers.

That answer matters because a prompt such as “ask before deleting” is guidance, not an access-control boundary. A model can misread it, an injected instruction can compete with it, and a tool can behave differently from its description. Authorization has to survive all three failures.

What AI agent permissions must control

An agent permission system decides whether a specific caller may perform a specific action on a specific resource under current conditions. “The agent may use GitHub” is too broad. A useful decision includes at least:

Identity: Which user, service account, agent, or delegated subagent is acting?
Action: Is it reading, drafting, sending, deleting, publishing, spending, or changing access?
Resource: Which repository, mailbox, customer record, environment, or path is in scope?
Constraints: What amount, destination, branch, domain, time window, or row filter applies?
Run state: Was this action part of the approved plan, and has the approval expired?
Evidence: Which policy version, tool version, input digest, and result prove the decision?

The permission check belongs at the tool or service boundary. The model may propose an action and explain why. It should not decide whether its own proposal is authorized.

Separating those roles also keeps secret isolation honest. A credential broker can hide an API key from the model while still exposing every operation that key permits. The broker protects the secret; an action-scoped policy protects the resource.

What the newest permissions research measured

A July 2026 preprint, *How Agents Ask for Permission*, reviewed 21 agent permission systems and proposals published or released from 2024 to 2026. The authors also walked through five commercial agents in isolated setups during late May and early June.

Their taxonomy exposes a three-way engineering tension:

12 of 21 systems used deterministic enforcement.
11 of 21 had formally grounded permission specifications.
12 of 21 tried to reduce user interaction overhead.
None combined low interaction overhead, formal specification, and deterministic enforcement.
None of the reviewed implementations had formally verified enforcement.

Those counts describe the authors’ sample, not the whole market. The review used snowball sampling, included preprints and commercial products, and could not inspect closed-source internals. The paper is still useful because it separates the permission interface from the policy and the enforcement mechanism. A polished approval dialog cannot compensate for an ambiguous policy or an unenforced decision.

Commercial tools already reflect part of this split. Claude Code documents allow, ask, and deny rules, while its sandbox documentation describes OS-level filesystem and network boundaries. OpenAI’s Codex security guidance likewise treats the sandbox as a technical boundary and approval policy as the point where a user may be asked. These are product-specific controls, not evidence that every deployment configures them safely.

Approval fatigue is a routing problem

Approval prompts are useful when the user must make a real decision. They fail when every routine command looks equally urgent.

Repeated low-risk prompts train people to click through. Anthropic reported an 84% reduction in permission prompts from its internal sandbox rollout, but that is a vendor-reported operational result rather than an independent benchmark. The durable lesson is narrower: pre-approved work inside an enforced boundary can reduce interruptions without giving the agent global access.

Route actions into four outcomes:

OutcomeUse whenExample
---------
Allow automaticallyThe action is scoped, reversible, and containedRead files inside one repository
Allow with limitsThe action is routine but needs a hard boundRun tests with network disabled and a time limit
Ask a humanThe action is consequential or externally visibleSend email, publish content, merge, spend, or delete
DenyThe capability is outside the run’s purposeRead another customer’s data or change IAM roles

Risk should be calculated from the action and its blast radius, not from the model’s confidence. High confidence does not make an irreversible action safer.

A five-layer permission architecture

The smallest credible architecture has five distinct layers. Combining them makes audits harder and creates fail-open paths.

Five-stage AI agent permission architecture with allow, deny, human approval, and audit paths
Five-stage AI agent permission architecture with allow, deny, human approval, and audit paths

*The model proposes an action. Policy, enforcement, execution, and evidence remain separate.*

1. Normalize the proposed action

Convert a model-generated tool call into a typed request before authorization:

json
{
  "actor": "agent-run-7f3",
  "on_behalf_of": "user-42",
  "action": "blog.publish",
  "resource": "post:ai-agent-permissions",
  "constraints": {
    "environment": "production",
    "language": "en"
  }
}

This is an illustrative contract, not a standard. The important property is that authorization evaluates a stable object rather than free-form reasoning.

2. Evaluate policy outside the model

Return a deterministic decision: `allow`, `ask`, or `deny`. Include the policy rule and expiry. A model can help classify a novel request, but that classification should not grant access on its own. Unknown actions should fail closed.

3. Enforce the decision at execution

The tool handler or downstream service must verify the decision again. Do not rely on the agent to honor a denial. Bind the capability to the exact action, resource, caller, and short time window so it cannot be replayed against another target.

The MCP authorization specification applies the same principle to access tokens: servers must validate that a token was issued for the intended audience. MCP’s security guidance explicitly forbids token passthrough because it can break that boundary.

4. Execute through narrow tools

Prefer `publish_draft(post_id)` over `run_sql(query)` and `send_invoice(invoice_id)` over `http_request(url, body)`. Narrow tools make policy readable and shrink the space of unintended actions.

The same control-layer argument appears in MCP Developer Workflows: The Real Control Layer: tool shape, approval gates, and replayable actions determine what an agent can safely do.

5. Record a receipt and support revocation

Log the requested action, policy decision, approval identity, tool input digest, result class, and postcondition. Redact secrets and sensitive payloads. A user should be able to revoke a standing grant without rebuilding the agent.

The receipt must distinguish “tool returned” from “intended state exists.” An HTTP 200, a successful SDK call, or a confident final message is not a postcondition.

Treat memory writes as privileged actions

Persistent memory changes future behavior, so memory writes need their own permission and validation path.

The July 2026 MemGhost paper introduced WhisperBench, a 108-case benchmark for stealthy memory injection through email workflows. The authors report held-out end-to-end attack success of 87.5% against one OpenClaw configuration and 71.4% against one Claude Code SDK configuration. They also report transfer to other memory systems.

These figures do not establish a universal compromise rate. The experiments cover specific models, agent architectures, and an email-centered workflow; several evaluations use LLM judges, and the paper does not test weeks-long memory decay. The practical implication still holds: untrusted content should not become durable agent memory without provenance, schema validation, tenant isolation, and an explicit write policy.

A memory record should carry:

source identity and trust class;
the exact observation, separate from any inferred instruction;
tenant, user, and task scope;
creation time, expiry, and revocation state;
a reference to the run and policy decision that admitted it.

Permissions must survive tool failures

A permission design is incomplete if it assumes tool descriptions and responses stay stable.

ToolBench-X evaluates agents under specification drift, invocation errors, execution failures, output drift, and cross-source conflict. The paper reports that agents which perform well with clean tools degrade under these hazards, while targeted recovery hints help more than simply spending more test-time compute. It is a benchmark result, not a production incident rate.

AgentTether studies failed trajectories and guarded runtime intervention. On 261 tau-bench tasks, its authors report repairing 69.11% of initially failed Qwen runs, 26.02 percentage points above blind retry. Results vary by domain, auxiliary judgments rely on another model, and tau-bench cannot represent every production toolchain.

These papers support two controls:

Re-authorize after a material change in target, arguments, or tool contract.
Never let a retry inherit broader permissions than the failed attempt.

A retry is a new execution decision, not proof that the previous action was safe.

A reproducible permission test workflow

Run these tests before enabling autonomous writes:

Inventory every capability. Expand broad connectors into concrete reads, writes, deletes, sends, publishes, payments, and role changes.
Build a permission matrix. Map actor, action, resource, constraints, decision, approver, expiry, and postcondition.
Write policy tests. Cover allow, ask, deny, unknown action, expired grant, changed target, replay, and revoked access.
Inject hostile context. Put instructions in documents, issue text, tool output, retrieved pages, and memory candidates. Verify that content cannot change authorization.
Break the tools. Simulate timeouts, partial results, duplicate responses, stale schemas, and a success response without the expected state.
Read the system back. Verify the external postcondition through a separate path.
Replay the receipt. Confirm an auditor can reconstruct the decision without exposing credentials or private payloads.

Deterministic agent metrics are beginning to appear in open-source evaluation tooling. The DeepEval 4.1.3 release on July 12, 2026, added a deterministic `ToolPermissionMetric` and `AgentLoopDetectionMetric`. That release is an adoption signal, not evidence that the metrics cover every abuse case.

Independent verification also matters beyond security. This hybrid AI code review loop uses a separate reviewer and a real build as evidence. The broader systems lesson appears again in Code Agents After 21.54 Billion Tokens: model quality cannot replace verification and operational boundaries.

Production checklist

The model cannot grant itself a new capability.
Every capability is scoped to actor, action, resource, and time.
Unknown actions and invalid policy config fail closed.
Sandboxing limits filesystem, network, process, and credential exposure.
Consequential or externally visible actions require an independent approval.
Memory writes are validated, attributable, isolated, expiring, and revocable.
Retries do not broaden permission scope.
Tool success is followed by an external postcondition check.
Logs contain policy and result evidence without secrets.
Policy changes and tool releases run through regression and adversarial tests.

OWASP’s AI Agent Security Cheat Sheet reaches a similar operational conclusion: apply least privilege, separate decision-making from irreversible execution, validate external input, enforce loop limits, and keep structured action logs.

What this evidence does not prove

The papers cited here are recent preprints, not settled standards. Their samples, models, tools, and benchmarks constrain every numeric result. Commercial documentation describes available controls, not whether a particular deployment uses them correctly. GitHub releases and issue reports show active engineering pressure, not ecosystem-wide failure rates.

The architecture is therefore a decision framework, not a certification. Its value comes from making the security boundary inspectable: the model proposes; policy decides; infrastructure enforces; tools act; independent evidence verifies.

Claim checks

ClaimStatusEvidenceLimitation
------------
The permissions review found no implementation combining all three target propertiesVerifiedMichael and Roesner, arXiv:2607.1371821-item, snowball-sampled, fast-moving corpus
MCP servers must validate token audience and must not pass client tokens throughVerifiedMCP authorization specification, 2025-06-18Applies to protected HTTP transport authorization
MemGhost reported 87.5% and 71.4% held-out end-to-end success in two tested configurationsQualifiedYao et al., arXiv:2607.05189Specific models, agents, email workflow, and evaluation setup
AgentTether repaired 69.11% of initially failed runs in its primary 261-task evaluationQualifiedarXiv:2607.06273tau-bench only; auxiliary model judgments; domain variation
DeepEval 4.1.3 added deterministic loop and tool-permission metricsVerifiedDeepEval v4.1.3 release notesMetric availability does not establish complete coverage

Sources

Official specification: Model Context Protocol Authorization.
Official documentation: Claude Code permissions.
Official documentation: Claude Code sandboxing.
Official engineering report: Claude Code Sandboxing.
Open-source release: DeepEval 4.1.3.

Recommended for you

MCP Developer Workflows: The Real Control Layer

MCP Developer Workflows: The Real Control Layer

MCP developer workflows are the control layer for production agents: scoped tools, approval gates, source-backed context, and replayable actions.

8 min read
Hybrid AI Code Review: Claude Opus 4.8 + Codex in a Loop

Hybrid AI Code Review: Claude Opus 4.8 + Codex in a Loop

Two frontier models in a loop: Claude Opus 4.8 writes each fix, Codex reviews it through my AI bridge, and a real build votes. 39 production fixes, none by hand.

7 min read
Code Agents After 21.54 Billion Tokens: What’s Missing?

Code Agents After 21.54 Billion Tokens: What’s Missing?

I ran 21.54 billion activity tokens through real code-agent work. The models improved, but the system still matters more.

8 min read