Certopolis

Claude Certified Architect – Foundations

Claude Managed Agents: agents, environments, sessions

Claude Managed Agents is a hosted agent harness: Anthropic runs the agent loop and the sandbox where Claude reads files, runs commands and searches the web. You create an agent once, then start a session for each run that references that agent by id. It is in beta and needs the managed-agents-2026-04-01 header, which the SDK sets for you.

The four concepts

Agent: the model, system prompt, tools, MCP servers and skills. Environment: where sessions run, either an Anthropic-managed cloud sandbox or a self-hosted sandbox. Session: a running agent instance doing one task. Events: the messages between your app and the agent, such as user turns, tool results and status updates.

You send a user.message event, Claude runs tools on its own, and results stream back over server-sent events. Event history is stored server-side. You can send more events to steer the agent or interrupt it. The Messages API suits custom loops and fine control; Managed Agents suits long-running and asynchronous work.

Create the agent once

An agent is a reusable, versioned configuration. Create it once, for example with client.beta.agents.create(...), and pass its id to sessions.create for every run. Its version starts at 1 and increments each time an update changes it. Passing only the id starts the session on the latest version; passing {"type": "agent", "id": ..., "version": 1} pins a version.

A session can also use {"type": "agent_with_overrides", ...} to replace model, system, tools, mcp_servers or skills for that session only. Overrides replace a field in full and do not change the agent. Clearing tools returns a 400 while the session still has skills, because skills need the read tool.

Starting work

A session needs an agent id and an environment id. Creating it without initial_events starts no work, but the sandbox begins provisioning at once, so the first tool call does not wait on it. A non-empty initial_events list starts the agent in the same call.

Where the exam catches people

  • Calling agents.create() on every request is wrong: the agent is a persistent, versioned object you create once and reference by id.
  • The Tool Runner and a manual Messages API loop do not host a sandbox; Managed Agents is the option where Anthropic runs both the loop and the workspace.
  • Creating a session early is not wasted: the sandbox starts provisioning at creation, before the first event.
  • A session override does not merge with the agent's settings; it replaces that field in full for that session.

Written from Anthropic's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. Your platform team wants Anthropic to run the agent loop and to host the workspace where bash commands, file edits and code execution take place, so that you write no loop code and operate no sandbox infrastructure. Which approach should you take?

    Right. In the game that’s Renown for your Agent Architecture and Orchestration building.

    Not that one: A is right. In the game your Agent Architecture and Orchestration building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The other three leave hosting to the developer.

    Written from platform.claude.com/docs/en/managed-agents/overview

  2. You read that several agent harness products supply the same loop, and must explain to your team what each one does not provide. Your architects want the route that runs inside the process you already operate and ships no tools of its own. Which approach should you take?

    Right. In the game that’s Renown for your Agent Architecture and Orchestration building.

    Not that one: B is right. In the game your Agent Architecture and Orchestration building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    It ships no built-in tools, has no filesystem access and no sandbox, and the developer still hosts the process — which is why it adds nothing to a service that already implements the functions and already runs somewhere.

    Written from platform.claude.com/docs/en/agents-and-tools/tool-use/tool-runner

  3. Your Managed Agents session builds a valuation workbook, and about a third of runs come back missing a stated discount-rate assumption. Your service downloads each workbook, checks it against a twelve-point quality list by hand, and sends a follow-up user.message naming what is absent, which adds roughly twenty minutes to every run. How should you restructure the review?

    Right. In the game that’s Renown for your Agent Architecture and Orchestration building.

    Not that one: C is right. In the game your Agent Architecture and Orchestration building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The grader returns an explanation of which criteria passed or failed, that feedback goes back to the agent, and the cycle repeats until the rubric is satisfied or the iteration cap is spent. The hand review becomes an in-session loop the platform runs.

    Written from platform.claude.com/docs/en/managed-agents/define-outcomes