When to reach for it
- Specialists must be encapsulated.
- The main agent must retain absolute control.
- Security boundaries must be strictly separated.
/pattern/agents-as-tools/
One orchestrating agent calls other agents exactly like tools, hiding their internal logic and coordination behind a standard tool interface.
When to reach for it
When it backfires
The tradeoff
Excellent encapsulation is achieved against limited independence for the sub-agents.
A caller agent invokes a tool-agent through a standard tool interface. The embedded-agent semantics are hidden behind the call.
The caller treats the tool-agent as instant, but it runs a full internal loop. Timeouts fire before the tool-agent finishes.
Fix · Expose expected latency in the tool schema. Use async callbacks or streaming for long-running tool-agents.
The tool-agent throws an internal exception, but the caller only sees 'Tool execution failed.' Debugging requires tool-agent logs.
Fix · Return structured error payloads with a trace_id. Route the caller to a diagnostic node that can fetch and display the full trace.
Threat exposure
Adopting this pattern opens these attack surfaces. Each links to its entry in the threat model.
Full threat model →Search patterns, frameworks, and pages.