All chapters
  1. Start hereAn agent is a model call in a loop
  2. Chapter 1One call: what a model is from the outside
  3. Chapter 2The loop: where a call becomes an agent
  4. Chapter 3The abstraction ladder: six rungs over one call
  5. Chapter 4The eight jobs of a harness
  6. Chapter 5Context: deciding what the model sees
  7. Chapter 6Tools: what the model may ask for, and where it runs
  8. Chapter 7MCP: one way to plug tools into any harness
  9. Chapter 8RAG: retrieval is context assembly
  10. Chapter 9Control flow and state: stopping, pausing and resuming
  11. Chapter 10Guardrails: identity, approval and the output contract
  12. Chapter 11Reliability and cost: retries, budgets and the failures that will happen
  13. Chapter 12Observability and evals: knowing what the agent did, and whether it was right
  14. Chapter 13Many agents: more loops, and what each one costs
  15. Adopt · 1SDKs: the same loop in Python, TypeScript and Java
  16. Adopt · 2Coding harnesses: a finished harness for software work
  17. Adopt · 3Frameworks and graph runtimes: the loop as a library
  18. Adopt · 4Managed platforms: someone else runs the loop
  19. Adopt · 5Build your own: a whole harness in one file
  20. DecideBuild or adopt: who runs each job?
  21. ReferenceGlossary
  22. AboutAbout this site
Adopt · 4

Managed platforms: someone else runs the loop

A managed harness runs the loop, the sandbox and the state on a vendor's servers. What you hand over, what you keep, and the questions to ask before you do.

The quote agent is designed. To run it, the team sends the insurer's platform team a short request: one service that keeps the loop running, one database for checkpoints, and one sandbox where tools can execute. The platform team answers with a question.

"Several vendors now run agents as a service. Why does a quote email need its own servers, its own checkpoint database and its own sandbox?"

It is a fair question, and "we already wrote it" is not an answer. A good answer has two parts. What exactly would a vendor run? And what can never leave the insurer, whichever vendor is chosen? This chapter works out both, then reads five platforms with the answers in hand.

A managed harness takes over the machinery of the loop: the process, the sandbox and the stored session. It does not take over what the loop is for. Your tools' logic, the decision of what the agent may do, the human approval, the judgment of the results and the bill stay with you on every platform.

This is rung 6, the top of The ladder. That chapter noted that a tool of your own still runs in your application. Here the same boundary is drawn for the whole harness, job by job.

1. What "running the loop" needs, seen from the miniature#

Before asking what a vendor takes over, list what there is to take. The miniature does all of it on one laptop, so it is a good inventory.

The command below is from the miniature's README. It runs the quote email through harness.py against the scripted model. A successful run proves that the loop can stop at the approval gate and be continued later by run id. It proves nothing about servers, because there are none.

/opt/homebrew/bin/python3 harness.py --fake
/opt/homebrew/bin/python3 harness.py --fake --resume run-2a947aff --approve
send_reply is waiting for a human. Continue with: --resume run-2a947aff --approve
{
  "run_id": "run-2a947aff",
  "status": "waiting_approval",
  "decision": null,
  "reply": "waiting_approval",
  "turn": 4,
  "tokens": 3020
}

The second command, sent after a person agreed, ends with "status": "done" and "reply": "sent". Between the two commands no process was running. The run survived because its state was a row in runs.sqlite.

Now read that run as a list of things somebody must operate. There are five, each serving one of the eight jobs.

A process that stays alive. The loop is code that calls the model, runs tools and calls again. In the miniature it lives for one command. In production it must be running whenever an email arrives, in many copies. This is job 3, control flow, as an operations problem.

A store for state. The model remembers nothing, so the history and the status of each run must be saved somewhere that outlives the process. In the miniature that is checkpoint, which writes one row per step to runs.sqlite. In production it is a database with backups, retention rules and access control. This is job 4.

A safe place to run tools. In the miniature, run_tool_guarded runs each tool behind an allow-list and a two-second wait limit. Its docstring is honest: "This is NOT a sandbox: the tool runs in our process". A sandbox is an isolated environment, such as a container, where a tool can do damage only inside the walls. Once an agent may run a shell command or code the model wrote, someone must provide that isolation. This is job 2.

