Before you build
another agent
Build a strong generalist. Make expertise discoverable. Delegate only when the task earns it.
Updated · Revision notes
On this page · 8 min read
“Our application became slow after the release.”
A smaller connection pool can trigger queueing, retries, and more load. A deployment agent, a database agent, and a networking agent might each identify a symptom. The diagnosis depends on connecting them.
For an assistant that works across products, build one capable generalist as the primary agent. Give it a harness that progressively exposes the knowledge and tools it needs. Permit additional agents only as temporary, dynamically delegated subagents with enforced limits.
Permanent specialists are separately routed agents with fixed domain roles. Stable, repetitive workloads can make that routing attractive: context and latency are easier to tune. For a cross-product assistant, however, routing, context transfer, and reconciliation also create opportunities for coordination failures. A specialist label adds no capability by itself. Preserve distinct capabilities through model selection, authorized tools, and scoped domain memory.
Keep the investigation coherent#
The generalist needs durable task state: the objective, evidence, hypotheses, and open questions. Preserve it across compaction and restarts, with links to source artifacts. This lets the agent connect a deployment change to database behavior several steps later.
The harness is the runtime around the model: context management, tool discovery, code execution, permissions, and recovery. Build these capabilities once and reuse them across tasks.
Make expertise discoverable#
Progressive disclosure gives the agent broad reach with focused context. Start with a compact knowledge index and tool catalog. Retrieve relevant documents, discover tool schemas on demand, and load procedures as needed. The generalist can follow the investigation from deployments to databases while retaining its context.
Package expertise as reusable skills: diagnostic principles, procedures, examples, and scripts. Filter large tool results in code before adding them to context. Product teams contribute knowledge, tools, and evaluations to the shared harness.
Discovery is a capability to test. SkillsBench found that curated skills improved average pass rates, while some tasks regressed. A study of realistic skill retrieval found that gains weakened when agents had to find and select relevant skills. Test the path from symptom to useful context to correct tool use; preload essentials when latency matters.
If supplying the right material fixes a failure, improve discovery. If it does not, investigate the model, tool, or procedure before adding agent boundaries.
Allow only bounded dynamic delegation#
A subagent is a temporary execution created through the primary agent’s delegation tool. Require three things: a separable question, a reason for separate execution—parallel progress, context isolation, or independent review—and a result the primary agent can verify without repeating the investigation. Simple lookups and predictable procedures belong in tools, scripts, or deterministic workflows.
Dynamic-only delegation is the policy proposed here. The evidence supports choosing by task structure: a controlled study of 260 configurations across six benchmarks, with matched compute budgets, found gains on decomposable financial tasks and losses on sequential planning tasks.
Anthropic’s research system demonstrates parallel research followed by synthesis. Its reported gains also involved different models and more compute. Neither result establishes that dynamic delegation is universally best.
The primary agent proposes the work; the runtime enforces the limits:
| Limit | Runtime enforcement | Purpose |
|---|---|---|
| Creation | Primary agent only; require a current-task contract | Keep spawning under one owner |
| Lifetime | Create a task-scoped execution; end it on completion, timeout, or parent termination | Keep delegation temporary |
| Fan-out | Cap concurrent executions and total launches, including retries | Prevent unbounded spawning |
| Depth | Subagents cannot delegate further | Prevent recursive expansion |
| Resources | Reserve from the parent budget; cap time and tool calls | Bound total task cost |
| Access | Restrict data and tools to the parent’s authority | Prevent privilege expansion |
Do not install routes that automatically send database questions to a database agent. Templates can supply instructions; delegation must be chosen for the current task. Subagents use the same harness with isolated state. Depth one gives up nested delegation to keep ownership and budget accounting simple.
Mandatory checks and approvals belong in runtime policy or deterministic workflows. If delegation is denied, continue directly, narrow the task, or escalate within the same limits.
Delegate a question you can verify#
In the latency investigation, the generalist can trace request flow while a subagent asks: “Did this release change connection pool behavior?” Its contract includes the deployment diff, telemetry, documentation, and read-only tools. The result must include findings, source evidence, counterevidence, uncertainty, and completion status.
Suppose the diff shows a pool limit falling from 100 to 20. That establishes a change, not its causal role. The generalist checks whether connection wait time rose with the release and proposes a controlled test. Evidence that does not fit stays visible.
A separate review can challenge this explanation. Withhold the preferred conclusion where practical, and give the reviewer the evidence. Fresh context can still share model blind spots, so review complements tests and external evidence.
The real limit on fan-out is also the capacity to verify. Ten plausible summaries can leave the generalist with more work than it started with. Source artifacts and explicit uncertainty make each finding easier to check and reconcile.
As evidence arrives, database and network checks may converge on the same bottleneck. The generalist can combine their findings and cancel redundant branches. Adaptive delegation research proposes this flexibility; its benefit still needs validation on the actual workload.
Trace each contract, tool call, artifact, and result under the parent task. Propagate cancellation and release reservations. Preserve partial results for recovery without resetting budgets or treating unfinished output as verified.
Test whether the boundary adds value#
Compare the generalist, generalist with delegation, and any existing specialist system. Give them equivalent useful knowledge, state access, tools, and model capabilities. Use held-out tasks within and across domains. At matched budgets, measure quality, latency, total cost, and recovery failures—including discovery, retries, and verification. Then measure what extra spend buys.
If specialists win, isolate the cause. Supply the generalist with the same relevant context; then test separate execution and parallelism. If the gap persists, block migration while addressing the measured limitation. The proposed architecture must meet the required quality and latency targets.
Re-evaluate after model upgrades. Experiments with long-running agents found that stronger models reduced the need for some scaffolding, while evaluation still helped on harder tasks. Retire orchestration that no longer earns its cost.
Use one harness across product surfaces#
Customer-facing, personal, team, and internal operations agents can share this generalist design. Separate their identities, credentials, memory, and execution environments as required. Multi-tenant and dedicated deployments can reuse the harness while enforcing distinct access boundaries.
Keep expertise reusable, ownership coherent, and delegation temporary.
Optional delegation contract
This illustrative contract describes one dynamic subagent execution. Subagent mechanisms supply the execution primitives; the runtime enforces the policy. Numeric limits are examples to tune through evaluation.
# Illustrative policy and request, not a specific SDK schema.
runtime_policy:
creation: primary_agent_only
contract_scope: current_parent_task
lifetime: until_completion_timeout_or_parent_termination
max_concurrent_subagents: 2
max_total_launches: 4 # Includes retries.
max_depth: 1 # Subagents cannot delegate.
budget_source: parent_task
require_reservation: true
permission_ceiling: parent_grants
propagate_cancellation: true
delegation_request:
objective: Check whether the release changed connection pool behavior
model_class: strong
reasoning_effort: high
context: explicit_authorized_evidence
tools: [deployments.diff, metrics.query, logs.search]
actions: read_only
memory: task_artifacts_only
limits:
timeout_seconds: 120
max_tool_calls: 12
max_output_tokens: 2000
result: [findings, evidence, counterevidence, uncertainty, status]
The runtime rejects requests outside policy, accounts for aggregate usage, and records the effective contract. Output limits do not replace a total token or spend budget. Subagent results remain evidence for the primary agent to evaluate.
The runtime checks the contract before creating a subagent. This example shows admission, rejection, and completion under the same policy.
Admitted
Budget exhausted
Access denied
Parent canceled
A decision you can make before delegation
| Task shape | First choice | Reason to change |
|---|---|---|
| One evolving diagnosis, shared evidence | One generalist and deterministic tools | A separable investigation has a precise return contract |
| Independent inspections of disjoint modules | Bounded temporary children | Integration cost or conflicting assumptions erase the time saved |
| Repeated mechanical transformation | Ordinary code | Inputs genuinely require judgment |
A delegation that loses: three children inspect the same flaky integration test with incomplete logs, each proposes a different cause, and the parent repeats all three investigations. Parallel activity increased cost without producing independent evidence. Measure accepted work after integration, not completed child messages. Default to depth one, shared harness behavior, explicit deadlines, and a parent-owned final decision.