Decoupling the Brain from the Hands: Claude Managed Agents (Part 1 of 4) — Anthropic

AI Engineer · 17 min · 195 sentences · from YouTube's caption track

Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.

  1. 00:12Thank you very much to everyone who joined.
  2. 00:15I think we'll start, since we have a full hall.
  3. 00:19Hello everyone.
  4. 00:20My name is Priyanka.
  5. 00:22I am a technical employee at Anthropic.
  6. 00:25I lead the engineering team that built Claude Managed Agents, and I'm excited to be here to chat with you and help you launch your first Managed Agent.
  7. 00:34I've been at Anthropic for a little over two years, and for the last 12 months I've been focused on building out the agent infrastructure, and I hope to share our learnings with you.
  8. 00:44Congratulations.
  9. 00:44My name is Gabe Semack.
  10. 00:46I am a technical fellow building Claude managed agents on Priyanka's team.
  11. 00:51I've been at Anthropic for a little over a year and have been working on this project almost all that time.
  12. 00:58OK.
  13. 00:58So, here is our agenda.
  14. 01:02We'll start with a history of how we built and scaled managed agents, as well as some of the pitfalls and lessons we learned along the way.
  15. 01:12Then we will move on to the practical part of the seminar.
  16. 01:16In the first part, we will create a very simple agent using the Claude platform console.
  17. 01:22You will not write any code during this part.
  18. 01:25We'll just try to create our first agent using the prompts and test it.
  19. 01:29Then I'll hand it over to Gabe to walk you through the practical part.
  20. 01:33We'll be writing code using Claude Coder, your favorite agent for programming, and then building a more complex financial agent, after which we'll have plenty of time at the end for questions and answers.
  21. 01:42We have a two-hour slot.
  22. 01:44I know it's divided into four parts, but it's essentially one long presentation.
  23. 01:49I hope it doesn't take all two hours.
  24. 01:51We want it to be quite interactive.
  25. 01:53So if you have any questions, raise your hand.
  26. 01:56We have a few people nearby who can come up to you and give you a microphone for a question, especially when we get to the practical part.
  27. 02:04Okay, let's get started.
  28. 02:06So, I'll start with the basics.
  29. 02:08Let's start with what is an agent or what makes an agent work?
  30. 02:13An agent is essentially a model in a loop with tools.
  31. 02:19You will see on the left a model that makes a decision, performs the next action, and calls tools in a loop until your task is completed.
  32. 02:26This is essentially the simplest definition of what an agent is.
  33. 02:33Yes.
  34. 02:44Link to the presentation?
  35. 02:46We can try...
  36. 02:48We can share it when it's finished.
  37. 02:50Yes, we will share it when it is finished.
  38. 02:53It will be difficult for us to provide this now, but we will be happy to answer questions and share the presentation at the end.
  39. 02:59Do you have difficulty seeing slides from the back rows?
  40. 03:02Good.
  41. 03:03Sorry about that.
  42. 03:04Um, okay.
  43. 03:05The next thing I wanted to talk about is what a “harness” is .
  44. 03:09Harness is usually a layer that wraps around the model and helps execute tool calls in a loop to achieve the result of your current task.
  45. 03:18It makes assumptions about what the model cannot do and tries to fill in those gaps.
  46. 03:24So, it works in a loop, making tool calls, managing context, and encapsulating anything the model can't do on its own.
  47. 03:31A good example is our Sonnet 3.5 model, which had what we called “ contextual alerting .”
  48. 03:38So whenever Sonnet 3.5 sensed that you were approaching the context limit, it tried to complete the task very quickly.
  49. 03:45So when creating a wrapper around Sonnet 3.5, you added something like context reset to get around this limitation.
  50. 03:53But with the next model, like Opus 3.5, there was no such limitation, and you didn't need to do such a context reset for it.
  51. 04:02So when you build a wrapper, you want to encapsulate all these assumptions for different models and keep up with each new model, so building a good wrapper is very important, and that's what we tried to do with Cloud Managed Agents.
  52. 04:16And lastly : you want your agent to have access to a sandbox or computer.
  53. 04:22Essentially, this is where he will run the code he writes to perform the task.
  54. 04:26Typically, you provide access to a cloud sandbox or container where it executes the written code.
  55. 04:32It can edit files, install dependencies, etc. Cloud Code is a great example of this.
  56. 04:37This is a wrapper running locally on your computer, accessing your files and executing them, updating them in the process.
  57. 04:45He also writes code that is unreliable.
  58. 04:48It can be buggy, so when deploying product agents you want to make sure the code they write is sandboxed and confined to the container.
  59. 04:58You also need to keep your sandbox isolated and your attack radius limited.
  60. 05:03Therefore, you typically want to run each task in a separate container to avoid mixing data and increasing the impact radius for your tasks.
  61. 05:13Next, I'll tell you about the first architecture on which we actually built managed agents.
  62. 05:19It was last December when we delivered the first architecture to our early access customers, got a ton of feedback, and then moved on to the new architecture.
  63. 05:28So I'll tell you about some of the pitfalls and problems we faced in the first version.
  64. 05:35In the first architecture, we placed everything in a container.
  65. 05:39So, we had a session log with everything that happened during that session.
  66. 05:43This session is essentially your unit of work.
  67. 05:47The harness also worked inside the container , and the sandbox execution also happened inside the container .
  68. 05:54The advantage was that since everything was in a container, there was no need to design service boundaries.
  69. 05:59Everything was local, easy to edit, and editing files felt like system calls.
  70. 06:05But it so happened that we realized: we had a " pet."
  71. 06:11If you haven't heard the analogy of "pets " and "livestock" from the old infrastructure days, a " pet" is when you have a named entity that you manually care for.
  72. 06:22When he is sick, you must nurse him back to life.
  73. 06:26You simply cannot afford to lose it.
  74. 06:28And "livestock" is something more interchangeable, disposable.
  75. 06:31When one unit fails, you replace it with another and keep going .
  76. 06:35A good example: imagine you have a single database layer.
  77. 06:38If it falls, your product doesn't work—it's your "favorite."
  78. 06:41But imagine that you have master- replica replication set up.
  79. 06:43The master falls and you can pick up the replica.
  80. 06:45That's what "cattle" is, right?
  81. 06:47You have many instances, one fails—it's not a problem, you can restore it.
  82. 06:51So, our initial setup was essentially a " pet" setup.
  83. 06:56There were several problems with this.
  84. 06:58Debugging was very difficult because everything was running in a container.
  85. 07:01We didn't know what exactly was causing the problem.
  86. 07:04A lost packet or a stopped container looked almost the same, and we had to connect via WebSocket to the container for debugging.
  87. 07:13Another problem was that the investigation was difficult because these containers stored customer data.
  88. 07:20So we essentially had no way to get inside for debugging.
  89. 07:24This was another issue we discovered during Early Access.
  90. 07:28And lastly, if a customer wanted us to connect to, say, an MCP in their VPC, that meant peering the networks or sending them our harness to run on their own.
  91. 07:38So, there were a lot of problems with that architecture that we couldn't find a really good solution for.
  92. 07:45So we decided that we wanted to essentially separate the "brain" from the "hands," and I'll explain what that means.
  93. 07:53The agent essentially turned into three separate interfaces.
  94. 07:57On the left you have the session—this is essentially a log just for adding everything that has happened in the session up to that point.
  95. 08:04In the middle is the "brain", which is your framework or agent cycle along with Claude.
  96. 08:09And on the right—" hands."
  97. 08:10That is, sandboxes, your MCP tool challenges, etc. They are created on request, disappear when you're done , and if you lose the sandbox, you just start it again.
  98. 08:22So each component became interchangeable and " non-unique".
  99. 08:26When the sandbox "died" , the framework or Claude could just start it again, right?
  100. 08:31The error returned to Claude, and for him the sandbox was essentially the same tool as any other.
  101. 08:36If the tool call fails, the sandbox "crashes" and it decides what to do: run it again or move on.
  102. 08:44When the framework "crashed", you could start a new instance and continue where you left off, simply by reading the session event log.
  103. 08:53Work resumes from the last event as if nothing had happened.
  104. 08:58Nothing happened.
  105. 08:58The only thing we were protecting here was your session log.
  106. 09:02Everything else was interchangeable: it could fail and be easily repaired.
  107. 09:07Another thing we did was to ensure that account data never entered our sandbox.
  108. 09:11In our previous system, your data was sandboxed, so you were more vulnerable to prompt injections.
  109. 09:20We changed it this way: if the sandbox needed to access something that required a token or access control, the request went through a proxy that appended your token before calling the external
  110. 09:31endpoint or MCP.
  111. 09:34This way, the model never sees your credentials or tokens, so you can't force Claude through prompt injection to say, for example, " Give me your tokens ."
  112. 09:42Either display the tokens on the screen or write them to a file.
  113. 09:45You will never be able to do this because Claude never actually sees your tokens.
  114. 09:51Because we had an append-only event log, our data compaction strategy remained flexible.
  115. 09:57So, nothing is ever deleted.
  116. 10:00We do not compress or change your flow of events.
  117. 10:03We always store every event that happens, and the compression strategy decides, “Oh, do I want to go through the entire event log, summarize it, and add context?
  118. 10:13Do I want to review only the last n events and add them to the context?
  119. 10:17So, thanks to the interface design we chose, we could have a more flexible context strategy.
  120. 10:24And another benefit we noticed: because we could start the logical inference calls immediately, we were able to reduce the time to the first token by about 90%.
  121. 10:33So Claude only started the sandbox when needed, and didn't wait for the container or sandbox to be deployed for you to get your first token.
  122. 10:41So thanks to this architectural change, we were able to get a much faster and more responsive system.
  123. 10:47And here is an illustration of how one "brain" can control many " hands."
  124. 10:55Your loopback agent system can now access a container in the sandbox, a customer's VPC, or an MCP server.
  125. 11:03So all these "arms" are essentially interchangeable, you can connect many of them, which made our architecture much more flexible.
  126. 11:12If you remember only one thing, let it be that systems contain assumptions, and assumptions can become outdated.
  127. 11:21So we designed interfaces that would survive these assumptions and made the architecture more flexible.
  128. 11:28This allowed us, as I said, to change the compression strategy, to completely replace the system, but the interface and architecture remain the same, and we can work with it in a more modular way.
  129. 11:44Okay, now we'll move on to the practical part.
  130. 11:49We've prepared free API credits for you to help you build with us today, so please scan the QR code, log in to your Cloud Platform account or create a new one, and you can get those credits to build with me and then with Gabe.
  131. 12:06And I'll leave that for a moment.
  132. 12:10Greetings.
  133. 12:12Excuse me, what?
  134. 12:15Last slide.
  135. 12:19That's actually what we were talking about here , right?
  136. 12:27These are kind of the three interfaces that we designed the system for, right?
  137. 12:33The first question was what interfaces did we develop to keep the system relevant despite the changes?
  138. 12:40So we have a session log just for appending, there's a framework that can be replaced again, and tools where you can plug in a sandbox, tool calls, or anything that the model might need access to— this makes the system more versatile and extensible.
  139. 12:57Okay, back to the credits.
  140. 13:01Does anyone else need to scan this before we start?
  141. 13:05Okay, I still see a few phones.
  142. 13:07Okay, I'll give everyone about 30 seconds.
  143. 13:10Thank you for your patience.
  144. 13:12Oh, are there any problems with the internet?
  145. 13:18Oh no. Gabe, do we have a microphone?
  146. 13:27Because I can't hear some questions.
  147. 13:37Yes, the credits should arrive as soon as you sign up, hopefully within a minute or two.
  148. 13:42We are now taking the microphone so that we can walk around the hall and answer these questions.
  149. 13:48But I'll show you how to create a very simple agent that tells jokes.
  150. 13:57I'll first talk about our core APIs and concepts, and then we'll go to platform.anthropic.com to create your first agent.
  151. 14:06Our first step is to create an API for environments (V1 environments), which helps create an environment or template for your sandbox.
  152. 14:15Here you will find your network settings.
  153. 14:18Do you want unlimited network access or do you want to limit it to specific domains or MCPs?
  154. 14:24You can specify which packages should be installed in your container or " sandbox".
  155. 14:29So, this will be our first step in setting up the environment.
  156. 14:34Next, you create an agent.
  157. 14:37An agent is essentially an object that can be given a name.
  158. 14:41In this case, we will call him a "joker."
  159. 14:44We will choose the model you want to use for this agent.
  160. 14:48You can use Opus, Haiku, or Sonnet—your choice.
  161. 14:53After that, we will provide the agent with a system prompt.
  162. 14:57In this case, we would say: "You're a comedian, find a fresh joke on a given topic and tell it well."
  163. 15:03Then you can give that agent tools.
  164. 15:05We will provide him with the agent toolkit, which is our basic set.
  165. 15:10It's like your bash toolkit: read, write, grep, etc. Almost all agents will need this.
  166. 15:16This will be your second step.
  167. 15:19The third step will finally be to create a session.
  168. 15:22So , the session takes the agent ID and the environment ID and creates the session.
  169. 15:26This is your task, i.e., a unit of work or your assignment.
  170. 15:29And when the session is initialized , it is in standby mode.
  171. 15:33No work has been done yet, right?
  172. 15:35Until you send the event.
  173. 15:37And this is what the flow of events in your session will look like .
  174. 15:43You will have events that you send, as well as events that the agent will respond to you with.
  175. 15:47On the left you will see user.message.
  176. 15:49You can say, "Tell me a joke about distributed systems ."
  177. 15:52And then the agent will answer you with a funny joke.
  178. 15:55You can use what is called a custom tool.
  179. 15:57A tool essentially allows you to define the tool you want to use to handle how you respond to it.
  180. 16:03And Claude will essentially add a custom tool usage event to your event stream, which you can track, process, and return the result to Claude as a custom tool result.
  181. 16:14And there are a few other examples of the types of events you might see.
  182. 16:18So, you will see session.
  183. 16:20error if your session ever throws or encounters an error.
  184. 16:23Idle status is when your session is idle and not working.
  185. 16:26This usually happens when you're not actually using the sandbox.
  186. 16:29And interrupt on the left is when you want to stop or interrupt the session and no longer want to continue working.
  187. 16:36This is kind of our complete list of features.
  188. 16:39Maybe if there's time at the end , Gabe can come back to it and dig deeper into the topic, but Gabe will work with you on his part of the workshop, looking more closely at
  189. 16:47concepts like multi-agency and memory, which we also provide.
  190. 16:51A. Okay.
  191. 16:53Before we get to that, we'll now go to platform.claude.com.
  192. 16:59I hope you can use your API credits and see them now.
  193. 17:03If not, Travis walks around with a microphone, so you can reach out to him if you have any questions or need help.
  194. 17:10And if you go to your console, in the agent management section you will see something called "quick start".
  195. 17:17This is kind of our guide on how to create your first agent.