Credentials for tools. The miniature's tools read simulated data, so they need no keys. The real lookup_property calls a paid data service, and the real send_reply uses a mail account. Those secrets must be stored, handed to the right tool and never shown to the model. This is part of job 5.

A network path to your systems. The underwriting rules and the policy database sit inside the insurer's network. Wherever the tools run, they need a route to those systems, and nothing else should have one. This belongs to job 2 as well.

What must existJob it servesIn the miniatureIn production
A process that stays alive3 Control flowOne command, then it exitsA service that runs and scales
A store for state4 State, memory, durabilityruns.sqlite, written by checkpointA database with retention and access rules
A safe place for tools2 Tools, and where they runrun_tool_guarded: an allow-list and a wait limitA sandbox per run
Credentials for tools5 Identity, permissions, approvalNone. The data is simulated.A secret store
A network path2 Tools, and where they runNone. Everything is in one file.A controlled route into your network

The team's request to the platform team was this table's right-hand column. None of it is specific to insurance: an insurer gains nothing by being good at keeping processes alive. That is the case for letting a vendor do it.

2. What a vendor takes over#

A managed agent is an agent whose loop runs inside a vendor's service. You do not deploy the loop. You send the service a definition, and then you talk to the running agent through its API.

The products use similar nouns, so it helps to learn them once. Claude Managed Agents and the OpenAI Agents API both name four. An agent is the definition: Anthropic's overview lists "the model, system prompt, tools, MCP servers, and skills". An environment is where the work happens: a sandbox the vendor hosts, or one you host. A session is one running instance of the agent on one task. Events are the messages that pass between your application and the session. The other platforms use other words, and their tabs below say which.

Map those nouns onto the table from section 1. The session replaces the process and the store. The environment replaces the sandbox, and the network path is a setting on it. A vault, where a platform has one, replaces the secret store.

If the vendor runs all of that, what does the insurer's own code still do? Follow one quote through a managed session. The diagram is a design for the running example, not a recording of a run.

Diagram: One quote on a managed harness · where the run crosses back to you

Time runs down the page. The two columns in the middle are at the vendor. The others are at the insurer. Watch for the two moments when the vendor's harness stops and waits for the insurer: the tool, and the approval. This is a design for the running example, not a recording of a run. Click any step.

  1. Your application to Managed harness: Create a session, send the email. Your application sends the agent definition's id and the broker's email as the first event. From here the vendor keeps the loop running.
  2. Managed harness to Model: Call the model with the context. The vendor's harness assembles the request: instructions, tool definitions and the history so far.
  3. Model to Managed harness: Tool request: check the rules. The model asks for a tool by name, with arguments. Nothing has run yet.
  4. Managed harness to Your application: Event: your tool is requested. The harness cannot run this tool, because it lives in your systems. It passes the request to your application and the session waits.
  5. Your application: Decide: may this caller run it?. Your code checks the role of the caller against the tool. The platform's permission policies do not cover a tool that runs in your application.
  6. Your application to Your rules tool: Run the rules. Your application calls your tool, inside your network, with your credentials.
  7. Your rules tool to Your application: Outcome: quote, high band. The rules answer. The data never passed through the vendor's sandbox; only this result will be sent to the session.
  8. Your application to Managed harness: Event: the tool result. Your application posts the result to the session. The vendor's harness adds it to the history and continues the loop.
  9. Managed harness to Model: Call again, with the result. The same request as before, now with one more tool result in the history.
  10. Model to Managed harness: A decision and a draft reply. The model returns its recommendation. It is still only text.
  11. Managed harness to Your application: Session idle: an answer is needed. The session stops and is saved at the vendor. It can wait for days. Your application checks the output against its contract before showing it to anyone.
  12. Your application to Underwriter: Show the draft. Your screen, your rule about who may approve, your record of the answer.
  13. Underwriter to Your application: Approve. A person decides. The model recommended.
  14. Your application: Send the email, once. The side effect happens in your application, behind your outbox, so a repeated request cannot send the reply twice.

