BlogSecurity

Fail closed: security principles for autonomous agents

When a control cannot answer, the action must not run. The security principles that keep autonomous AI agents safe when models, tools or controls fail.

Two heavy slabs of black stone almost closed, with a thin vertical seam of crimson light between them.

Every control eventually fails to answer. A network partition, a database lock, a policy that does not parse, an approval that nobody sees, a dependency that times out. The question that defines a security architecture is not whether this happens, but what the system does when it does.

There are two choices. A control that fails open lets the action through when it cannot decide. A control that fails closed stops it. For autonomous agents that move money, change records and send messages, the default has to be the second. A control that lets everything through when it breaks is not a control. It is a control most of the time, which is a different and much less useful thing.

This post sets out the security principles we think autonomous agents need, starting from that one. It builds on Designing a control plane for AI agents, which describes the policy check, and leads into Evidence you can verify, which describes the record.

Why agents change the calculation

Fail-open is common in software, and often for good reasons. A recommendation engine that is down should not stop a shop from selling. A spam filter that times out should probably deliver the mail. When the cost of a wrong "yes" is small and the cost of a wrong "no" is lost business, failing open is a sensible trade.

Agents shift that trade for three reasons.

The cost of a wrong yes is large and often permanent. An unchecked refund is a loss. An unchecked data export cannot be recalled. An unchecked email to every customer cannot be unsent. A stopped action, by contrast, is a delay: a support ticket, a retry, a person asked to look.

An agent will keep going. A person who finds a system unresponsive stops and asks. An agent in a loop retries, rephrases or tries another tool. If the control fails open, the agent does not notice anything is wrong, and it does not stop.

Failures can be induced. If a control fails open under load or on malformed input, an attacker who can influence the agent's input can try to cause exactly that condition. Prompt injection that makes an agent send an oversized or malformed request is not hypothetical. Fail-open turns "make the check error" into "skip the check".

FIGURE 1Fail open or fail closedThe check cannot answertimeout, error, unknownFail openThe action runs uncheckedNobody knows it was uncheckedA broken control looks likea working oneLoss is found later, if at allFail closedThe action does not runThe refusal is recordedwith its reasonThe agent can retry or escalateLoss is a delay, not a payoutSome actions are cheaper to allow than to block. Then fail-open is a per-action choice, and the record says so.
Figure 1. When the check cannot answer, the difference between the two choices is the difference between a delay and a loss.

Principle 1: an unclear answer is a block

The first principle is simple to state and takes discipline to implement. Whenever the control plane cannot reach a clear "allow", the action does not run. That includes every failure the system can name:

FIGURE 2Every unclear answer is a blockWHEN THIS HAPPENSTHE OUTCOMEUnknown or paused agentblockNo active policyblockPolicy fails to evaluateblockLimit lookup failsblockApproval expiresblockControl plane unreachable or slowblockEvidence cannot be writtenblockGuard opted in to fail-openallow, and recorded
Figure 2. Every unclear answer is a block. The one exception is chosen per action and written into the record.
  • An unknown, paused or stopped agent is blocked.
  • A tenant with no active policy blocks everything. There is no "allow all" fallback.
  • A policy that fails to evaluate, for instance because the request is missing an argument the policy reads, blocks.
  • A tool no policy mentions is blocked.
  • A failed lookup of the agent's limits blocks.
  • An approval that expires is a refusal.
  • In the SDK, a timeout, a network error or a malformed response is a block.
  • If the decision's evidence record cannot be written, the decision is refused.

The last item surprises people. Why should an evidence failure stop an action? Because an action whose record cannot be written is an action nobody can later prove was checked. If the record is part of the control, and for regulated or insured activity it is, then losing the record is losing the control.

There is one deliberate exception. Some actions are cheaper to allow than to block: a low-value lookup, a read-only call, an internal notification. For those, a team can opt a single guard in to fail-open. It is a per-action choice, never a global setting, and the SDK reports that choice so it appears in the record. An auditor can see exactly which actions were allowed to run unchecked during an outage, and why.

