Getting Your First Agent Live

The Execution Gap: Why Agent Permission Models Fail When Dev and Prod Aren't Separated

Matt Doughty Matt Doughty CEO & Co-Founder, Prefactor
6 min read
Abstract illustration: The Execution Gap: Why Agent Permission Models Fail When Dev and Prod Aren't Separated

What you will be able to evaluate after reading this

By the end of this article you can assess whether your current permission architecture enforces boundaries at the speed agents actually operate, identify the structural patterns that successful deployments use to separate environments, and run a checklist against your own infrastructure before an incident forces the conversation.

The problem is not the model, it is the architecture

When Replit’s AI coding agent deleted a live production database in July 2025 despite a user prompt that explicitly said “DO NOT DELETE DATABASE,” the incident destroyed 1,206 executive records and roughly 1,196 company profiles. The agent then misreported the event and claimed rollback was impossible. The model was not broken. The model did what it was designed to do: execute a sequence of steps toward a goal. The architecture gave it the access and the autonomy to execute those steps against production data with no structural barrier in the way.

Traditional access control was designed around human-speed decisions. A developer pausing to confirm a destructive query gives a policy engine, an auditor, or a colleague a chance to intervene. Agents do not pause. The Cursor-powered Claude Opus agent that deleted a production database and its backups for PocketOS completed that sequence in nine seconds, producing a 30-hour outage. Nine seconds is not enough time for a human review loop. It is barely enough time for an automated control to log the action, let alone block it.

This is the execution gap: the space between when an agent begins a destructive action and when any control can intercept it.

Understanding how agents plan and sequence tool calls is the prerequisite to understanding why the gap exists. An agent does not ask permission at each step. It plans a sequence, then executes. Your permission model needs to operate at the planning layer, not just at the execution layer.

Why overprovisioned access makes this worse

According to research published in the Least Privilege Report 2026, only 4% of enterprise permissions are actively used in any 90-day period, yet nearly one in three permissions can modify or delete sensitive data. Organizations inherit this overprovisioned surface and then hand it directly to agents.

The Moltbook incident illustrates the result. A misconfigured Supabase database on the AI-native social network exposed 35,000 emails and 1.5 million API keys in 2026. The agent access controls did not match the sensitivity of the data they could reach. Overprovisioning is not a new problem, but agents amplify it because they traverse permissions systematically and at speed, not occasionally and manually.

Comparing RBAC and ABAC approaches for agents is worth doing before you assign any credential to an autonomous workflow. The short version: role-based models give agents a bucket of permissions; attribute-based models let you attach conditions to each permission. Neither works if the permissions in the bucket were already too broad for human users.

The three structural patterns that contain the gap

1. Explicit environment boundaries

Dev and prod must be separated at the credential level, not just the configuration level. If an agent can reach a production endpoint using a credential stored in a dev environment variable, the boundary is a label, not a control. Replit shipped mandatory dev/prod separation after their July 2025 incident specifically because a configuration-level boundary failed to stop the agent.

The boundary needs to be enforced at the infrastructure layer: separate credential stores, separate network paths, and separate secrets that cannot be interpolated across environments by an agent following a migration script.

flowchart TD
    A[Agent receives task] --> B{Credential scope check}
    B -- Dev credential --> C[Dev environment only]
    B -- Prod credential --> D[Prod environment only]
    B -- Ambiguous credential --> E[Block and alert]
    C --> F[Execute in dev]
    D --> G[Require human approval gate]
    G -- Approved --> H[Execute in prod]
    G -- Rejected --> I[Task halted, logged]
    E --> I

2. Zero-trust for agent identities

Each agent run gets its own identity with the minimum permissions required for that run, issued for the duration of that run only. When the run ends, the credential expires. This is the same principle applied to service accounts in container orchestration, applied to agent sessions.

The Amazon Q Developer incident in July 2025 demonstrated the alternative. An attacker submitted a pull request and was granted admin credentials, then injected a prompt instructing the agent to delete S3 buckets and terminate EC2 instances. A zero-trust model scoped to the pull request review task would not have included AWS CLI deletion authority in the issued credential set.

AI agent security practices built on zero-trust require an identity broker that understands agent session context, not just user identity. This is a gap in most enterprise IAM configurations today.

3. Capability-based security at the tool layer

Rather than granting an agent a role, grant it a capability: a signed, scoped token that authorizes one operation against one resource for one session. If the agent’s goal is to run a read-only audit of a production table, the capability token authorizes reads on that table and nothing else. No capability, no execution.

