Skip to main content

Build a production-ready agent with Claude Managed Agents

TL;DR

  • Claude Managed Agents is a set of API endpoints (usable with any API key) that hand you production-ready agents plus the primitives around them — computer access, credential vaults, the tool-calling harness, retries, memory, context management, and multi-agent — so you build only your product layer on top.
  • The four core building blocks are the agent (a template with system prompt, skills, tools, MCP servers, and per-tool permission controls), the environment (sandbox template with network/package config, now supporting self-hosted sandboxes on Cloudflare/Modal/Vercel), the session (an ongoing conversation), and events (user, agent, session, and span events streamed back and forth).
  • A live demo builds a "deal desk" web app from a starter repo using the Anthropic SDK and the built-in Claude API skill, showing session listing, streaming events, outcomes (spec-driven self-evaluation), multi-agent coordination, and the developer console's live observability views.

Takeaways

  • Claude Managed Agents removes the work of building your own agent loop, remote hosting, durable storage, sandboxing fleet, and end-user authentication — these come out of the box.
  • An agent is essentially a versioned template: you define its system prompt, the skills and tools it can use, which MCP servers it connects to, and per-tool permission controls (e.g. file read auto-executes, bash or a database MCP call requires explicit end-user approval).
  • Environments are sandbox templates: configure network access, pre-installed NPM/pip packages, and now bring-your-own self-hosted sandboxes (Cloudflare, Modal, Vercel, or your own fleet) so private data never leaves your VPC.
  • Sessions are ongoing conversations (like a new claude.ai chat or a Claude Code session); you start one with an agent ID and environment ID, and can preload GitHub repos and files into the container.
  • Events come in four kinds: user events (messages, images, documents, interrupts, tool results, outcomes), agent events (Claude's messages, compaction, tool calls, multi-agent coordination), session events (lifecycle/state transitions and errors), and span events (signals for known long-running operations).
  • Outcomes let you pass a spec or rubric; Claude does a first-pass implementation then iterates and self-checks against that rubric repeatedly until satisfied — described as a powerful way to set agents up for success.
  • MCP tunnels and credential vaults let Claude securely use private MCP servers and injected authentication tokens without those tokens ever entering Claude's context window or being exposed on the internet.
  • The Claude developer console provides live observability — you can click into a running session, watch spawned sub-agents on independent threads, inspect individual tool inputs/outputs, monitor tool-call latency, and read or edit memory stores.

Vocabulary

Claude Managed Agents — A set of Anthropic API endpoints providing scaled, production-ready agents and surrounding primitives that you build products on top of. Agent — A reusable template defining a system prompt, available skills and tools, connected MCP servers, and per-tool permission controls. Environment — A template defining how the sandbox containers behave: network access, pre-installed packages, and self-hosted vs Anthropic-hosted infrastructure. Session — An ongoing conversation between an end user and Claude, started from an agent ID and environment ID. Outcome — A spec or rubric you pass to Claude that it tries to satisfy, iterating and checking its own work against it repeatedly. Credential vault — Securely stored MCP authentication tokens that Anthropic injects into a session without Claude ever seeing them. MCP tunnel — A secure tunnel that lets Claude connect to private MCP servers inside your network without exposing them on the internet. Self-hosted sandbox — A bring-your-own container (e.g. Cloudflare, Modal, Vercel) used instead of Anthropic-hosted sandboxes to keep private data within your perimeter. Multi-agent coordination — Events generated when Claude spawns other agents, each with its own context window, to help complete its work.

Transcript

Hi everybody. How's everybody doing? Raise your hands if you've heard the phrase "Claude Managed Agents" get brought up like 50 times today. Okay, and keep your hand raised if you have any idea what Claude Managed Agents even is. Okay, not a lot of hands. And raise your hands if you're excited to learn about Claude Managed Agents today. There we go. I like that. Hopefully this will be a little bit more of a technical deep dive. Myself and a couple of my peers earlier today talked at a very high level. We showed you some slides. We talked about the primitives and whatever. And we'll do a little bit about it here today, but really what I want to make sure that we do is like have our laptops out, start coding. I have a little starter repo for us to go through together. And my hope is that by the end of the session you will be able to go get started with building on Claude Managed Agents today. Does that sound good to everybody? Cool.

Quick agenda. We'll do a quick overview of what Claude Managed Agents is. We'll go over a lot of the same discussion points from earlier today. And then we'll spend some time actually building something relatively from scratch. We'll actually get something that you could be deploying to production today if you wanted to. And then we'll wrap up the session with some more advanced topics around Claude Managed Agents and just the composable things that you can do with it.

So, Claude Managed Agents at a high level is just a set of API endpoints that we've developed and released. You can go use them with any API key today, that give you access to scaled-ready, production-ready agents and all of the primitives around it that you can just build your own products on top of. You can pick and choose whatever primitives you need and ditch the rest, and then build whatever product experience you need on top of. So, we took care of a lot of things like giving Claude access to a computer, giving it access to credential vaults if you want to inject things like MCP authentication for your own end users. If Claude needs access to their Linear MCP, for example. The tool-calling harness and everything, retries and error recovery that might happen in production. As well as a bunch of really nice primitives around memory and context management and multi-agents that make it really easy to escape the exponential and just benefit from each increased model family as they come out. And then the really nice thing with Claude Managed Agents, which we'll show a little bit later today, is that we built a lot of really nice observability views into our developer console that you can go to today in order to live debug what these agents are up to.

So, the main building blocks for Claude Managed Agents are the agent itself, which is really just like — think of it as a template. You want your agent to have a certain system prompt. You want it to have access to certain skills. Maybe you want to define what tools you want that agent to have access to. Some agents you want to have access to the bash tool and web search. Some agents you want to really make sure don't have access to the web because you don't want them to get prompt injected, and you can really pick and choose which tools they have access to. And you can also choose which MCP servers they get connected to, which is also really nice. Another really nice added aspect of setting up all these agents is that you can also define certain permission controls on a per-tool basis. So, you can decide that something like the file-read tool can just auto-execute, whereas something like executing bash or calling your database's MCP server requires explicit approval from your own end users.

Once you configure that agent, you also can configure an environment. These environments kind of define the template for how the sandboxes Claude has access to behave. So, you can define whether or not you want those containers to have network access. Maybe you want to pre-install certain packages from NPM or from pip. So, you can define that at the environment level. And today, since we announced self-hosted environments and sandboxes, you can also bring your own sandboxes that don't just run on Anthropic's infrastructure. You can use something like Cloudflare or Modal or Vercel and use those out of the box, or even your own sandboxing fleet.

Once you configure those two things, you can then just get started on talking to that agent. You have an ID for your agent, you have an ID for your environment. That's all you need to get started with a session. A session is just — you can think of it as kind of like an ongoing conversation with you and Claude. It's the equivalent of going to claude.ai and clicking new, or entering Claude Code from your terminal. Once you do that, you can start submitting events from your own end users, something like them asking for something to happen. Maybe that end user is asking for a PR to get put up. And all of that happens on the session layer. And when you create these sessions, you can also include certain GitHub repositories that you want Claude to have access to, or certain files that you might want to be preloaded into the container itself. So, all of those will be downloaded and provisioned on your behalf.

And then finally, there's the events. These sessions are just ongoing event streams where you submit messages from your client and we return responses that Claude is processing them, doing whatever it needs to be doing. And that's effectively like the four major aspects of Claude Managed Agents. There's a couple of other things alongside, but those are the main primitives that you have to worry about.

So, diving a little bit deeper into the events that we have. Like I mentioned, there's user events. These are things that you might want to submit from your own application. Maybe your user said something, or maybe your platform just auto-submitted some sort of user event. These can include images, documents, text, whatever it is that you need. You can also send interrupts from your own product, your own platform. And you can use those in order to cut off Claude if it was going off on a bad tangent, or doing something wrong, and you wanted to steer it. So, you can use that to prevent it from doing any sort of dangerous action. You can also submit tool results for custom tools that you define and execute in your own platform, or confirmations for human-in-the-loop controls for any sort of server-executed tools. And then you can also define outcomes, which allow you to essentially pass us either a file, or a blob of text that you wrote, that is almost like a spec that Claude will try to do a first pass at implementing, or doing the thing that the spec defines, and then it will essentially enter a mode where it tries to iterate and check its work against that rubric over and over again until it finds that it can actually satisfy that rubric, which we found to be really powerful. It's a really great way to set up your agents for success.

Next we have agent events. Agent events are just anything that Claude is doing. So, these are like messages that Claude is sending back to the user, compaction for if Claude needs to compact its context window because it got too large. The tools that it's executing on your behalf, whether those are MCP tools, or the default agent tools that we've defined. And then there's also multi-agent coordination events for when Claude decides to spawn other agents to help it in doing its work. And we'll show a little bit of what that looks like during the live demo.

Next we have session events. Session events are just life-cycle events that let you know when the status of the session is changing. Maybe it entered a retry loop. Maybe there's some sort of error. Maybe the session needs to idle for whatever reason, or if it needed to terminate. So, they're just a bunch of state transitions and error events. And then there's also an event for outcome processing. So, you just know when Claude is entering this mode of iterating against that outcome rubric. And then finally, we have span events, which are just used to let you know when certain things are starting and ending that we know are going to be long-lasting. So, everybody here has probably experienced Opus 4.7 generating an entire document that's really long. So, we just wanted to make sure that you know when that's starting and ending so that you don't think things are just getting stuck on our end.

So, in addition to those core primitives and the events that I went over, like I mentioned, earlier today we launched self-hosted sandboxes, which allow you to bring your own containers instead of using the ones that we provide. A lot of people already have existing accounts with Cloudflare or Vercel or Modal. And a lot of the time you have your private data up there and you just don't want that to exit your own VPC or your own perimeter. So, to get around that, we are able to connect to those sandboxes natively and use those instead of using the ones that we had on our own end. And then you can configure how those sandboxes operate. At that point that's entirely up to you. We'll just let you know when Claude needs a new sandbox and then that's it. You just spawn one and connect it.

We also launched MCP tunnels, which very similarly allow you, if you have private MCP servers within your private perimeter, you might not want those exposed over the internet. So, we set up a way for you to have a secure tunnel that accesses those MCP servers that you have privately in your own network. And then Claude can directly connect to that safely without those MCP servers ever being exposed on the internet. It's a really nifty way for you to be able to connect more private data sources to Claude and to Claude Managed Agents.

So, that's pretty much all I have for slides. Maybe we'll get back to them a little bit later, but let's actually do some fun stuff. So, I'm going to be working out of this repository. I want to zoom in on the screen a bunch so you guys can see it. It's a public repo if you guys want to go clone it, get started with it today. There's a bunch of really interesting content in here from some of the other workshop presenters. So, highly recommend going through a lot of this. There's a lot of really interesting patterns here. Today we're going to be focused on the production-ready agents. And in this directory I included both a starter version of this web app that I'll be showing you shortly, and then the solution version of it if you want to cheat, skip to the end and just see how things work end to end.

So, what are we actually building here? I built this very contrived deal desk product. You can imagine that we work on some mergers and acquisitions. We have some data available maybe in Linear or maybe in our private data sources. And we want to use Claude in order to help us make decisions on whether or not we should invest or maybe acquire certain companies. I'm going to show you a finished version of this demo. There's nothing particularly fancy here. There's just a very basic chat UI with all of my sessions on the side and some information about the session itself on the right side. But really the main thing is this ongoing conversation between me as an end user and Claude. And the way that we set up this deal desk is to actually use the new multi-agent feature that we launched 2 weeks ago, in order to have various agents with their own personas and their own ways of doing things. So, maybe one agent is in charge of figuring out macro trends in the overall industry that you're working with. Whereas another one is really good at financial analysis. Maybe it has access to a bunch of tools that make it better at that, or a bunch of MCP services it has access to. So, these are all just individual threads that are happening here that our main agent thread kicked off in order to answer a question that we gave it earlier on. All the companies that I've made here are obviously fake and Deal Desk is not a real product, but I'm hoping that you guys build really interesting things with this.

So, let's get started on doing that. We're in this starter directory of this code base and I'm just going to start my server for it so we can test it locally. I'm using Bun because we all love Bun here. And because it's the starter version of this code base, immediately we run into some problems. Something's not implemented. And I did this very intentionally because I wanted to walk us through some of the APIs that we have to use in order to build something like this product. So, very basic at the beginning, we just want to have a sidebar that lists all of the sessions that we have. So, first thing that we ran into is we stubbed out some sort of endpoint for listing all of our sessions. So, obviously that's not going to work. And I'm going to try to implement this function. I haven't written code by hand in a little bit of time. I don't know if you guys have, but please forgive me if this is wrong. client.beta.sessions.list. I guess I have a little bit of a hint off top. Let's copy paste this. And really what am I doing here? I'm using the Anthropic SDK that I've imported. And all of these endpoints are kind of available in production right now. So, I just set up the SDK and I'm calling the list-sessions endpoint within the SDK and just returning that data. Relatively straightforward. And I didn't even have to refresh the page. That's how amazing Bun is. We now have the sessions listed from my workspace.

Next, maybe we want to implement — I wrote a bunch of to-dos that are numbered, but I don't think we should do these in this order. Let's retrieve the session. To-do number four. There we go. And now we have all of the data available here. Really, this is just the API response from get-session. That's really all I'm doing here. You list the agent here. You can see all the tools that it has available. It's connected to the Linear MCP. And maybe we would have had some outcomes defined for it, but we didn't in this case.

Now we want to implement the chat view. This is the more interesting aspect out of all of this. So, there's two aspects to it. There's one — sending session events, which is just a relatively straightforward endpoint that we have. And then the other one is the streaming endpoint, which streams the events that Claude is generating or the session is generating from the server to our client. This one might be a little bit more complicated. So, instead of actually doing this myself, I'm going to be extremely lazy and I'm just going to use Claude here. The really nice thing is that Claude Code ships by default with the Claude API skill, which makes Claude really good at using all of the Anthropic APIs, specifically the managed agents APIs that we have. And that's really all you have to do to make Claude really good at using this thing. So, I'm just going to tell it, "Hey, I have a bunch of to-dos in this code base for using Claude Managed Agents. I think there were some about streaming events and sending events. Look through the to-dos and figure it out. Make no mistakes." We all know that works so well.

So, while Claude is doing this for us, it's going to read through this skill. It's going to learn, all right, this is how the managed agents endpoints work. It might even help me optimize things and make them a little bit better. And yeah, that's pretty much all I had to do to set up this demo. Literally when I was setting up this demo, I did a version of what I'm doing right now on this stage, where I just asked Claude to help me with building this thing, which is really nice. It means that Claude can help you build your own Claude. While this is really interesting and we can sit here and watch Claude process things all day long, we know Opus is a little bit slow. So, while Claude is doing all of this, I wanted to quickly go over some of the docs and APIs that we have available today for Claude Managed Agents.

So, this is our official developer documentation. I know nobody really reads docs these days. Everybody just points Claude at them, but I wanted to make sure that everybody here knows that these are available. We have a bunch of endpoints for each of the primitives that I defined earlier, for creating an agent and updating it and fetching it and everything. Same thing for our environments. And same thing for sessions as well. Including a bunch of sub-endpoints for listing all the events in a session or streaming those. You can also list all of the uploaded resources in that session. So, if you included a file in your container or you included a GitHub repository, you can list those and add those over time to make sure that your session really stays alive. And then with multi-agent, Claude can spin off individual threads of other agents, kind of like what I showed earlier. So, there's a bunch of endpoints that are associated with that as well. And then finally, there's a bunch of endpoints for credential vaults and for memory stores. Credential vaults allow you to provision a bunch of MCP servers' authentication tokens one time, store them very securely within Anthropic. And we will make sure that whenever Claude wants to use one of the MCP servers, like the Linear MCP or the Figma MCP, we will inject those authentication tokens if you include that vault in your session, without Claude ever seeing what those tokens are. So, we make sure that it never enters Claude's context window or anything like that, and makes the whole thing a lot more secure. With memory stores, we give Claude access to one or several memory stores that it can then read and write memories from over time, so that every session that it interacts with can read from those previous memories and get better than the one before. And we use all of these things within this demo that I've been working on.

Let's see how Claude is doing. Why would you not implement the rest of these? Finish the rest. Claude sometimes gets a little lazy. Anyway, there's a bunch of APIs here. I highly recommend you read through these. I highly recommend you read through some of our more long-form docs on Claude Managed Agents as well. They do a great job of outlining all of this stuff. But beyond just reading the static information, you can also really use the Claude console to monitor and get better observability around what each of these sessions is doing, and use a lot of this UI for driving what your managed agents integration looks like. If you just want to get started really quickly, you want a more guided experience, we built this quick start that allows you to actually have a chat with Claude and Claude will help you build your agents and your sessions with you. You also have a bunch of predefined templates that you can use as a starting point. Here you can go browse to the actual agents that you have. So, here I have a bunch of test ones. Clearly I made a bunch of these. And you can actually see what each one looks like. Agents are versioned, so if you ever feel like you made an update that you're not happy with to the system prompt or the list of tools that it has access to, you can always go back to use a previous version, and we never get rid of that. And this is where you see the certain things that it has configured. So, in this instance, I configured it with a Linear MCP. I didn't give it any skills, but I gave it access to a bunch of other agents that it can interact with, and we'll see shortly what that looks like in our sessions.

Do we think Claude finished yet? Claude says it's done. We'll see about that. Okay, sweet. Refreshing the page. Looks a little awkward with the zoomed-in screen, but generally speaking, it seems like we can go and create new sessions. Everything here looks good. I'm seeing all of my events. Everything looks pretty good. So, let's actually run this thing. We're going to create a new session. In this instance, I want to use the Linear MCP, and I want to use memory stores for this demo. And this is just calling our create-session endpoint. And here I stubbed out a couple of suggestion chips for myself for this demo. One is just a regular message, like "give me a quick read on Acme Robotics," in order to get information about their financials. But that's kind of boring. What I really want to show you is outcomes. So, I have this other suggestion chip that I set up that includes a bunch of information about, "hey, there's like three companies that we're looking at, Bridgewell Dynamics, Norwood Automation, and Acme Robotics. We have a bunch of data about them all over Linear and some files that we uploaded. But we really want to make a good decision here. So, can you please iterate on finding information about it and then criticize your own work and let us know whether or not these findings that you're saying are actually satisfied to the rubric that we gave you." So, let's use that. All I did was just send an outcome definition event. And now Claude is off to the races. It's going to start using a bunch of tools. It's going to try to delegate to a bunch of other sub-agents. And maybe read some of the files that we have uploaded.

But this is nice and dandy. I feel like I am not understanding what's going on under the hood here. So, maybe we can go and monitor what the session is doing live. To do that, we can go to the sessions view for this agent and actually click into a running session and see the model processing things live. So, it looks like it's already spawned the four other agents that we wanted it to work with. And each one of those has their own context windows and they can chat with their coordinator and give it updates as they're coming along. So, they might say like, "Hey, I found this in the financials, or maybe I looked this up on the internet. You should know about this." And maybe give another agent that information. So, you're going to see each one of these horizontal lines is an independent agent that's running on its own. And then here you can take a peek at individual events that are happening. So, I guess this agent is doing some web searches. You can see the actual inputs and outputs from those web searches. And then yeah, these things are all iterating with one another. You can also monitor how long these things are taking. So, if you find that a tool call of yours is taking a particularly long period of time, you can also go and debug that and say, "Okay, maybe there's a file that is really inefficient."

I see you have a question. The question was, can you put plugins into these agents? We're working on something along the lines of that. We want to make sure that the Claude ecosystem all cohesively makes sense. So, we have started thinking about what these things look like to make things a lot more extensible and open-ended. We don't have anything quite yet, but the agent definitions themselves kind of operate like these plugins. There's a lot of similar ideas behind a lot of them. So, we're going to have something there soon. Good question.

Anyway, that's the main console view that we have. You have a bunch of other tabs for the environments that you create. If you created a self-hosted environment, you can see those here. Or the credential vaults that I mentioned earlier. And then really what I love doing is going and reading through these memory stores because you'll see what Claude is filling in as information for itself. And sometimes I want to just edit that information if I feel like it got something wrong. Sometimes Claude messes up. Or you can generate and add your own memories by default.

So, that's it for this demo. At the end of all of this Claude is probably going to have something like an outcome event where it said, "Okay, yeah, I feel like I have enough information for you about these individual agents." And then it gave me some sort of outcome evaluation. It seemed like it was able to get to a conclusion for the things that I asked it to evaluate.

Getting back to the slideshow. If we were to do all of this by ourselves, we would have had to build our own agent loop or maybe use the Agent SDK, figure out a way to host it somewhere remote, figure out things like context management and handling state transitions and recovery from those state transitions, or integrating something like skills and MCP servers. We would have had to figure out a durable storage layer where you can store all of the events and all of the data about all of your agents or all of your threads. We would have had to figure out a sandboxing fleet, like using something like Cloudflare, but figuring out how to make that react to what Claude is doing. And then we would have had to figure out the world of end-user authentication, which is not easy to figure out or do in a secure and reliable way. So, all those things are things that we would have had to build by ourselves if we were to get started on it today. With Claude Managed Agents, we were able to get all of these things out of the box. We didn't use all of these primitives immediately in this demo, but if we wanted to, we could have. It would have been a very complex looking demo, but that would have been it. Anyway, that's all I have. We finished a little bit early, but if anybody has any questions, I'm happy to answer them.

Feedback / ReportSpotted an issue or have an improvement idea?