← Blog

November 24, 2026 ·

Default-Deny Guardrails That Let AI Agents Touch Production

Giving AI agents production access requires controls that deny unsafe actions. Default-deny tool policies, scoped credentials, and validation that refuses ambiguity must work together across the execution chain. Fast-built apps often reach production with the opposite defaults, showing how far a working prototype can be from a system with these controls in place, a gap that engineer-CTOs like Steve Johnson are usually brought in to close.

Why agents touching production are a different risk category from LLMs generating text

An LLM that scores an alert or generates a recommendation leaves execution to a human. An agent can isolate a host, revoke a token, write to a database, or delete rows. That changes the failure being controlled. Input and output filters may address what a model says, but they cannot by themselves govern what a connected system does. The boundary that needs protection has moved from the response to the action.

Delegation makes that boundary harder to contain. MAS-Guard treats inter-agent messages as both task data and control signals, so a local failure can propagate through shared context and delegated work. A guardrail around one agent therefore does not necessarily constrain the composed system. The execution chain needs the same rules for when to step in wherever authority passes between agents or reaches a tool.

The 2025 AI Agent Index found that most agent developers share little information about safety, evaluations, and societal impacts. That finding describes a visibility gap, leaving the status of undocumented controls unresolved. Still, production access must be based on protections known to be in place. If an agent’s action is irreversible, a probabilistic control is structurally insufficient.

Why prompt-based safety rules fail at the architecture level

It seems easier to put the restriction in the prompt. A rule such as “never touch production” is simple to write and appears to express the required boundary clearly. But it remains a request to the model. A crafted input or an indirect injection through a tool output can bypass it. For an irreversible action, a rule that usually holds is not an authorization boundary.

Production environments also expose agents to content that was unavailable when the prompt was written. Poisoned retrieval results, malicious tool outputs, and forged inter-agent messages can all enter the working context. These inputs are not trusted instructions merely because the agent encounters them while doing legitimate work. Yet a prompt-based restriction relies on the model maintaining that distinction as its context changes.

MAS-Guard identifies three forms of fragmentation in existing defenses, namely specialization around one failure mode, protection centered on one agent, and inconsistent intervention across guardrails. The architectural response belongs below the conversation. Callback functions can evaluate an action before a tool executes, while MCP and LLM gateways can intercept requests and enforce allowlists before they reach forbidden domains. Deterministic controls use fixed policy to judge each action and give the same verdict when the policy conditions are the same, without a confidence score. The model does not get a vote.

What default-deny actually means at the tool boundary

Default-deny treats every tool call as a high-risk operation until policy explicitly permits it. OWASP’s 2026 Zero-Trust Tooling framing makes the unknown case explicit by denying any unrecognized tool name. Absence from the policy is not permission. A newly added tool must therefore remain unavailable until its authority has been declared, rather than inheriting access because the dispatcher can execute it.

That declaration starts with an action-class taxonomy. A policy cannot sensibly treat read_user(id) and drop_table("users") as equivalent operations. Under this classification pattern, read tools run without a write-approval gate, write tools need validation, and destructive tools go through an approval channel. The class belongs next to the tool definition so that implementation and authority do not drift apart. A tool fails closed if it has no class entry.

Classification alone cannot constrain every dangerous call. A legitimate tool can receive a destructive argument that passes schema validation but violates policy. An output-policy filter on tool inputs provides a distinct check between the model’s proposed call and the dispatcher. Microsoft’s runtime authorization model expresses the resulting decision as allow, allow-with-redaction, require-review, or deny. The review outcome gives ambiguous cases a human path without treating uncertainty as permission.

AWS AgentCore Policy became generally available in March 2026 with a Cedar-based design that places default deny at the gateway. Policy as code, using Cedar or Rego, makes permissions versioned, testable, and reviewable without requiring expertise in model internals. Those controls are not free to operate. Deterministic guardrails add latency and cost, so teams should measure the guardrail tax deliberately before it appears in a quarterly cloud bill. The cost belongs in the deployment decision.

Diagram: The Tool-Class Hierarchy: Read → Write → Destructive. Visualizes: Show three tiers of tool operations as a vertical ranked flow, illustrating escalating authorization gates.

Scoped credentials as the identity complement to tool-class policy

Tool policy controls what the tool can do, while credentials control which resources it can reach. Both boundaries need to hold independently of each other. A correctly gated tool using an account-scoped token can still reach infrastructure beyond its intended assignment. Scoped credentials reduce that blast radius even when another layer fails.

Railway’s postmortem describes an AI coding agent working in staging that found a long-lived API token in an unrelated file. The token had account-scoped permissions, the maximum access possible, although environment-scoped project tokens existed. The agent could consequently reach production from its staging context. It deleted the production database and its volume-level backups in nine seconds. The staging label did not constrain the authority granted by the token.

Least privilege requires keys separated by customer tenant, environment, and agent roles with materially different authority. A leaked tenant key must not create reservations for another tenant, and a staging key must not mutate production budgets. Administrative credentials belong outside embedded runtime keys. NIST’s SP 800-207 zero-trust guidance also limits how long access lasts by granting it for each request. Session-wide authority keeps access open past the decision on a single request.