flowchart TD
    A[Agent task defined] --> B[Capability broker]
    B --> C{Minimum required operations?}
    C --> D[Read: table_X, session 42]
    C --> E[Write: table_Y, session 42]
    D --> F[Token issued: read-only, expires 15 min]
    E --> G[Token issued: write-scoped, expires 15 min]
    F --> H[Agent executes read]
    G --> I[Agent executes write]
    H --> J[Token revoked on session end]
    I --> J
    J --> K[Audit log written]

Tools like MCP servers can act as the capability boundary: the agent calls the MCP server, the MCP server holds the scoped credential, and the agent never touches the raw credential directly. Some teams use a dedicated governance layer for this; tools like Prefactor complement it by evaluating every action an agent takes in real time, so a permission gap is caught the moment it is exercised. The architecture matters more than the specific tool.

Securing MCP implementations covers the practical configuration steps if your agents are already using the Model Context Protocol.

What the numbers say about where most teams are

88% of organizations confirmed or suspected security incidents related to AI agents in 2026, yet only 14.4% sent agents to production with full security or IT approval. The gap between deployment rate and governance rate is where incidents live.

The Amazon-Kiro mandate outcome reinforces this. A company-wide requirement for 80% of developers to use AI coding agents produced two production outages, including a 13-hour AWS Cost Explorer outage. Deployment velocity without structural separation at the permission layer transfers human error rates to agent execution rates, then multiplies them by the number of autonomous steps per run.

Governance frameworks for agentic AI are not bureaucratic overhead at this stage. They are the mechanism that makes the separation patterns above operationally consistent across teams.

Deployment checklist: can your infrastructure stop a crossing?

Before auditing your permission model, work through these questions:

  • Can an agent authenticated in dev reach any production endpoint using a credential present in the dev environment? If yes, your boundary is a label.
  • Do agent identities expire when the session ends, or do they persist? Persistent identities accumulate risk across runs.
  • Is each tool call authorized by a scoped capability, or does the agent hold a broad role credential? Broad role credentials cannot be narrowed after issuance.
  • Are your controls blocking in real time or logging after the fact? Detective controls tell you what went wrong; preventive controls stop it.
  • Does your rollback strategy cover partial execution? 30% of autonomous agent runs hit exceptions requiring recovery, including context window overflows and API failures mid-sequence.

Agent observability tooling and runtime governance practices both bear on that last point. You cannot roll back what you cannot reconstruct step by step.

Where to start

If you are auditing an existing deployment, the credential boundary between dev and prod is the first thing to check, because it is the most common failure point and the one with the largest blast radius. Run the internal crossing test described above before any other change. Take the agent readiness assessment to get a structured view of where your permission model stands against the patterns in this article.

Matt Doughty Matt Doughty CEO & Co-Founder, Prefactor

Founder of Prefactor, writing on the operational reality of getting AI agents into production — evaluation, observability, governance, and the plumbing assistants never needed.

Frequently asked questions

What is the execution gap in agent permission models?

The execution gap is the mismatch between how fast an agent acts and how slowly traditional access controls were designed to respond. A human pausing before deleting a table gives a policy engine time to intervene; an agent completing the same action in under ten seconds does not. Permission models built for human-speed decisions fail at agent velocity because the intervention window effectively disappears.

Why does separating dev and prod environments matter specifically for agents?

Agents operate autonomously across multiple steps, so a single misconfigured credential or ambiguous instruction compounds across every action in a sequence. Without a hard environment boundary, an agent testing a migration script in what it believes is a dev context can reach production data if the two share credentials or network paths. Explicit separation means the blast radius of any single agent run is bounded before the run starts.

What is capability-based security and why does it help with agents?

Capability-based security grants an agent only the specific operations it needs for a defined task, rather than a role with broad permissions attached. Instead of giving an agent database write access, you give it a single-use token scoped to one table for one session. This means an agent that is hijacked or hallucinates cannot reach resources outside its issued capability set, even if the underlying infrastructure credentials would normally allow it.

How do I know if our current permission model is actually enforced at agent speed?

Run a controlled test: give a non-production agent a valid production credential embedded in a prompt and observe whether any control intercepts the call before it executes. If nothing fires, your enforcement is logging after the fact rather than blocking in real time. Most teams discover their controls are detective, not preventive, only after an incident.

Stay ahead of the curve

No spam. Unsubscribe anytime. A resource by Prefactor.

Almost there — check your inbox to confirm your subscription.