Book a demo

What is an agent runtime?

On this page
  1. Short answer
  2. What a runtime does
  3. Runtime, framework, harness
  4. Pausing for approval
  5. Checks at the boundary
  6. Four runtime controls
  7. Questions
  8. Related reading
  9. Sources
Short answer

An agent runtime is the environment where an AI agent actually runs. It hosts the agent, keeps its session state, gives it compute and passes its tool calls to other systems. Every action the agent takes crosses the runtime before it touches a real system, which makes the runtime the place to check identity and policy on each tool call.

Key takeaways

  • The agent runtime hosts the loop: the model decides, the runtime executes the tool call and returns the result.
  • Managed runtimes keep long sessions alive, isolate each one and can pause a run while it waits for approval.
  • Check each tool call at the runtime boundary, because a model can ignore rules written into its prompt.
  • Look for four controls in any runtime: isolation, identity, a policy check before each call and a record of each call.

The runtime hosts the loop the model drives

An AI agent works in a loop. The model reads its context and picks an action, such as calling a tool. The runtime runs that tool call and hands the result back, and the loop repeats until the task ends. The runtime can be a Kubernetes pod, a serverless function or a managed cloud service, and a coding agent on a laptop runs inside the employee's own machine.

Managed runtimes now exist for this job. AWS describes Amazon Bedrock AgentCore Runtime as a hosting environment for AI agents or tools, which runs each user session in its own microVM with isolated CPU, memory and filesystem. Anthropic's Claude Managed Agents runs sessions in a managed cloud sandbox or a self-hosted one, and its docs say sessions are long-running and resume cleanly after pauses.

Runtime, framework and harness are separate layers

Three terms get mixed up when teams talk about agents. Each one is a different layer, and each one gives you a different place to put controls.

LayerWhat it isExamples
FrameworkThe code library a developer builds the agent withAn agent SDK
HarnessThe running program around the model: loop, tools, context, permissionsClaude Code, Codex
RuntimeThe environment where the harness and its tool calls executeA container, a microVM, a managed cloud service, a laptop

A check in the runtime applies to every agent that runs there, whichever framework or agent harness built it.

A good runtime can pause a run while it waits for approval

Some tool calls need a person before they run, such as a payment or a change to a customer's account. The runtime has to hold the run while that person decides. It saves the agent's state, waits for the approval and resumes the run where it stopped.

Without that ability, teams end up with two bad options. The agent skips the approval to keep going, or the run times out and loses its work. Sessions that survive a pause are what make approval steps practical for agents that run for minutes or hours.

A check at the runtime boundary holds when the model drifts

Many teams start by writing rules into the agent's system prompt: never delete records, never email customers. Those rules reach the model as text, and the model usually follows them, until a confusing input or a planted instruction pulls it elsewhere.

The agent proposes a tool callSay, a delete on the customer database
Rule lives only in the system prompt
PThe model decides

A confusing ticket or a planted instruction can talk it past the rule, and the delete runs.

Rule checked at the runtime boundary
RAllow, hold or deny before it runs

The runtime compares the call with the agent's permissions. A held call waits for a person, and every decision is logged.

Move the rules that matter out of the prompt

Keep prompt rules for guidance. Put deletes, payments and customer messages under a check the model cannot skip.

Figure 1. The same tool call under two kinds of rule. Coral marks the path where a call can wait for a person's approval. On the teal path, the model's own judgment is the only check.
Figure 1 as text
  1. The agent proposes a tool call, for example a delete on the customer database.
  2. Path 1, rule only in the system prompt: the model decides. A confusing ticket or a planted instruction can talk it past the rule, and the delete runs.
  3. Path 2, rule checked at the runtime boundary: the runtime compares the call with the agent's permissions and allows, holds or denies it before it runs. A held call waits for a person, and every decision is logged.
  4. Move the rules that matter out of the prompt. Keep prompt rules for guidance, and put deletes, payments and customer messages under a check the model cannot skip.

