Volver a PodcastsClaude
Publica tu primer Managed Agent
All right.
Muy bien.
Hello everyone.
Hola a todos.
It's great to see you all here today for our session on shipping your first manage agent.
Es un placer verlos aquí hoy para nuestra sesión sobre cómo lanzar tu primer Managed Agent.
Let's go ahead and get started.
Vamos a empezar.
My name is Isabella He.
Me llamo Isabella He.
I'm a member of technical staff at Anthropic on the Applied AI team.
Soy miembro del equipo técnico de Anthropic, en el equipo de Applied AI.
The Applied AI team at Anthropic sits at the intersection of products, research, and our customers, which means that I get to contribute internally to products at Anthropic like Claude code and our Claude harnesses, as well as work externally with our customers that are building on top of Claude and on top of our harnesses.
El equipo de Applied AI en Anthropic trabaja en la intersección entre productos, investigación y nuestros clientes, lo que me permite contribuir internamente a productos de Anthropic como Claude Code y nuestros harnesses de Claude, así como trabajar externamente con clientes que construyen sobre Claude y sobre nuestros harnesses.
So, my goal today is to get you all hands-on with actually building on top of manage agents, understanding how the harness works under the hood, and getting you ready to actually ship your first incident response management.
Mi objetivo hoy es que todos ustedes puedan trabajar de forma práctica construyendo sobre Managed Agents, entender cómo funciona el harness por dentro, y estar listos para lanzar su primer agente de respuesta a incidentes.
So, the quick overview of today's agenda.
Un resumen rápido de la agenda de hoy.
We're going to cover first a quick refresher of Claude manage agents.
Primero vamos a ver un repaso rápido de Claude Managed Agents.
I want to talk you through a little bit about how this harness works under the hood and what makes it so special.
Quiero explicarles un poco cómo funciona este harness por dentro y qué lo hace tan especial.
Our team put a lot of thought into the architectural design of Claude manage agents to make sure that it runs ready and reliably for production-ready agents.
Nuestro equipo pensó mucho en el diseño arquitectónico de Claude Managed Agents para asegurarse de que sea robusto y confiable para agentes listos para producción.
So, I want to talk you through a little bit of how that works so that then when we transition to the second portion here, which is the hands-on workshop, you'll actually understand what each of the primitives you're building actually mean for your agents under the hood.
Quiero contarles un poco cómo funciona eso, para que cuando pasemos a la segunda parte, el taller práctico, entiendan qué significa cada uno de los primitivos que están construyendo para sus agentes por dentro.
So, for the majority of today's session, I want you all to actually have your laptops open, building alongside me, actually working inside of a repository, and getting you ready to actually spin up a working incident response agent.
La mayor parte de la sesión de hoy quiero que todos tengan sus laptops abiertas, construyendo junto a mí, trabajando dentro de un repositorio, y listos para levantar un agente de respuesta a incidentes que funcione.
Lastly, we'll talk a little bit about beyond the basics.
Por último, hablaremos un poco sobre más allá de lo básico.
Today's session is the first session of a couple of other ones that will build on top of this on Claude manage agents.
La sesión de hoy es la primera de varias que se irán construyendo sobre esta, sobre Claude Managed Agents.
Specifically, right after this one, I think there's another session on dreaming, which is one of my favorite new features with Claude manage agents for self-improving agents and memory built into the harness.
Específicamente, justo después de esta creo que hay otra sesión sobre dreaming, que es una de mis nuevas funciones favoritas de Claude Managed Agents para agentes que se mejoran a sí mismos y para memoria integrada en el harness.
So, encourage everyone to dive in a little bit deeper into what else is in the box after we set you all up for success today with a quick introduction.
Así que los animo a profundizar un poco más en lo que hay disponible una vez que los dejemos a todos bien encaminados hoy con esta introducción rápida.
So, let's first touch a little bit about how we got here with Claude manage agents.
Primero veamos un poco cómo llegamos hasta aquí con Claude Managed Agents.
When we first released the very first Claude back in 2023, we released a messages API alongside access to Claude.
Cuando lanzamos el primer Claude en 2023, lanzamos la Messages API junto con el acceso a Claude.
This provided raw model access to all Claude models.
Esto dio acceso directo al modelo a todos los modelos de Claude.
This became the very first way that people could programmatically build on top of Claude and essentially gave a way for people to access tokens in and tokens out via our Claude models.
Esta fue la primera forma en que la gente pudo construir sobre Claude de manera programática y básicamente dio acceso a tokens de entrada y salida a través de nuestros modelos de Claude.
This also meant that for everyone building on top of Claude models, they had to implement all the various primitives themselves.
Esto también significó que todos los que construían sobre los modelos de Claude tenían que implementar todos los primitivos por sí mismos.
Things like context management, the actual agent loop, compaction, etc.
Cosas como gestión de contexto, el loop del agente, compactación, etcétera.
All the primitives that come alongside making the agent work.
Todos los primitivos que van junto con hacer funcionar al agente.
When models were less intelligent back in the early days of let's say 2023, some of these primitives were much simpler because agents could simply do less.
Cuando los modelos eran menos inteligentes en los primeros tiempos, digamos 2023, algunos de estos primitivos eran mucho más simples porque los agentes simplemente podían hacer menos.
But, as we evolved into now with higher model intelligence and as agents are able to take on more complex tasks and actually take actions within environments and come to actually do entire tasks for humans, the primitives that come alongside context management and managing an agent's ability to execute API calls and tool calls becomes much more complex.
Pero, a medida que evolucionamos hasta ahora con mayor inteligencia en los modelos y a medida que los agentes pueden asumir tareas más complejas, tomar acciones dentro de entornos y llegar a completar tareas enteras para los humanos, los primitivos relacionados con la gestión de contexto y la gestión de la capacidad del agente para ejecutar llamadas a la API y a herramientas se vuelven mucho más complejos.
So, that's when we moved to the agent SDK, which became a harness that allows you to programmatically call Claude code, one of our agents at Anthropic.
Entonces fue cuando pasamos al Agent SDK, que se convirtió en un harness que te permite llamar programáticamente a Claude Code, uno de nuestros agentes en Anthropic.
So, Claude code is something that an agent has access to a computer and takes actions within file system.
Claude Code es un agente que tiene acceso a una computadora y toma acciones dentro del sistema de archivos.
So, the agent SDK became a way for you to make Claude much more powerful by leveraging the power of Claude code within a harness.
El Agent SDK se convirtió en una forma de hacer a Claude mucho más poderoso aprovechando la capacidad de Claude Code dentro de un harness.
The main thing here though is that with the agent SDK, developers still had to manage hosting and scaling on their own and making sure that the agent SDK would be safe to run within their containers.
Lo importante aquí es que con el Agent SDK, los desarrolladores aún tenían que gestionar el hosting y el escalado por su cuenta, y asegurarse de que el Agent SDK fuera seguro para ejecutarse dentro de sus contenedores.
That's only then evolved into Claude managed agents, which is the first harness to be able to handle scaling and production ready components for you by Anthropic, providing things like a purpose-built harness, sandboxing, observability, tool runtime, all within a managed infrastructure system.
Eso evolucionó hacia Claude Managed Agents, el primer harness capaz de gestionar el escalado y los componentes listos para producción por ti, mediante Anthropic, ofreciendo cosas como un harness con propósito específico, sandboxing, observabilidad, runtime de herramientas, todo dentro de un sistema de infraestructura gestionada.
This means that developers can focus on task and agent configuration, custom tool logic, the things that actually matter for bringing domain expertise and customizability to your agents, where you're handing off the rest of all the primitives and core compute and primitives of essentially managing the basics of agent running to Anthropic.
Esto significa que los desarrolladores pueden concentrarse en la configuración de tareas y agentes, la lógica de herramientas personalizadas, las cosas que realmente importan para aportar experiencia en el dominio y personalización a tus agentes, delegando el resto de los primitivos y el cómputo central a Anthropic.
So, that brings me to managed agents as the fastest way to build production ready agents on Claude.
Eso me lleva a Managed Agents como la forma más rápida de construir agentes listos para producción en Claude.
We've seen people build 10 to 15 times faster to production with Claude managed agents by leveraging our purpose-built harness.
Hemos visto a personas construir de 10 a 15 veces más rápido hacia producción con Claude Managed Agents aprovechando nuestro harness con propósito específico.
Part of the reason why we built Claude managed agents is because is because harnesses should evolve alongside your agents.
Parte de la razón por la que construimos Claude Managed Agents es porque los harnesses deben evolucionar junto con los agentes.
For example, back when we were building ourselves on top of models like Sonnet 4.5, we noticed that Sonnet 4.5 emitted a particular behavior called context anxiety.
Por ejemplo, cuando nosotros mismos estábamos construyendo sobre modelos como Sonnet 4.5, notamos que Sonnet 4.5 exhibía un comportamiento particular llamado ansiedad de contexto.
This meant that with Sonnet 4.5, Claude started wrapping up tasks early even when it still had room to spare in its context window.
Esto significaba que con Sonnet 4.5, Claude empezaba a cerrar tareas antes de tiempo incluso cuando aún tenía espacio en su ventana de contexto.
To manage that in our harness, we then added some mitigations to combat against this early stopping behavior.
Para gestionar eso en nuestro harness, agregamos algunas mitigaciones para combatir este comportamiento de parada anticipada.
But, when Opus 4.5 then came out, we actually saw this behavior go away, making all that work we had done inside of the harness essentially obsolete because Claude had evolved beyond that behavior that we had built into the harness to manage.
Pero cuando salió Opus 4.5, vimos que ese comportamiento desaparecía, haciendo que todo el trabajo que habíamos hecho dentro del harness quedara prácticamente obsoleto porque Claude había evolucionado más allá del comportamiento que habíamos construido para gestionar.
So, the takeaway there is that it's a lot of work to maintain harnesses and make sure that they actually evolve alongside your agents, which is why with Claude managed agents, we want to make it really easy for Claude and Anthropic to handle all the complexities that come with compaction, caching, things like context anxiety, all these various primitives that come with actually making agent production ready and getting the most out of Claude.
La conclusión es que mantener harnesses y asegurarse de que evolucionen junto con los agentes requiere mucho trabajo, razón por la cual con Claude Managed Agents queremos hacer muy fácil para Claude y Anthropic gestionar todas las complejidades que vienen con la compactación, el caché, cosas como la ansiedad de contexto, todos los primitivos que hacen que un agente esté listo para producción y que saque el máximo provecho de Claude.
So again, you can focus on the tasks, tools, and things that actually matter for building agents on Claude.
Así que de nuevo, puedes concentrarte en las tareas, herramientas y cosas que realmente importan para construir agentes en Claude.
So three primary resources go into building on Claude managed agents.
Hay tres recursos principales para construir en Claude Managed Agents.
First is the agent's endpoint, which is the persona and capabilities.
El primero es el endpoint del agente, que es la persona y las capacidades.
This is the core system prompt that powers your agent.
Este es el system prompt principal que potencia tu agente.
Essentially here, you're defining the model, the MCP servers, the skills, the various components that your agent can actually leverage when it's able to run in that agent loop.
Básicamente aquí defines el modelo, los servidores MCP, las skills, los distintos componentes que tu agente puede aprovechar cuando ejecuta ese loop del agente.
The next is the environments.
Lo siguiente son los entornos.
You can think of this as the hands of the agent, where the previous one is the brain of the agent where the agent is thinking through what to execute, and then it's using an environment to actually have a space and a container to actually take action on your behalf.
Puedes pensar en esto como las manos del agente, donde el anterior es el cerebro del agente que piensa qué ejecutar, y luego usa un entorno para tener un espacio y un contenedor para tomar acciones en tu nombre.
Sessions are next the way to tie together agents and environments.
Las sesiones son lo siguiente, la forma de vincular agentes y entornos.
A single session has a spun up on an agent instance within an environment.
Una sola sesión se levanta sobre una instancia de agente dentro de un entorno.
So you can connect the two together and actually stream events back to your user and start to take action on behalf of your humans as part of a Claude powered agent.
Puedes conectar los dos y transmitir eventos de vuelta al usuario, y empezar a tomar acciones en nombre de los humanos como parte de un agente impulsado por Claude.
A key thing here, as I alluded to briefly before, Claude managed agent has the agent loop run server side.
Un punto clave aquí, como mencioné brevemente antes, en Claude Managed Agents el loop del agente se ejecuta del lado del servidor.
This means that a lot of the complexities that come with managing hosting and scaling are abstracted away.
Esto significa que muchas de las complejidades relacionadas con el hosting y el escalado quedan abstraídas.
And when you close your laptop or you hit hard refresh on your agent that you're building on Claude managed agents, everything is maintained and you don't have to worry about durability, reliability, all these various aspects that usually come to bite you when you're trying to turn your agent from a prototype into production.
Y cuando cierras tu laptop o haces hard refresh en el agente que estás construyendo en Claude Managed Agents, todo se mantiene y no tienes que preocuparte por la durabilidad, la confiabilidad, todos esos aspectos que suelen ser problemáticos cuando intentas llevar tu agente de prototipo a producción.
And lastly here, before we dive into the hands-on portion, is I want to talk you through a key design decision that went into Claude managed agents.
Y por último aquí, antes de entrar en la parte práctica, quiero explicarles una decisión de diseño clave que se tomó en Claude Managed Agents.
Previously, with a lot of agent harnesses, we saw the agent loop coupled tightly with tool execution.
Anteriormente, en muchos harnesses de agentes, veíamos el loop del agente acoplado estrechamente con la ejecución de herramientas.
This design pattern made sense and still makes sense for some agents because you want to give the agent powerful abilities to actually take action within the environment.
Este patrón de diseño tenía sentido y sigue teniendo sentido para algunos agentes porque quieres darle al agente capacidades poderosas para tomar acciones dentro del entorno.
For instance, with Claude Code, we want the agent to be able to access various files on your computer, take action within a file system, and therefore it makes sense for the agent to have access to all those tools spun up on every container.
Por ejemplo, con Claude Code, queremos que el agente pueda acceder a varios archivos en tu computadora, tomar acciones dentro del sistema de archivos, por lo que tiene sentido que el agente tenga acceso a todas esas herramientas disponibles en cada contenedor.
But, we also realized there are some constraints for this, especially with some agents where you essentially want to be able to decouple the hands from the brains of the agents.
Pero también nos dimos cuenta de que hay algunas restricciones para esto, especialmente con algunos agentes donde esencialmente quieres desacoplar las manos del cerebro del agente.
For instance, credentials and uh credentials and security became a huge concern.
Por ejemplo, las credenciales y la seguridad se convirtieron en una gran preocupación.
With the ability to have the agent access your file system, you can actually add very distinct sandboxing by decoupling these two components, where the agent is no longer able to access the actual credentials without encryption by decoupling the hands from the sandbox of the agent.
Con la capacidad de que el agente acceda a tu sistema de archivos, puedes agregar un sandboxing muy específico desacoplando estos dos componentes, donde el agente ya no puede acceder a las credenciales reales sin cifrado al separar las manos del sandbox del agente.
The other aspect here is actually you can see huge benefits by doing these decoupling on things like time to first token and latency.
El otro aspecto aquí es que al hacer este desacoplamiento puedes ver grandes beneficios en cosas como el tiempo al primer token y la latencia.
Previously, with the agent loop into execution in the same box, you had to spin up containers for every single session that you're spinning up in the agent, which contributed to additional latency from a time to first time to first token perspective.
Antes, con el loop del agente y la ejecución en el mismo contenedor, tenías que levantar contenedores para cada sesión que iniciabas en el agente, lo que contribuía a latencia adicional desde la perspectiva del tiempo al primer token.
But, with this now decoupled, our teams actually saw reductions in time to first token along the lines of over 90% reduction in TTFT for our P95 metrics on latency.
Pero con este desacoplamiento, nuestros equipos vieron reducciones en el tiempo al primer token del orden del 90% en nuestras métricas P95 de latencia.
So, here you can start to see the power of this design decision coming through from the perspective of safety, reliability, latency, and everything else that you care about when it comes to building production-ready agents.
Aquí puedes empezar a ver la potencia de esta decisión de diseño desde la perspectiva de la seguridad, la confiabilidad, la latencia y todo lo demás que te importa al construir agentes listos para producción.
All right, so now it's time for the exciting part of today's session, which is where I want you all to open up your laptops and go to this URL here to actually clone a repository, and let's start to actually feel the magic of everything that I just talked through.
Muy bien, ha llegado el momento de la parte emocionante de la sesión de hoy, donde quiero que todos abran sus laptops y vayan a esta URL aquí para clonar un repositorio, y empecemos a sentir la magia de todo lo que acabo de explicar.
So, I'm going to give everyone a second to just go over to that URL there and just spin up the repository that we have ready for you.
Voy a dar un momento para que todos vayan a esa URL y levanten el repositorio que tenemos listo para ustedes.
All right, so here are some additional commands that I want you all to run to make sure this is all set up on your computers.
Muy bien, aquí hay algunos comandos adicionales que quiero que todos ejecuten para asegurarse de que todo esté configurado en sus computadoras.
So, the first step many of you might have done already, but just take that repository, hit the URL, get clone it, and then I want you to CD into the specific repository for the session, which is ship your first manage agent.
El primer paso muchos de ustedes quizás ya lo hicieron, pero tomen ese repositorio, vayan a la URL, clónenlo, y luego quiero que hagan CD al repositorio específico de la sesión, que es ship your first manage agent.
And then, if you're on Mac, you'll see those two commands on the side, the Python and the source.
Y si están en Mac, verán esos dos comandos al lado, el de Python y el de source.
Um, there's a command there for Windows as well.
Eh, también hay un comando para Windows.
And you'll just do the rest there where you want to install the requirements, copy over the environment key into your .env file.
Y solo harán el resto donde quieren instalar los requisitos, copiar la clave de entorno en su archivo .env.
Um, here you'll put in the Anthropic API key that hopefully all of you also received from the QR code for free credits earlier.
Eh, aquí van a poner la API key de Anthropic que esperamos que todos también hayan recibido del código QR para créditos gratuitos antes.
And lastly, we'll just run the app.
Y por último, solo ejecutaremos la app.
All right, let's go ahead and dive in, but as I mentioned before, let me just show everyone where these instructions are.
Muy bien, vamos a empezar, pero como mencioné antes, déjenme mostrarles dónde están estas instrucciones.
If you go into the repository in the link and then go to ship your first manage agents, you scroll down on the read me, you'll see all the setup instructions here.
Si van al repositorio en el enlace y luego van a ship your first manage agents, se desplazan hacia abajo en el README y verán todas las instrucciones de configuración aquí.
So, feel free to do this, um, as we go along or even in your own time later today and continue playing around with it, but as I mentioned before, everything will be also shown on the screen to follow along with.
Así que siéntanse libres de hacer esto mientras avanzamos o incluso en su propio tiempo más tarde hoy y sigan jugando con ello, pero como mencioné antes, todo también se mostrará en la pantalla para que puedan seguirlo.
So, do not worry if you did not have time to fully get it set up on your laptop.
No se preocupen si no tuvieron tiempo de configurarlo completamente en su laptop.
Without further ado, let's go ahead and dive in.
Sin más preámbulos, vamos a empezar.
So, once you run streamlit run app.py, you should be able to see a URL that looks like this and a page that looks like this.
Una vez que ejecuten streamlit run app.py, deberían ver una URL como esta y una página como esta.
What we're doing here is we're going to be simulating an agent, um, interaction here where we have an incident that's going to come up.
Lo que vamos a hacer aquí es simular una interacción de agente donde vamos a tener un incidente que se presentará.
A lot of you who might be software engineers in the room will be intimately familiar with the pain that comes alongside incident response.
Muchos de ustedes que sean ingenieros de software estarán íntimamente familiarizados con el dolor que viene con la respuesta a incidentes.
If you are software engineer, you might be woken up at, let's say, 3:00 a.m. in the morning, 2:00 a.m. in the morning when you're out around on on vacation as you're on call, and this is usually a very painful portion of a software engineer's life, uh, because when you're on call, it means that if a server goes down or a service goes down, you have to be immediately the one there to respond and tackle the incident.
Si eres ingeniero de software, podrías ser despertado a las 3 de la madrugada, a las 2 de la madrugada cuando estás de vacaciones mientras estás de guardia, y esta es generalmente una parte muy dolorosa de la vida de un ingeniero de software, porque cuando estás de guardia significa que si un servidor cae o un servicio cae, tienes que ser inmediatamente el que responde y resuelve el incidente.
Usually for a human, this means diving into metrics and logs and deployments.
Para un humano, esto generalmente significa sumergirse en métricas, logs y despliegues.
You can actually investigate what's going on.
Puedes investigar exactamente qué está pasando.
And so, what we're going to do is we're going to now have an agent run on Claude manage agents to do all this for us.
Y lo que vamos a hacer es tener un agente ejecutándose en Claude Managed Agents para hacer todo esto por nosotros.
So, that when we get woken up by 3:00 a.m., we can hand it off to an agent, or maybe we don't even get woken up at all if Claude is able to do everything for us.
Para que cuando nos despierten a las 3 de la madrugada, podamos delegárselo a un agente, o quizás ni siquiera nos despertan si Claude puede hacer todo por nosotros.
Okay.
Bien.
So, let's now go ahead and dive into the code here.
Ahora vamos a ver el código aquí.
What we're going to open up here is we have the agent.py file on the left and the agent complete on the right.
Lo que vamos a abrir aquí es el archivo agent.py a la izquierda y el agent complete a la derecha.
If you want to challenge yourself, you can of course try to implement everything yourself here or with Claude.
Si quieres ponerte a prueba, por supuesto puedes intentar implementar todo tú mismo aquí o con Claude.
Um but, what we're going to do just for simplicity's sake is just copy over various elements from the completed file onto the incomplete file one by one.
Pero lo que vamos a hacer, simplemente para ser prácticos, es copiar varios elementos del archivo completado al archivo incompleto, uno a uno.
So, you can see how these primitives compose our agent one piece at a time.
Para que puedas ver cómo estos primitivos componen nuestro agente pieza a pieza.
So, let's go ahead and start off with this very first part, which is the agent.
Así que vamos a empezar con esta primera parte, que es el agente.
We mentioned before that the agent is the one that defines the persona and the capabilities of the agent here.
Mencionamos antes que el agente es el que define la persona y las capacidades del agente aquí.
So, that's model, the system prompts, and the tools in our case for our agent here.
Eso es el modelo, los system prompts y las herramientas en nuestro caso para nuestro agente aquí.
So, let me go ahead and copy over what we see there on the screen.
Voy a copiar lo que vemos en la pantalla.
And you can see here that we're defining the SRE agent.
Y pueden ver aquí que estamos definiendo el agente SRE.
We're going to use Claude Opus 4.7 here.
Vamos a usar Claude Opus 4.7 aquí.
And I've preconfigured a system prompt and tools for the agent.
Y he preconfigurado un system prompt y herramientas para el agente.