Principle 2: availability is now a security property

Failing closed has a cost that should be said plainly. If the control plane is down, guarded actions stop. The control plane's availability becomes part of the agent's availability.

That is the right trade, but it has consequences for architecture. The SDK's timeout should be short and configurable, so an agent is not left hanging. The control plane should be deployed with the same care as any other system in a critical path, and its availability target should be agreed with the teams that depend on it. Health and failure signals should be visible to the people who run the agents, not buried in a log. And the dependencies the control plane itself relies on, such as its database and its signing key service, should be few and well understood, because each one is now on the critical path too.

The alternative, a control that keeps agents running by waving actions through when it is struggling, has the worst possible property: it fails silently, exactly when something unusual is happening.

An arc of crimson light stopped cleanly by a dark barrier.
A stopped action is recoverable. An unchecked one may not be.

Principle 3: the control lives outside what it controls

A control that the agent can influence, bypass or reconfigure is not a control. This principle has three practical parts.

Outside the model. The decision must not depend on text the model produced or read. System prompt instructions are guidance, not enforcement. The policy engine reads the structured facts of the call, the tool, the arguments and the agent's identity, and nothing else.

Outside the agent's credentials. If the agent holds the API key for the payments system, it can call the payments system directly, and any guard is cooperative. Move tool credentials into a gateway the agent must go through, and the agent has no other route. A gateway next to an agent that still holds the key is a suggestion, not a control. Anatomy of an enterprise agent architecture covers this pattern, and our guide to the MCP gateway explains the mechanics.

Outside the agent's authority. An agent's key can request decisions. It must not be able to approve them, change policy, lift limits or flip the kill switch. Those need an administrator, and approvals need a person whose identity is established by the organisation's identity provider. An agent that can approve its own request has no approval process at all.

Principle 4: check the real call

A subtle failure in agent security is checking one thing and executing another. An agent tells the control plane it wants to refund 40.00, receives "allow", then calls the refund API with 4,000.00. If the check relies on what the agent reports, it can be lied to, whether by a bug, a confused model or an injected instruction.

The fix is architectural. At a gateway, policy evaluates the arguments of the call the gateway is about to forward, and forwards exactly those arguments. The thing checked and the thing executed are the same object. With an SDK guard, the guard should wrap the call itself, passing the checked parameters into the function that runs, rather than asking separately. This is one reason the gateway path matters for third-party agents whose code you cannot inspect.

Principle 5: defence in depth, each layer closed on its own

No single control is enough, and each one should fail closed independently, without assuming the layer outside it worked.

FIGURE 3Defence in depth for an agentactionIdentity and keysLeast-privilege toolsPolicy checkLimits and kill switchHuman approvalTHEN, AROUND ALL OF ITEvidenceA signed record of everydecision, approval andresult. It does not stopan action. It makes everylayer above provable.THE RULENo layer trusts the oneoutside it. Each failsclosed on its own.
Figure 3. Defence in depth for an agent. No layer trusts the one outside it.
  • Identity and keys. Each agent has its own key, hashed at rest, scoped to one tenant and revocable. A stolen key is limited to what that agent could do.
  • Least-privilege tools. The agent sees only the tools it needs. A gateway can hide every other tool and refuse calls to them without asking anyone.
  • Policy. Each sensitive action is checked against versioned rules.
  • Limits and the kill switch. Rate limits and spending caps catch runaway loops that each look reasonable one call at a time. The kill switch stops everything when someone needs it to.
  • Human approval. For actions above a threshold, a person decides. Approvals expire.
  • Evidence. Around all of it, a signed record of every decision, approval and result. Evidence does not stop an action, but it makes every other layer provable, and it is how you find the failures the other layers missed.

Mapping the threats

Security frameworks for agents are converging on a common list of concerns. The OWASP Top 10 for Agentic Applications describes risks such as goal hijacking through injected content, misuse of tools, and abuse of identity and privilege. MITRE ATLAS catalogues the tactics and techniques adversaries use against AI systems. AIUC-1, a standard written for AI agents, sets requirements across security, safety and reliability with certification in mind. The vocabulary differs, but the underlying threats are consistent, and so are the controls that address them at the action level.