Two moments in that sequence cross the boundary back to the insurer. The first is the tool. The model asks for check_underwriting_rules, and the vendor's harness cannot run it, because the rules live in the insurer's systems. So it hands the request to the insurer's application as an event and waits. The second is the approval: the session stops, and a person at the insurer answers. The actors are the ones this site uses on every page: the model asks, the harness decides and calls, the tool does. On a managed platform the middle actor is split in two. The vendor's half carries the request. Your half still decides, for your own tools.

3. What never leaves#

Five things stay with the insurer on every platform read for this chapter. Each is easy to assume away.

Your tools' logic and data. Every platform has a tool type that runs in the caller's application, and each says so plainly. Anthropic: "Claude does not run a custom tool itself. It emits a structured request, your code runs the operation, and you return the result to the session." Microsoft, on function calling: "Your app executes the function and returns the output." AWS describes inline functions as "tool schemas that execute on the client side, not on the harness VM". OpenAI: "Function tools let an agent call your application code." The underwriting rules are such a tool, so the service that hosts them, its data and its uptime remain the insurer's work.

The decision of what the agent may do. Platforms offer mechanisms: permission policies, policy engines, role-based access. None of them knows that a broker portal may verify an address and nothing more. Someone at the insurer writes that rule. In the miniature it is the ROLE_TOOLS table and the authorize function. On a platform it becomes a policy document, and for your own tools it stays in your code. Anthropic's permission page is explicit: "Custom tools run in your application, under your control, so permission policies don't apply to custom tools."

The human approval. A platform can pause a session and wait. It cannot supply the underwriter. The screen that shows the draft, the rule about who may approve, and the record that a named person agreed are the insurer's. Be careful with features whose name sounds like approval. OpenAI's session setting review has the values "auto_review" and "none", and its page says that "none" "does not send those actions to your application for manual approval". An automatic reviewer is a different control from a person, and only a person satisfies "a person decides".

The evaluation of results. An eval is an automated test of outputs. Several platforms run the scoring as a service. They cannot know that the right answer for 9 Coral Way is a referral, because the house was built in 1925. The golden set (the miniature has five cases in golden.jsonl) and the definition of "correct" are the insurer's knowledge.

The bill. A session spends tokens whether or not anyone is watching. Platforms report usage, and some offer a hard cap. Choosing the cap is still a person's job.

Diagram: What a vendor can run · and what each piece still needs from you

The left column is machinery a vendor can run for you. The right column is what stays with you on every platform. Each arrow says how a piece of machinery depends on something only you have. Click any box.

  1. A vendor can run
    1. The loop and its process: The service that calls the model, handles tool requests and calls again, for as many sessions as arrive.
    2. A policy check and a secret store: A mechanism that allows, denies or pauses a tool call, and a place that holds credentials outside the prompt.
    3. The stored session: The history of the run, saved at the vendor, so a session can stop and continue later.
    4. Traces and usage numbers: A record of what each session did and how many tokens it used.
  2. You keep, on every platform
    1. Tool logic and data: Your own tools run in your application. The service that hosts them, its data and its uptime are yours.
    2. What the agent may do: The rules a policy mechanism enforces: which role may run which tool and see which document.
    3. The human approval: The person, the screen that shows the draft, and the record that a named person agreed.
    4. The evaluation of results: The test cases and the definition of a correct answer.
    5. The limits and the bill: The number behind every cap, and the invoice at the end of the month.

The left column can be rented. The right column cannot, and the reason is the same in every row: it holds knowledge about the insurer's business that no vendor has.

The vendor can runYou keep, on every platform
The loopThe process, scaling, restartsThe instructions and the choice of model
ToolsA sandbox, and its built-in toolsYour own tools: logic, data, uptime
StateThe session historyWhat it contains, who may read it, when it is deleted
PermissionsA policy mechanism, a secret storeThe rules themselves. The check for your own tools.
ApprovalThe pauseThe person, the screen, the record
ResultsTraces, and sometimes scoringThe test cases and what "correct" means
CostUsage numbers, sometimes a capThe number, and the bill