A runtime check works outside the model. Before a tool call executes, the runtime compares it with the agent's permissions and your policy, then allows it, holds it for approval or denies it, so the model's choice leaves the outcome unchanged. Claude Code applies the same principle on the laptop: its documentation says its permission rules “are enforced by Claude Code, not by the model.” For tools reached over MCP, an MCP gateway applies this check on every call.

Say a support agent has a database tool, and its system prompt says never to run deletes. A customer ticket asks the agent to clean up duplicate rows, and the agent decides a delete is the helpful move. The runtime has no rule of its own, so it passes the call through, and the team spends the next day restoring from the overnight backup. A runtime policy that denied deletes for this agent would have blocked the call and logged the attempt.

Four controls belong at the agent runtime

A runtime that governs agents well has four controls.

  • Isolation. Each session runs in its own sandbox, so one run cannot read another's files or memory. See AI agent sandboxing.
  • Identity. Each agent acts under its own identity, so every system it calls knows which agent is asking.
  • A policy check before each tool call. The runtime compares the call with permissions and rules before it runs.
  • A record of each call. The runtime logs the agent, the tool, the input, the result and the decision.

Of the four controls, only the policy check stops an action before it runs. Isolation limits how far a bad run reaches, and the record explains it afterward.

Moring AI's AI Control Plane puts that policy check in one layer for production agents, inside your own cloud. A policy gateway checks each agent's calls before they execute, and the same layer holds approvals, MCP tool access and audit records, built around the identity and access systems you already run on AWS, Azure, GCP or Kubernetes.

Before your next agent goes live, write down where its tool calls get checked, and move any rule that lives only in the system prompt into the runtime.

Frequently asked questions

What is an agent runtime?

An agent runtime is the environment where an AI agent runs. The agent runtime hosts the agent's loop, keeps session state, supplies compute and executes the tool calls the model chooses. Examples include managed services built for agents, such as Amazon Bedrock AgentCore Runtime and Claude Managed Agents, as well as Kubernetes pods, serverless functions and a developer's laptop running a coding agent.

What is the difference between an agent runtime and an agent framework?

An agent framework is the code library you use to build an agent's loop, prompts and tool definitions. An agent runtime is where that code runs and where its tool calls reach real systems. You can usually run an agent built with one framework on several different runtimes, so controls placed in the runtime apply whichever framework built the agent.

What is the difference between an agent runtime and an agent harness?

An agent harness is the software wrapped around the model that runs the loop, gathers context, offers tools and asks for approval. Claude Code and Codex are harnesses. An agent runtime is the environment the harness and its tools run in, such as a laptop, a container or a managed cloud service. Settings in the harness travel with the tool, while checks in the runtime apply to everything running there.

Where should AI agent policy be enforced?

AI agent policy should be enforced at the runtime boundary, where an agent's tool calls leave for real systems, before each call executes. Rules in the system prompt help the model choose well, but the model can still drift. A check outside the model allows, holds or denies each call based on the agent's identity and your policy, and records the decision.

What does session isolation mean for AI agents?

Session isolation means each AI agent session runs in its own sandbox, so one session cannot read another session's files, memory or credentials. AWS, for example, documents that Amazon Bedrock AgentCore Runtime runs each user session in a dedicated microVM with isolated CPU, memory and filesystem. Isolation limits how far one bad run can reach.

Do I need a managed agent runtime?

A managed agent runtime makes sense when agents run for long periods, need isolated sessions or must pause for approvals. Services such as Amazon Bedrock AgentCore Runtime and Claude Managed Agents handle hosting, isolation and session state for you, and teams that already run Kubernetes often host agents there instead. Either way, add a policy check before each tool call, because hosting alone leaves the question of which calls are allowed open.

How does Moring AI enforce policy at the agent runtime?

Moring AI enforces policy for production agents through its AI Control Plane. A policy gateway in the AI Control Plane checks every tool call against the agent's identity and your rules before the call executes. Calls that need sign-off wait for a recorded approval, and every run leaves an audit record. The AI Control Plane runs in your own cloud environment.

Sources