Every enterprise that moves an AI agent from a demo to production discovers the same thing. The model is the smallest part of the system. Around it sits a runtime, a context pipeline, a set of tools, identities, credentials, telemetry and the systems of record the agent is there to change. How those parts are arranged decides what the agent can do, what can go wrong and who can prove what happened.
This post lays out a reference architecture for an enterprise agent, part by part. It is written for the architects and security teams who have to approve one. The aim is not to prescribe a vendor or a framework, but to name the components clearly enough that you can ask the right question about each. In When inference becomes action we argued that the hard problems begin when a model's output becomes a tool call. This is the map of where that happens.
The six layers
Most production agent systems, whatever framework they are built on, decompose into six layers.
- Triggers. What starts the agent: a person in a chat or ticket, a schedule, an event on a queue, another agent.
- Runtime. The orchestrator that runs the loop: it assembles context, calls the model, executes tool calls, handles retries and decides when the task is done.
- Model. The inference service. It proposes the next step.
- Control plane. The layer that decides whether each proposed action may run, and records the decision.
- Tools. The interfaces the agent can call: MCP servers, internal APIs, SaaS connectors, code execution.
- Systems of record. The payments ledger, the CRM, the data warehouse, the mail server. The things that actually change.
Under all six sit shared foundations: identity and single sign-on, secrets management, telemetry and an inventory of what is running. Each layer has its own failure modes and its own owner. Most of the incidents that worry enterprise buyers happen at the joins.
Triggers and the runtime
The trigger matters more than it looks, because it sets whose authority the agent is acting under. An agent started by a customer in a support chat should not have the authority of the support manager. An agent started on a schedule acts for the organisation, and someone should own that. Recording the trigger and the human principal behind it, where there is one, is the first line of any useful audit trail.
The runtime is where the agent loop lives. It is also where most of the complexity hides: prompt templates, memory, retrieval, tool selection, planning, parallel calls, retries and timeouts. Frameworks differ a great deal here, and they change quickly. That is a good reason not to put your controls inside the runtime. If the check on a refund is a line in an orchestration framework, it is only as durable as your choice of framework, and it can be bypassed by any code path that does not go through it.
Two runtime properties matter for governance. First, the runtime should give every agent a stable identity: a name, an owner, a version and a key that is its own. Shared service accounts make every later question harder. Second, the runtime should not hold the credentials for the systems the agent changes. We return to that below, because it is the single most important architectural choice in the system.