That is the first half of the answer: a vendor can run the right-hand column of section 1, and cannot run the right-hand column of this table.

4. Five platforms, read as eight jobs#

The second half is specific to a product. The table translates five platforms into the eight jobs, in the words this site uses for every such table. MANAGED means the vendor runs the job as a service. YOU BUILD means the documentation leaves it to your code. "The docs do not say" means the pages read for this chapter do not answer, which is not the same as "absent".

Every cell was read on the vendor's documentation on 2026-11-16 or comes from this site's checked baseline of 2026-11-14. Names and status change often, so this is a dated reading, not a ranking. It describes one mode of two products: the harness module of AgentCore, and prompt agents on Foundry.

JobClaude Managed Agents (beta)OpenAI Agents API (beta)Amazon Bedrock AgentCore, harnessFoundry Agent Service, prompt agentsGoogle Agent Runtime
1 Context assemblyMANAGED: prompt caching, compactionMANAGED: context compactionMANAGED: truncation by sliding window or summarizationMANAGED: input truncated to the model's context sizeThe docs do not say
2 Tools, and where they runMANAGED: a container per session, or a worker you host. Custom tools: YOU BUILDMANAGED: a hosted sandbox, or an executor you host. Function tools: YOU BUILDMANAGED: a microVM per session, Gateway, Code Interpreter, Browser. Inline functions: YOU BUILDMANAGED: Code Interpreter sandbox, Toolboxes, MCP. Function calling: YOU BUILDMANAGED: runs the container you deploy. Code Execution sandbox
3 Control flowMANAGEDMANAGEDMANAGED: the harness. On Runtime alone, the loop is your code.MANAGED. A hosted agent runs your code instead.The docs do not say
4 State, memory, durabilityMANAGED: session history, sandbox checkpointMANAGED: session stateMANAGED: Memory, short and long termMANAGED: Microsoft's storage, or your own Azure resourcesMANAGED: Sessions, Memory Bank
5 Identity, permissions, approvalMANAGED: permission policies, vaultsMANAGED: vaults, automatic reviewMANAGED: Identity, PolicyMANAGED: Entra agent identity, role-based access, content filters, approval for MCP toolsMANAGED: Agent Identity, Agent Gateway
6 Output contractThe docs do not sayThe docs do not sayThe docs do not sayThe docs do not sayThe docs do not say
7 Reliability and costMANAGED: session budget, automatic retry of transient errorsMANAGED: sessions resume. Retrying a failed request: YOU BUILDMANAGED: limits on iterations, time and tokensYOU BUILD: retry rate-limit errors with backoffThe docs do not say
8 Observability and evalsMANAGED: session viewer, usage, OpenTelemetry tracingMANAGED: tracing on by default, exportMANAGED: Observability, EvaluationsMANAGED: tracing, metrics, evaluationsMANAGED: tracing, evaluation

Three things in the table deserve a second look.

Row 2 has the same shape in the first four columns: a managed sandbox, then "YOU BUILD" for your own tools. The vendor's sandbox runs general tools such as a shell or a file editor. A quote agent hardly uses those. Its tools are business tools, so for this use case most of job 2 stays at home.

Row 6 is empty everywhere. Job 6 is the output contract: the reply must be {decision, premium_band, missing_fields, reasons} and nothing else. None of the agent definitions read for this chapter has a field for an output schema. So the check that the miniature does in validate_decision stays in your application, after the session returns. An empty cell is not a defect. It is a job that has not moved.

The last column is thinner for a structural reason. On Agent Runtime you deploy agent code that you built with a framework, and the service runs and scales it. The loop is inside what you deployed. AgentCore and Foundry offer that mode too, as Runtime and as hosted agents. So "managed" covers two offers: a vendor that runs its harness for you, and a vendor that hosts yours. Frameworks describes what you would deploy in the second case.

Services that manage one job, not the loopDurable state as a service, with your code still at home

Two services in this site's baseline manage job 4 without being a managed harness.

