Straight Answer
Claude Managed Agents execute multi-step tasks - tool calls, data retrieval, synthesis - but without external controls, they fail silently. No checkpoint, no validation, no recovery. The value is not in the agent's reasoning. It is in the system you build around it: input validation, persistent state, output verification, structured error handling. These constraints make it production-grade. The agent alone does not.What's Actually Going On
Claude Managed Agents are orchestrated through the Anthropic Agent SDK (claude_agent_sdk). You define an agent via AgentConfig - specifying its model, tools, and instructions - then execute it with agents.run(), which manages a multi-turn loop: the model reasons, selects a tool, receives the result, and continues until the task completes or a stop condition is met.
Within a single run, state is maintained through the conversation turn history - each tool call and response is appended to context. But this state is ephemeral. If the process crashes, the network drops, or a rate limit kills the run mid-execution, that context is gone. There is no built-in checkpointing. Resumption means starting from scratch unless you persist intermediate results yourself.
The second structural issue: non-determinism. Given identical inputs, the model may sequence tool calls differently across runs - fetch before analyse, or the reverse. Downstream logic that assumes a fixed execution order will break intermittently. This is not a bug; it is how probabilistic systems behave. Design for it.
- Where People Get It Wrong Two failure patterns dominate.
First, treating the agent as a deterministic function. Teams send input, receive output, and assume success. But a probabilistic system does not guarantee consistent action ordering, output structure, or even task completion. More complex prompts do not fix this - they increase surface area for error.
Second, no observability into intermediate steps. The agent might call the wrong tool, hallucinate a parameter, or silently skip a step. Without logging each tool invocation and validating each intermediate result, you only discover failure when the final output is wrong - or worse, when it looks right but is not.
- What Works in Practice Four controls make the difference.
Schema-validated I/O. Define Pydantic models (or JSON Schema equivalents) for every tool's input and output. The agent's final output is validated against a response schema before it leaves your system. Malformed results are rejected, not passed downstream.
External state persistence. After each tool call completes, checkpoint the result to durable storage - a database row, an S3 object, a Redis entry. If the run fails at step 4 of 7, your orchestration layer can reconstruct context from checkpoints and resume from step 4, not step 1.
Bounded retries with escalation. Wrap your agents.run() call in retry logic with exponential backoff. Set a retry ceiling (e.g., 3 attempts). If the agent fails after exhausting retries, escalate - route to a human queue, trigger an incident alert, or fall back to a deterministic code path. No infinite loops.
Step-level observability. Log every tool call: tool name, input parameters, output, latency, success/failure. Expose these through your existing observability stack. When something breaks at 2 AM, you need to see exactly which tool call failed and what the model was trying to do.
- Practical Example A finance team automates monthly reconciliation reports using a Claude Managed Agent.
The AgentConfig defines three tools: fetch_transactions (pulls from the ledger API), cross_reference (matches against bank statements), and generate_report (produces the summary). Each tool function validates its own inputs and returns structured Pydantic objects.
The orchestration layer wraps agents.run() with checkpoint logic: after each tool call completes, the result is written to a Postgres table keyed by run_id and step_number. If the run fails mid-execution - network timeout on the bank API, rate limit on the model - the recovery path loads existing checkpoints, reconstructs the conversation context, and resumes from the last successful step.
The final report output is validated against a predefined schema: required fields present, numeric totals within expected variance, date ranges matching the request. If validation fails, the output is rejected and the run is flagged for human review via PagerDuty. No silent failures. No malformed reports reaching stakeholders.
- Bottom Line The agent is the cheapest part of this system to replace. If Anthropic ships a better model tomorrow, you swap the model ID in AgentConfig and everything else holds. The validation schemas, the checkpoint layer, the observability pipeline, the escalation logic - that is your actual asset. Build the system around the agent, not on top of it. The agent reasons. Your system ensures it reasons correctly.
Top comments (0)