Solution Patterns & Playbooks

Managed Agents: Building a Research Agent

A research agent gathers sources, reads them, and writes a synthesis you can trust. The trust part is the hard part — this pattern combines web tools, document citations, and rubric grading to keep the output grounded.

Claude 3P 101 · Updated July 2026 · Unofficial guide

Research is a natural fit for Claude Managed Agents: the work is long-running (many tool calls over minutes to hours), stateful (sources pile up in a filesystem), and benefits from a managed harness with automatic context compaction and prompt caching of repeated history built in. This article assembles a research agent from documented capabilities and adds the guardrails that keep it honest.

Availability: Managed Agents is in beta on the first-party Claude API and Claude Platform on AWS only — not on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. The underlying web tools are also uneven across platforms: web search is absent on Bedrock and only the basic variant exists on Vertex AI; web fetch is absent on both; on Foundry both are beta. If you are Bedrock- or Vertex-committed, plan to supply your own retrieval and pass documents into the Messages API instead.

Gathering: web search, web fetch, and mounted documents

The pre-built toolset agent_toolset_20260401 includes web_search and web_fetch alongside file tools (read, write, grep, glob), so the agent can search, pull pages, and save extracts to its workspace. The current web tool generations (web_search_20260209 / web_fetch_20260209) include dynamic filtering — Claude filters results in code before they reach the context window — which keeps long research sessions from drowning in raw HTML.

For internal material, attach file resources at session creation: files uploaded through the Files API are mounted read-only at a path you choose, up to 999 files per session. The agent's working directory defaults to /workspace, and anything it writes to /mnt/session/outputs/ is automatically captured and downloadable afterwards via the Files API — a clean bridge for the finished report.

If the agent should remember findings across sessions — a running bibliography, previously vetted sources — attach a memory store: a workspace-scoped collection of small text documents, mounted at /mnt/memory/<store-name>/, that persists after the session ends. Every mutation creates an immutable version with an actor record, so you can audit what the agent wrote and when.

Citation synthesis

For the synthesis step, the Messages API's citations feature is the documented grounding mechanism: enable it per document with "citations": {"enabled": true} on document content blocks, and Claude returns claims annotated with cited_text pointing at the exact source passage — character locations for plain text, page locations for PDFs. Cited text does not count toward output tokens, making this cheaper than prompting for verbatim quotes. Two constraints to design around: citations cannot be combined with structured outputs (the request returns a 400 error), and scanned PDFs without extractable text are not citable.

A practical split we recommend: let the Managed Agents session do the gathering and note-taking, then run the final "write the report, cite everything" step as a Messages API call over the collected documents with citations enabled. For retrieval-augmented setups, put each source chunk in its own plain-text document to get sentence-level citations.

Hallucination guardrails

Three layers work well together:

LayerMechanismWhat it catches
GroundingCitations on document blocksClaims with no source passage
Self-checkOutcome with a rubric ("every claim cites a source; no source invented")Drafts that fail your standard — a separate grader model scores each iteration and forces revision, up to a configurable iteration cap
Human gateEditorial review before publicationEverything else — recommended practice, not a platform feature

The outcome mechanism is worth emphasizing: send a user.define_outcome event with a description and required rubric, and the harness runs an iterate → grade → revise loop (default 3 iterations, max 20) with the grader in an independent context window, so it is not anchored on the agent's own reasoning.

Operational notes

Stream results live over the session's server-sent events connection, or poll event history; on reconnect, overlap the stream with a history fetch and dedupe by event ID, since the stream has no replay. Watch span.model_request_end events, which carry token usage for cost tracking — research sessions are long and the meter runs. Finally, note that Managed Agents is stateful server-side and not eligible for Zero Data Retention; delete sessions and uploaded files via the API when your retention policy requires it.

Where to go next

See citations in depth, RAG citation grounding for the non-agent variant, and scheduled agents to run recurring briefings.

Sources