LangSmith Agent Server describes itself as "a workflow orchestration runtime for agent workloads" with "built-in persistence and a task queue". Its queue workers "execute your graph code, and write checkpoints". The graph is yours, written with a graph runtime. In the Cloud option the service is "fully managed by LangChain". In the hybrid option the Agent Servers and their data run in your infrastructure.

Temporal Cloud is "a managed Durable Execution platform". Its documentation draws the boundary in two sentences: "Your Workers stay in your environment" and "Temporal Cloud does not execute your application code." The service stores each workflow's history. The loop, the model calls and the tools run in worker processes that you operate.

Both answer "who runs the checkpoint database?" and nothing else. Durable execution itself is explained on Control and state.

5. One tab per platform#

Each tab has the same four parts: what the product is in its vendor's words, which jobs it runs, what stays with you, and one small example. No account was created and no API was called for this page: every example is adapted from the official documentation and was not run here. Names such as TRIAGE_INSTRUCTIONS, RULES_SCHEMA and email_text stand for values the reader supplies.

Claude Managed Agents

What it is. Anthropic's documentation: "Pre-built, configurable agent harness that runs in managed infrastructure." It is in beta, and the page adds that Anthropic "might refine behaviors between releases".

Which jobs it runs. The loop, with prompt caching and compaction. A sandbox: "Each session gets its own isolated sandbox (a fresh Linux container)." The state: sessions "store conversation history, sandbox state, and outputs server-side". It also has permission policies (always_allow, always_ask, auto), vaults for credentials, an optional session budget that is "a hard spend ceiling", a session viewer in the Console and OpenTelemetry tracing. The budgets page, read on 2026-11-16, lists session running time "at $0.08 USD per hour" in addition to model tokens.

