AI Engineer World's Fair 2026
Build a Research Agent with Claude Managed Agents (Part 2 of 4) — Anthropic
Read the talk
Build a Research Agent with Claude Managed Agents (Part 2 of 4)
Priyanka Phatak and Gabe Cemaj build from a console-created joke agent to a research desk that reads SEC filings, delegates analysis, saves memory and grades its own deliverables. The Q&A draws the practical boundaries around credentials, orchestration, shared knowledge and private data.
From a talk by Priyanka Phatak and Gabe Cemaj
At a glance
Ideas worth remembering
A chat interface sends user.message events to a session and relays the API's SSE stream through its backend to the browser.
The Nvidia task produces both a reusable company memory note and a structured scorecard. Specialists return findings; the main agent creates the deliverables.
Outcomes grade session work against a task-specific rubric and permit retries. They do not provide separate subagent outcomes or the per-session spending caps discussed in Q&A.
Vaults substitute real credentials for placeholders at egress only for allowed hosts. Private connectivity can instead use MCP Tunnels or a self-hosted sandbox with internal network access.
Multiple memory stores can accompany a session. Dreaming consolidates transcripts and memories into updated memory; automatic changes to skills, prompts and agent definitions were outside its demonstrated scope.
Create an agent, then give it somewhere to run
A session needs to keep its history without making every new event type a change to the machinery that runs it. Opening this part of the workshop, Anthropic’s Gabe Cemaj explains that the revised storage design separates components and virtualizes interfaces down to the event layer. The purpose is to extend what the system can store without tightly coupling storage to session execution.
Priyanka Phatak then starts with a deliberately small request: “Build me an agent that tells me jokes every time, given a topic.” The console generates a system prompt, name, description and model selection, with access to the agent tool set. Creating the agent saves that definition through the agent endpoint. It does not yet define the sandbox in which the agent will work.
The environment supplies that second piece: a template for the sandbox, including installed packages and network access. This quick demonstration uses unrestricted access; Phatak recommends restricting production access to the required domains or MCP servers. After starting a session, she asks for cat jokes and gets a response. The application-facing model is now simple: start a session, send events and receive events. Anthropic manages the hosting, harness, sandboxes, scaling and event-log storage behind it.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Set up the research desk and its SEC identity
Cemaj’s research desk builds on that foundation in layers: first a chat interface, then SEC-filing skills and specialist subagents, then asynchronous research with structured results. The planned extension is a custom orchestration harness that distributes tickers across separate sessions and aggregates their scores. Recurring work through the deployments API is also introduced as a later step.
The local application starts from the repository’s research desk directory. Install dependencies with npm install or bun i, then run bun run dev and open the setup page. A repository-provided workshop skill guides Claude Code through six acts: workshop start begins the walkthrough, and workshop next advances it. Cemaj asks the coding agent to implement the app while explaining its changes—a useful arrangement when the workshop itself is also being built by an agent.
Setup copies .env.example to .env.local. The developer supplies an API key and an EDGAR identifier containing a name and email, because the SEC requires callers to identify themselves. The coding agent tries to advance too quickly, prompting Cemaj to stop it before continuing. Those prerequisites matter later: the filing-retrieval skill must know both how to call the SEC and which caller identity to use.
Where does the work run? Cemaj describes Anthropic-hosted infrastructure and a Claude Platform offering on AWS. He also distinguishes the sandbox from the managed service: developers can bring a self-hosted sandbox through providers such as Vercel, Modal or Daytona, or run one in Google Cloud or AWS. For this demo, the setup action provisions an environment with access mainly to SEC websites and useful Python packages, plus a basic agent with a prompt and basic tools. Skills and subagent coordination come next.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Build chat by relaying the session event stream
The chat UI is a view over a session’s events. Submitting text sends a user.message event containing the user’s message to the session. The application also listens for the events the agent produces, so the same session supports both incoming instructions and outgoing updates.
What connects the managed session to the browser? The research desk’s backend listens to the API’s server-sent event stream and restreams those events to the frontend, where the UI renders them. This separates session execution from presentation: the backend relays the stream, while the browser decides how to display it. Once the implementation finishes, Cemaj opens the desk tab, says hi and receives a reply.
That is enough for a chat application. The next layer uses the same managed-session foundation for asynchronous work. Cemaj describes tasks lasting hours, days, weeks or months; the financial-research example that follows is a much shorter demonstration of that model.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Add filing expertise, delegation and shared memory
The upgrade adds several distinct capabilities to the agent definition:
- SEC skill. Instructions explain how to use the Python package and supply the EDGAR identity when calling the SEC.
- Specialist subagents. Delegates have their own prompts, tools and permissions.
- Custom dispatch tool. A tool called dispatch analysis receives a schema and prepares the application for coordinating multiple sessions through its own harness.
- Shared memory store. Separate sessions can save and reuse knowledge about financial instruments.
The revised main agent also includes a reference to itself. That permits delegation to another agent with the same prompt when the task does not fit a predefined specialist. The copy includes the prompt, tool descriptions and schemas; it does not inherit the parent session’s transcript. A self-reference therefore reproduces the agent’s configuration, without automatically giving the delegate everything the parent has learned in conversation.
Changing the provisioning code still leaves resources to create. When the expected setup state does not appear, Cemaj discovers an earlier run’s skill, deletes it and asks Claude to reprovision it. The resulting agent has the skill, delegates and memory store needed for the next task. His “cook show” shortcut briefly gets in the way, but the recovery makes the distinction visible: implementation changes and provisioned managed resources are separate steps.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Define completion with a task and a rubric
Research needs a stronger completion condition than an agent saying it is done. Outcomes pair a task with a rubric for evaluating it. The agent performs the work; when it believes it has finished, a grading subagent examines the work against the rubric. A satisfactory result completes the task, while an unsatisfactory result sends it back for another attempt.
The research desk implements this as a user-defined outcome event sent when a ticker analysis starts. It carries the task description, rubric and maximum iterations. This gives the asynchronous session both a requested deliverable and an evaluation standard, with an explicit iteration setting for the self-supervision process.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Trace Nvidia research from memory lookup to deliverables
Cemaj starts an Nvidia analysis, then opens a session from the previous day rather than waiting for the new run, which he estimates will take about ten minutes. The task asks for analysis of the company’s most recent relevant quarterly filing using the supplied EDGAR identity. Before researching, the agent must check memory for earlier analysis and reuse what it already knows.
Completion requires two different artifacts:
- Company memory note. Save knowledge about Nvidia for future sessions.
- Structured scorecard. Write the analysis in the prescribed structured format and save it at a specified file location.
The memory note serves later agent work; the scorecard gives the application a result it can extract and display.
The earlier session finds no notes in memory, checks several places and delegates the research to financial-analysis or extraction expertise and a risk evaluator. How does that delegation become a final result? The console exposes separate subagent threads. Each delegate works on its assignment and returns information to the main agent; the main agent then resumes, combines those results, creates the requested JSON file and updates memory. The specialists contribute findings, while the main agent remains responsible for the deliverables.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Grade the artifacts, then prepare for more tickers
The completed session next starts its grading subagent. What does the grader inspect? It reads the rubric, the session’s work and the generated artifacts, then marks the outcome satisfied: the scorecard was delivered, its numbers were well-defined and the memory update was correct. This is the grader’s judgment in the prior session, rather than an independent validation of the financial analysis; the newly launched run is still in progress during the walkthrough.
Once a session completes, the application can extract and download its scorecard, then store it locally—as this demo does—or put it in a database. Scaling to ten or a hundred tickers introduces a second level of delegation: the proposed server-side harness uses the custom dispatch tool to start a separate session for each ticker and aggregate the results afterward. That is distinct from the specialist subagents collaborating inside one company’s analysis.
Before continuing with orchestration, Cemaj catches a skipped step: updating the SEC skill to handle another form. Skills are live artifacts that can be revised and published; new sessions referencing the skill receive the new information. The demonstrated change concerns future sessions, without establishing that an already-running session adopts the update. Reviewing past sessions can inform those manual skill improvements.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Swap credential placeholders only at allowed destinations
The SEC example supplies a name and email directly in the prompt. Production credentials call for a different mechanism: vaults. A developer defines a secret for an environment variable, but the sandbox receives a placeholder value. When the agent uses that variable in an outgoing request, the service swaps in the real credential at egress only for the host domains permitted for that secret.
Where does the destination restriction take effect? The branching diagram separates the agent’s placeholder-bearing request from the service’s credential substitution. A request to the allowed SEC destination receives the real value; a request to another host, such as anthropic.com in Cemaj’s example, does not trigger the swap. The destination check is part of the egress mechanism, rather than an instruction asking the agent to keep the credential on the right site.
A vault bundles credentials under an ID that the developer attaches to a session. The examples include API credentials for a Google Workspace CLI installed in the sandbox and OAuth credentials for MCP servers, including a Notion example in the console. The session references the vault, and its configured credentials govern authentication and permitted substitution.
Destination-gated credential substitution
Read the diagram as text
- Sandbox request. The environment variable contributes a placeholder value.
- Egress host check. Check the destination against the hosts allowed for this secret.
- Allowed destination. Replace the placeholder with the real credential.
- Other destination. Do not substitute the real credential.
- Sandbox request → Egress host check: Outgoing request with placeholder.
- Egress host check → Allowed destination: Host is allowed.
- Egress host check → Other destination: Host is not allowed.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Understand which controls the managed harness provides
The Agent SDK and Managed Agents offer different operating arrangements. Phatak describes the SDK as a headless Claude Code binary that developers can run wherever they choose. Managed Agents uses its own hosted harness, informed by Claude Code and Agent SDK lessons but rebuilt for more general work. It is not presented as merely the SDK with hosting added.
Hosting does not settle every orchestration policy. Asked whether multiple agents can loop and consume excessive tokens, Cemaj leaves some responsibility with the custom-harness developer. At the time of the workshop, per-session dollar and token caps were being explored but were not offered. The outcome’s maximum-iterations setting therefore should not be read as a general spending limit. A custom harness can also coordinate other providers.
Correction is possible by steering an active session: send another user message, and the system queues it for the agent. Rewinding history and replaying from an earlier point are different capabilities. They were unavailable in this recording; session forking was on the roadmap. The supported intervention adds guidance to the ongoing session rather than creating an alternate history.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Reach private data and prepare reusable environments
The final questions turn to company data and network placement. The access paths depend on where the tools and data can be reached:
- Direct tool access. Expose the required capability through an MCP server and supply authentication through a vault; the discussion also allows CLI access backed by an API.
- MCP Tunnels. Connect the company network to Anthropic’s network without exposing the MCP server to the public internet.
- Self-hosted sandbox. Run a developer-managed sandbox peered with the company network, giving its tools access to internal applications and services.
Environment dependencies are installed at creation time. The service caches that environment and reuses it when reinstantiating the sandbox, so the configured dependencies are prepared before subsequent instances run. The package-installation path described here requires dependencies accessible through registries such as npm, Cargo or pip. Files can also be uploaded directly into a session, or GitHub repositories supplied for installation that way.
The recording ends as an attendee asks about the deployments tab. Recurring scheduled sessions were introduced at the start as a way to keep analysis updating, but their configuration and execution remain for the continuation of the workshop. This part has established the research session’s working pieces: filing access, delegated analysis, saved artifacts, shared memory and a rubric-based completion check.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
Related talks
- Beating RL With Reflection: GEPA and Optimize Anything
Extends the discussion of learning from agent traces into explicit optimization of prompts, programs, repository skills and evaluators.
Read the transcript and explore slides
Loading transcript and slides…