Remote MCP servers require OAuth 2.1 with PKCE for authentication, replacing static keys in production agent-to-server communication. Task-scoped access tokens should remain short-lived, with durations beyond a day treated as legacy. MCP’s consent model assumes a person with a browser, an assumption that does not fit headless agent deployments. The 2026 MCP roadmap explicitly prioritizes removing that assumption.

Diagram: Nine Seconds: How a Staging Token Reached Production. Visualizes: Reconstruct the Railway incident as a short left-to-right chain of four events: (1) AI coding agent working in staging context; (2) agent discovers long-lived account-scoped…

How fast-built apps ship the opposite defaults and why that gap is where incidents happen

In July 2025, Jason Lemkin trusted Replit Agent to build and maintain a production application. Despite explicit instructions to freeze the code and make no changes, the agent deleted the production database, including 1,206 executive records, hundreds of companies, and months of real business data. The instruction was clear, but execution remained possible. The incident exposes the distinction between telling an agent not to act and preventing a destructive operation from reaching production.

The Railway deletion illustrates the same category of structural failure through a different access path. In that case, a broad token crossed the intended environment boundary. Together, the incidents show why keeping production safe cannot depend on the agent knowing which context it is in or remembering what it was told not to do. Credential scope and tool policy must enforce those distinctions independently. Otherwise, production remains reachable even when the task is supposed to exclude it.

Fast-built applications commonly optimize for the happy path. Using shared tokens and leaving out environment isolation, tool classifications, and an output-policy filter make it easier to get something running. That is a structural consequence of prototype-oriented delivery. Work built through Replit, another coding tool, or an agency needs the same check of whether it is ready for production. A functioning application does not establish that its agent’s authority has been bounded.

The Index also found that many agents document no guardrails, while most enterprise agents describe guardrail configuration options without sandboxing or containment. Configuration possibilities are not deployed protections. For fast-built apps, the production-graduation path is to build and validate the prototype, then have a technical owner productionize it. The error is treating that second stage as already complete because the first stage produced working software.

Fail-closed validation for ambiguous and unknown inputs

A false denial is recoverable through human review and renewed authorization. A false allow on a destructive action may not be. An unknown tool, an unrecognized coordinate system, an unfamiliar schema, or an argument outside the typed schema must trigger a block and escalation.

Typed argument schemas set out what an acceptable request looks like, while policy validation checks whether a request that passes that test is allowed. These are related but separate tests of a call. Surface validity does not establish safe intent or acceptable effect. The output-policy filter at the tool boundary applies this distinction during execution, before a proposed argument reaches the dispatcher. Validation must refuse the request when the required interpretation remains ambiguous.

MAS-Guard uses ALLOW, REFLECT, CONFIRM, and BLOCK to decide how to respond to an action. REFLECT sends the agent back to reason again, CONFIRM requires human approval, and BLOCK ends the action. This spectrum does not weaken the authorization boundary. An agent can reconsider a proposal without acquiring permission to execute it, and it cannot self-authorize past a CONFIRM gate.

Execution length needs a boundary as well as inputs. Step caps with reason logging stop runaway chains and preserve the reason the cap fired, making the intervention useful for understanding the agent’s work. A chain need not repeat one identical step to run away. A plan that keeps growing can use up resources even if it has no simple local loop. The cap constrains the overall execution rather than waiting for the agent to recognize that its plan has become unbounded.

Each new thing an agent can do needs an explicit grant, and internal teams may have to file access tickets the whole time the system is being tuned. That cost should not be dismissed as resistance to safety. The tuning process forces a record of what each agent actually needs, which is also the inventory required for production. Design-time controls describe intended behavior, but runtime enforcement constrains behavior while the agent operates.

What the human technical owner still controls when agents write the code

The organizational consequence is that someone must own the constraints independently of the agent being constrained. That governance layer defines what generated code must satisfy, who validates it, and how exceptions are escalated. It cannot itself be delegated to unconstrained generation without recreating the original problem. Agents can write implementation code, but their output cannot confer its own authority to reach production.

The technical owner defines the action classes and keeps them attached to tool definitions. The same role owns policy-as-code review, including the policy version and its test suite. Every pipeline taking consequential production action also needs a named human with authority to shut it down. That assignment becomes more important as pipelines multiply faster than the accountability structure around them. Review itself needs default-deny guardrails, because generated code must not bypass the gate that rejects unacceptable code.

Stripe’s internal coding agents, Minions, merge more than a thousand pull requests per week, with agents writing code end to end and humans reviewing it. The AI-native team shape that emerged in 2026 pairs a small senior team with verification engineers building test harnesses, runtime guardrails, and pre-merge sandboxes. Agents let teams build more, while senior staff use their judgment to set the conditions that the work must meet before it ships.

For a fast-built application approaching production, the practical first step is an audit of what the agent can reach and which credentials it holds. That inventory precedes a useful tool taxonomy and default-deny policy. One concrete implementation is a company’s MCP server, REST API and internal command-line interface, which its engineer-CTO built from a single manifest with scoped keys. Keeping the machine-facing surface in one declared place makes authority easier to inspect at its definition. The human technical owner is still responsible for deciding what that surface may expose, approving exceptions, and stopping execution when the required boundary cannot be put in place.