What stays with you. Custom tools, which run in your application and are outside the permission policies. The network setting: a create request that omits networking "gets unrestricted", so set it. The output check, because the agent definition has no schema field. Retention: a session keeps its history "until you delete the session", and the overview says the product is "not eligible for ZDR, except for self-hosted Managed Agents" (ZDR is the vendor's zero data retention arrangement). In the self-hosted mode, "Claude runs on Anthropic's side and requests tool calls. Your worker runs each call locally and posts the result back."

A minimal example. The fragment creates the agent definition with the rules tool, an environment with limited networking, and a session pinned to one agent version. The definition is versioned, so a session can keep running the version that passed your tests.

# Claude Managed Agents (beta). Adapted from the official documentation; not run here.
from anthropic import Anthropic

client = Anthropic()

agent = client.beta.agents.create(
    name="Quote triage",
    model="claude-opus-5-5",
    system=TRIAGE_INSTRUCTIONS,
    tools=[{
        "type": "custom",                     # runs in your application, not in the sandbox
        "name": "check_underwriting_rules",
        "description": "Apply the underwriting rules to a property.",
        "input_schema": RULES_SCHEMA,
    }],
)
environment = client.beta.environments.create(
    name="quote-env",
    config={"type": "cloud", "networking": {"type": "limited", "allow_package_managers": True}},
)
session = client.beta.sessions.create(
    agent={"type": "agent", "id": agent.id, "version": agent.version},   # pin the version
    environment_id=environment.id,
    title="Quote: 18 Gulf Shore Blvd",
)
client.beta.sessions.events.send(session.id, events=[
    {"type": "user.message", "content": [{"type": "text", "text": email_text}]},
])

When the model asks for the rules, the session goes idle with the stop reason requires_action and your application receives an agent.custom_tool_use event. It runs the rules and answers with a user.custom_tool_result event.

OpenAI Agents API

What it is. OpenAI's documentation: "The Agents API gives your application access to the Codex harness through an OpenAI-managed API." Requests carry the header OpenAI-Beta: agents=v1, and the documentation calls it the beta API. It is a different product from the OpenAI Agents SDK, which is a library, and from the Responses API, which is a model API with optional stored state.

Which jobs it runs. The overview: "OpenAI manages sessions, orchestration, context compaction, and recovery". A sandbox, when you ask for one: with environment.type set to openai_hosted, "OpenAI provisions and connects it", and network access can be enabled, disabled or restricted to a list of domains. Vaults store credentials "outside your agent's instructions and configuration". Tracing "is enabled by default for new sessions", and traces can be exported as OpenTelemetry Protocol JSON.

What stays with you. Function tools: "Your handler can run in an application server, a worker, or an environment you control." The human approval: the pages read describe automatic review and no manual approval step, so a gate for a person is built from a function tool that your application answers only after someone agreed. Retries of failed requests, which the errors page describes as steps for your application. Data location: the overview says the API "currently supports data residency only in the United States and does not support Zero Data Retention (ZDR)", and that a self-hosted sandbox does not change that. The pages read state no retention period and no way to set a spending limit.

A minimal example. The fragment starts one session with an inline agent definition, no sandbox, and the broker's email as input. There is no environment, because this agent's only tool runs in your application.

# OpenAI Agents API (beta). Adapted from the official documentation; not run here.
from openai import OpenAI

client = OpenAI()

session = client.beta.agents.sessions.create(
    agent={
        "model": "gpt-6-astra",               # the model id in the documentation's own example
        "instructions": TRIAGE_INSTRUCTIONS,
        "tools": [{
            "type": "function",               # runs in your application
            "name": "check_underwriting_rules",
            "description": "Apply the underwriting rules to a property.",
            "parameters": RULES_SCHEMA,
        }],
    },
    environment={"type": "none"},
    input=[{"role": "user", "content": [{"type": "input_text", "text": email_text}]}],
)

When the model asks for the function, the session emits agent.session.requires_action. Your application reads the pending call from required_actions, runs the rules, and sends an event of type agent.session.input.tool_result.

Amazon Bedrock AgentCore

What it is. AWS's documentation: "an agentic platform for building, deploying, and operating highly effective agents securely at scale using any framework and foundation model". It is a set of modules. Two matter here. Runtime hosts agent code that you bring. Harness is "a managed agent loop that lets you define and invoke AI agents with a single API call", it is generally available, and it "is powered by Strands Agents, the open-source agent framework from AWS".

Which jobs it runs. With the harness you declare "model, tools, skills, instructions" and AWS runs "environment, compute, memory, identity, networking, and observability". Each session "runs in a secure, isolated microVM". Context is managed by a truncation strategy. Limits are parameters: maxIterations (default 75), timeoutSeconds (default 3600) and maxTokens (no default). Memory keeps short-term and long-term state. Policy integrates with Gateway "to intercept every tool call before execution". Every invocation "automatically generates traces, logs, and metrics" in CloudWatch.

What stays with you. Inline functions: the harness "pauses when the tool is called and returns the call to your code", and the documentation calls this "the pattern for human-in-the-loop approvals". The policies themselves. The network choice: "By default, harness sessions run on the public network", and a session can instead be connected to your VPC (your private network at AWS). The output check. The pages read do not say where session state is physically stored.

A minimal example. The first command creates a harness with defaults. The Python fragment invokes it with the broker's email and prints the streamed text. No agent code is deployed.

# Amazon Bedrock AgentCore harness. Adapted from the official documentation; not run here.
aws bedrock-agentcore-control create-harness \
  --harness-name "QuoteTriage" \
  --execution-role-arn "arn:aws:iam::123456789012:role/QuoteTriageRole"
# Amazon Bedrock AgentCore harness. Adapted from the official documentation; not run here.
import boto3

client = boto3.client("bedrock-agentcore", region_name="us-west-2")

response = client.invoke_harness(
    harnessArn=HARNESS_ARN,                   # returned when the harness is created
    runtimeSessionId=SESSION_ID,              # the documentation requires at least 33 characters
    messages=[{"role": "user", "content": [{"text": email_text}]}],
)
for event in response["stream"]:
    if "contentBlockDelta" in event:
        delta = event["contentBlockDelta"].get("delta", {})
        if "text" in delta:
            print(delta["text"], end="", flush=True)

A new harness gets version 1, and versions are immutable. The DEFAULT endpoint "automatically points to the latest version", so a change is live there as soon as it is saved. A named endpoint moves only when you update it.

Foundry Agent Service

What it is. Microsoft's documentation: "Foundry Agent Service is a managed platform for building, deploying, and scaling AI agents." The limits page says the service is generally available and that some sub-features are in public preview. It offers three agent types. With a prompt agent you "define instructions, a model, and tools, and Foundry runs the agent for you". A voice-based prompt agent is the real-time voice form, in preview. With a hosted agent you "bring your own code and framework, and Foundry runs it as a container".

Which jobs it runs. For prompt agents: the loop, conversations that persist history across turns, a tool catalog that includes MCP, file search and a Code Interpreter that "runs Python code in a Microsoft-managed sandbox". Identity comes from Microsoft Entra: an agent identity is "a specialized identity type in Microsoft Entra ID that's designed specifically for AI agents". Tracing is stored in Application Insights and uses OpenTelemetry conventions. An optional Microsoft Copilot harness, in preview, is "an optional managed runtime for prompt agents".

What stays with you. Function calling, which the tool table marks as client-side execution. Retries: the limits page tells the caller to "implement exponential backoff with jitter in your application retry logic". The choice of where state lives: basic setup uses "Microsoft-managed storage that's logically separated", and standard setup "stores agent state in customer-managed, single-tenant Azure resources in your own subscription". Approval exists for MCP tools through require_approval, whose default is always. For your own functions the approval is your code.

A minimal example. The fragment creates a version of a prompt agent, opens a conversation and sends the broker's email. The agent is a named, versioned definition, and a turn is a call to the Responses API bound to that agent.

# Foundry Agent Service, prompt agent. Adapted from the official quickstart; not run here.
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient
from azure.ai.projects.models import PromptAgentDefinition

project = AIProjectClient(endpoint=FOUNDRY_PROJECT_ENDPOINT, credential=DefaultAzureCredential())

project.agents.create_version(                # creates the agent, or a new version of it
    agent_name="quote-triage",
    definition=PromptAgentDefinition(
        model="gpt-5-mini",                   # the model in the quickstart's own example
        instructions=TRIAGE_INSTRUCTIONS,
    ),
)
openai = project.get_openai_client(agent_name="quote-triage")
conversation = openai.conversations.create()
response = openai.responses.create(conversation=conversation.id, input=email_text)
print(response.output_text)

Each call to create_version adds a version, and the overview says a team can "roll back to any previous version".

Google Agent Runtime

What it is. Agent Runtime is part of Gemini Enterprise Agent Platform. Until 2026-04-22 its name was Vertex AI Agent Engine. Google's overview describes it as a "high-performance, scalable runtime environment for deploying and managing agents". The pages read give no preview or general-availability label for it.

Which jobs it runs. It runs and scales agent code that you deploy. The deploy page accepts agents built with Google's Agent Development Kit, LangChain, LangGraph, AG2, LlamaIndex or custom code. Around the runtime sit separate services: Sessions "maintains the history of interactions between a user and agents", Memory Bank keeps memory across sessions, and Code Execution runs generated Python in a sandbox that "offers a limited file system and no network access". Agent Identity gives each agent "a fully managed, unique identity". Agent Gateway is "a central policy enforcement point to govern all agent tool calls".

What stays with you. The agent code, and with it the loop, the context assembly, the output check and the limits, because they are inside the framework you chose. The pages read name no limit on turns and no token budget for the runtime. The network path is a Private Service Connect interface that you configure. A redeployment "creates a new reasoningEngines resource with a unique ID", and the pages read describe no versions or traffic split for testing a change.

A minimal example. The fragment deploys an existing ADK agent and sends it the broker's email. The documentation was read in short excerpts, so this example is assembled from single documented lines and is the least certain on this page. quote_agent stands for an ADK agent you defined, and DEPLOY_CONFIG for the deployment settings.

# Agent Runtime (Gemini Enterprise Agent Platform). Assembled from single lines of the
# official documentation; not run here.
import agentplatform
from agentplatform.frameworks import AdkApp


async def deploy_and_ask(email_text: str) -> None:
    client = agentplatform.Client(project="PROJECT_ID", location="LOCATION")
    app = AdkApp(agent=quote_agent)                       # your agent, built with ADK
    remote_app = client.runtimes.create(agent=app, config=DEPLOY_CONFIG)
    session = await remote_app.async_create_session(user_id="broker-17")
    async for event in remote_app.async_stream_query(user_id="broker-17", message=email_text):
        print(event)

6. Seven questions to settle before adopting one#

The tabs describe products. The decision depends on the insurer's conditions, and seven questions bring those out. The answers cited are examples of what to look for in a vendor's documentation.

Where does the state live, and can you get it out? A managed session holds the broker's email, every tool result and the draft reply. If your rules say such data must stay in a given country or in your own account, check that first. The answers read differ: one product can store state in your own cloud subscription, and another offers data residency in one country only. Then ask how to read the history back out, and what "delete" removes.

Where do tools run, and what can they reach? If the agent uses only your own tools, the vendor's sandbox matters little. If it uses built-in tools, look at the sandbox's network setting and its default. Defaults can be open. Two read for this chapter: an environment created without a network setting gets unrestricted outbound access, and harness sessions run on the public network unless connected to a private one.

Who can see prompts, tool results and traces? List the readers: the vendor under its access rules, your own engineers through the console, and any tracing system you export to. If zero retention is a requirement, read the product's own sentence about it. Two of the five products say in their overviews that the managed service does not support one.

How are limits and costs set and reported? If a runaway session would be expensive, you need a cap that the platform enforces, and to know what happens at the cap. One product stops the session at a budget and leaves it idle. Another has default limits of 75 iterations and one hour. A third reports usage with the note "These counts are not a final bill". Where the pages state no limit, the limit is your code around the session.

What happens to a run during a vendor outage? With your own harness, an outage of the model pauses the run, and runs.sqlite still holds it. With a managed harness, the state is at the vendor too. The pages read describe transient errors (one session status is rescheduling: "Transient error occurred, retrying automatically"), and none describes a full outage. So ask. And keep one record at home in any case: that an email was sent. The miniature's send_once writes an idempotency key to an outbox, so a repeated tool request cannot send twice.

How do you test a change before it goes live? If a prompt edit can change quotes, it needs the same gate as code. Look for versions of the agent definition and a way to choose which one serves live traffic. The mechanisms read differ: a version pinned on a session, immutable versions behind named endpoints, a default endpoint that follows the latest version at once. The test itself is yours on every platform. The miniature's golden set prints score: 5/5 today, and a new version must print it again.

How hard is it to leave? Some parts travel: your instructions, your tools (most easily when an MCP server offers them, see MCP), your golden set, and traces you exported in an open format. Other parts do not: the stored session format, the policy documents, the vault, the sandbox setup. The more of the right-hand column of section 3 you kept in your own code, the smaller the move.

For regulated work, three of the seven come before any feature comparison. The first and the third, because the session contains personal data about a broker's client. And the fifth, together with the approval from section 3, because an insurer must be able to show who decided what, also on a day when a supplier was unavailable. This page does not say that any product meets or fails any regulation. Vendors publish their own statements, and the insurer's compliance team reads them against its own duties.

7. The answer for the platform team#

A vendor can run the service that keeps the loop alive, the checkpoint database and the sandbox. For this agent the sandbox would be nearly unused, because all three business tools run in the insurer's application either way. The tool service, the role rules, the approval screen, the output check, the golden set and the outbox stay, on every platform. So the honest comparison is between two short lists. Adopting removes one service and one database from the platform team's work. It adds a second place where customer data lives, a dependency for every run, and the seven questions above.

Whether that trade is good depends on the agent. One that needs a general sandbox, runs for hours and touches no regulated data gets most of its harness from rung 6. A quote agent whose value is in its rules and its approval gets less.

What comes next#

You can now take any managed platform and sort its features into "the vendor runs" and "you keep". What is still unseen is the other end of the ladder in one piece: the rows of this chapter's tables, written as code in a single file. Build your own reads the whole miniature in order, all eight jobs as named functions, then runs it and breaks it. After that, the choice between the two ends can be made job by job.