FIGURE 4Threats mapped to controlsTHREATCONTROL IN THE ACTION PATHInjected text steers the agentPolicy judges the real call, not the promptThe agent goes around the checkTool credentials live in the gatewayThe agent lies about the amountThe gateway forwards the arguments it checkedA stolen agent keyHashed, scoped to one tenant, revocableThe agent approves its own requestApprovals need a person with authorityA runaway loopRate limits, spending caps, kill switchThe log is edited afterwardsHash chain, signatures, sealed copies
Figure 4. Threats mapped to controls in the action path. Each control blocks when it cannot decide.

Two of these deserve emphasis. Injection cannot be fully prevented at the model; it can only be made harmless at the action. The question is not whether the agent can be persuaded to try something, but whether it can do it. And the record itself is a target: if someone can edit the log after the fact, every other control becomes unprovable. That is why the evidence log is append-only, hash-chained and signed. MCP tools and the new attack surface goes deeper into tool-level threats.

Principle 6: be honest about the limits

Security architecture should state what it does not cover. A few honest limits apply to any action-level control, including ours.

An SDK guard only works when the agent goes through it. That is acceptable for an organisation's own agent code in a first deployment. It is not the end state, which is why the gateway exists. A gateway only works if the tool's credentials are genuinely out of the agent's reach; if the agent's environment still holds a copy, the gateway can be bypassed. An approval is only as strong as the approver's account: a compromised identity provider account can approve. And a signed log is only as strong as the protection on its signing key, which is why sealing records to storage nobody can alter, including the operator, matters for anything an outside party relies on.

Saying these things out loud is not a weakness in a security design. It is what lets a security team decide where to add the next layer.

Concentric rings of dark stone walls with a crimson glow at the centre.
Each wall should hold even if the one outside it falls.

Governance follows from the defaults

Regulators and standards bodies rarely use the phrase "fail closed", but they describe its effects. The EU AI Act requires high-risk systems to be designed so that people can oversee them effectively, including the ability to intervene or stop the system. The NIST AI Risk Management Framework asks organisations to manage risks with mechanisms that work in practice, not only on paper. ISO/IEC 42001 asks for operational controls and evidence that they operate. A control that silently disappears during an outage meets none of these. A control that stops the action, records why and lets a person decide what happens next meets all of them. Our guide to AI agent guardrails covers the vocabulary, and Governance across jurisdictions maps the regimes.

There is also an insurance angle. An insurer pricing the risk of an agent wants to know what happens in the worst hour, not the average one. A system that fails closed, with a record showing each refusal and each opted-in exception, is far easier to describe and price than one whose behaviour under failure is unknown. Insuring autonomous agents explains how that record becomes a price, which is the job of Riskbound Insure (cover through partner insurers is still ahead), and our guide to AI liability insurance covers the basics.

Putting it into practice

For teams deploying agents now, the principles reduce to a short checklist:

  1. Default every guard to fail closed. Make fail-open a written, per-action exception that shows in the record.
  2. Set short timeouts on the check, and make its health visible to the people who run agents.
  3. Move tool credentials out of the agent's environment and into the enforcement layer.
  4. Check the exact call that will run, not a description of it.
  5. Give agents their own revocable keys, and never the authority to approve, change policy or lift limits.
  6. Keep a signed, append-only record, and refuse actions whose record cannot be written.
  7. Write down what each control does not cover.

Riskbound Control is built on these defaults, and Riskbound Watch keeps the record that proves them. Riskbound is open source under Apache 2.0, so the defaults are there to read in the code. Our thesis explains why we think controls and insurance belong together, the manifesto states our principles, our comparison pages show how action-level control differs from other approaches, and the about page explains how to work with us.

Control it. Prove it. Insure it.

We are working with a small group of design partners.

Get early access