The model is a supplier, not an authority
The model provider sits in the architecture like any other supplier. It receives context and returns a proposal. Whether it runs in a hosted API, a private deployment or on your own hardware, three things hold.
First, the model sees everything in its context window, including untrusted content. Anything it reads can influence what it proposes. Second, its output is a probability, not a decision. Third, you cannot inspect why it chose one action over another in a way that would satisfy an auditor. You can log its inputs and outputs, and you should, but the log describes the proposal, not a justification.
This is why the model should never be the last thing between a proposal and an action. Treat inference as an input to a decision, not the decision. The permission to act comes from somewhere else: a policy the organisation wrote, evaluated by a deterministic engine, with a record kept. Our comparison of approaches sets prompt-level guardrails and action-level controls side by side, and our guide to AI agent guardrails explains where each fits.
Tools, MCP and the expanding surface
Tools are where agents get their power and most of their risk. The Model Context Protocol has become a common way to connect agents to tools: an MCP server exposes tools, resources and prompts, and an agent's client discovers and calls them. It makes integration easy, which is the point. It also means an agent's reach can grow by configuration, without a code review.
From an architecture point of view, every tool is a capability grant. A tool that can "update a customer record" can update any field on any customer unless something narrower is enforced. A tool that "runs a query" can read whatever its credentials can read. And tool output is itself untrusted input: a web page, an email body or a ticket description can carry text that steers the agent's next step.
MCP tools and the new attack surface covers these risks in depth. For architecture, the key decision is where tool calls are checked. Our guide to the MCP gateway explains the pattern: a gateway that sits between the agent and its MCP servers, sees every call with its real arguments and checks it before forwarding.
Trust boundaries
Security architecture starts with trust boundaries: the lines across which data or control passes from something you trust less to something you trust more. In an agent system there are four that matter.
- Untrusted inputs. Web pages, emails, documents, tool output and messages from other agents. Assume any of it may contain instructions.
- The agent runtime. The model, prompt and memory. Because it reads untrusted inputs, it can be steered. Treat it as semi-trusted at best.
- The enforcement boundary. The control plane and gateway. It decides from written rules and the facts of the call, not from text, so it cannot be talked out of a decision.
- Systems of record. The things that change. Their credentials live behind the enforcement boundary.
The most common architectural error is placing the runtime inside the innermost zone: giving it direct credentials to systems of record and trusting it to call them correctly. That turns any successful prompt injection into a direct path to production data and money.
Who holds the keys
If you take one idea from this post, take this one. An agent that holds the credentials for a system can always call that system directly. Any control it is asked to go through is cooperative: it works when the agent asks, and only then.
There are two common ways to enforce policy on agent actions, and they differ on exactly this point.
An SDK guard wraps each sensitive call in the agent's own code. The agent asks the control plane before acting and carries out the answer. This is fast to adopt for an agent you build yourself, and it is a sensible first step. But it is cooperative: policy sees what the agent reports, and a code path that skips the guard skips the check.
A gateway sits in the network path. The agent's MCP configuration points at the gateway instead of the tool server, the gateway holds the tool's credentials, and every call is checked with its real arguments before it is forwarded. The agent has no direct route, so it cannot go around the check, and it cannot misreport what it is doing because the gateway checks the call it actually forwards.
Many enterprises will run both: SDK guards for in-house agents that call internal functions, a gateway for MCP tools and third-party agents. What matters is that both send their requests to the same decision pipeline, so there is one policy, one record and one place to audit. Designing a control plane for AI agents describes that pipeline.
Identity, all the way down
Agent identity is still an immature area, so it is worth being deliberate. Four identities appear in a single guarded action:
- The agent. A registered identity with an owner, a status (active, paused, stopped) and its own key. The key is hashed at rest, scoped to one tenant and revocable.
- The human principal, where there is one. The person whose request started the task.
- The approver, when a person is asked to decide. Their identity should come from the organisation's identity provider through single sign-on, not from a name typed into a form.
- The gateway or service that made the call, when the call came through one. Only a gateway's own key should be able to say a call came through a gateway, so that an agent cannot claim it to look safer than it is.
Standards such as OAuth and SPIFFE give useful building blocks for workload identity. The practical rule is simpler: every action in the record should name who asked, who decided and who carried it out, and none of those should be something the agent can set about itself.
One request, end to end
Putting the pieces together, here is what one guarded action looks like in a well-built system. The example is a refund above the amount an agent may issue alone.
The runtime sends context to the model, which proposes a refund. The runtime, or the gateway in front of the refunds tool, asks the control plane for a decision. The control plane checks the agent's identity and status, the kill switch, rate limits and spending caps, then evaluates policy. Policy says amounts in this range need a person, so the outcome is "ask a human". The decision is appended to the evidence log in the same transaction that stores it. An approver with the right authority approves, and their identity is recorded. The agent receives "allow", the call runs, and the result is reported and recorded.
Nothing in that sequence depends on the model behaving well. If the model had proposed a refund ten times larger, policy would have blocked it. If the approver had not answered, the approval would have expired and the action would not have run. If the control plane had been unreachable, the action would have waited. Fail closed explains why that last property is not optional.
Observability and governance
Telemetry for agents should follow the same standards as the rest of your estate. OpenTelemetry is the natural choice for traces and spans, and decision spans should carry the outcome, the reasons, the policy version and identifiers, but never secrets or full request parameters.
Governance needs more than traces. It needs an inventory of every agent, what tools it can reach and how it has behaved, and an evidence record that a third party can check. Riskbound Watch builds both from the decision log, and Evidence you can verify explains how the record is made tamper-evident. The frameworks enterprises are adopting, including the NIST AI Risk Management Framework and ISO/IEC 42001, expect this kind of continuous view rather than a one-time assessment. Our guide to AI agent monitoring lists what to track.

A checklist for architecture review
When an agent comes to your architecture review board, these questions cover most of the ground:
- What triggers the agent, and whose authority does it act under?
- Does the agent have its own identity, owner and revocable key?
- Which tools can it reach, and which of them change state?
- Where are those tools' credentials stored, and can the agent read them?
- Where is each sensitive action checked, and by what? Is the check outside the runtime?
- What happens when the check is unavailable?
- Where does a person approve, and how is their identity established?
- Is there a kill switch that stops this agent, or every agent, at once?
- Is every decision recorded in a form an auditor can verify without your help?
Where Riskbound fits
Riskbound is the control plane in Figure 1. Control provides the policy check, approvals, limits, kill switch, MCP gateway and SDKs. Watch provides the inventory, risk score, failure groups and signed evidence. Insure turns that record into an indicative price and an insurer pack, so that cover from licensed partner insurers, still ahead, can rest on evidence. The core is open source under Apache 2.0.
Our thesis explains why we think this layer becomes standard infrastructure, the way identity and payments did. The manifesto sets out the principles behind the design, and the about page explains how we work with design partners. If you are drawing your first agent architecture, we would be glad to compare notes.



