Multi-agent patterns and safety rails
Lesson 4 of 4 in Agentic Systems on AWS.
One agent with forty tools reasons badly — the tool catalog crowds the context and every decision competes with every other. Multi-agent systems split the problem: specialists own domains, something routes between them. The AIP-C01 guide names two AWS-flavored ways to build that routing. Strands scales up through model-driven primitives — agents-as-tools (an orchestrator agent calls specialist agents exactly like tools, hierarchically) and peer patterns where agents coordinate directly. AWS Agent Squad attacks routing head-on: an open-source framework (formerly Multi-Agent Orchestrator) whose classifier examines each incoming request plus conversation history and dispatches it to the best-suited specialized agent, keeping context coherent across agents and across turns.
There is also a managed lane: Amazon Bedrock multi-agent collaboration, where a supervisor agent breaks a request down and invokes collaborator agents sequentially or in parallel (or, in supervisor-router mode, simply relays to the right collaborator).
| Approach | Who routes | Reach for it when |
|---|---|---|
Strands multi-agent primitives | The models themselves — an orchestrator agent treats specialists as tools (agents-as-tools), hierarchically | You are already in Strands and want fluid, model-driven delegation inside one codebase |
AWS Agent Squad | A dedicated classifier — per request, informed by conversation history and each agent's declared specialty | Heterogeneous specialist agents behind one front door, with context maintained across them |
Bedrock multi-agent collaboration | A managed supervisor agent — decomposing and invoking collaborators sequentially or in parallel, or routing directly | You want the orchestration layer fully managed inside Bedrock, with collaborators as Bedrock agents |
There is a different kind of plurality too: model ensembles, where several models (not agents) each take the same task and custom aggregation logic merges the results — majority vote for classifications, a judge model or scoring function for generations, or specialist-per-subtask with a composer at the end. Ensembles buy accuracy and robustness with multiplied inference cost, so stems that pair "highest answer quality" with "cost is secondary" point here; stems that want cost control point to cascading and routing instead.
The guarded workflow — rails plus a human gate
- Agent plans an action
Inside a Step Functions-orchestrated workflow, so every rail below is enforced by the orchestrator, not promised by the prompt.
- Stopping conditions OK?
Iteration caps, token/cost budgets, and wall-clock limits implemented as Step Functions state — the guide's "stopping conditions".
- Irreversible or high-impact?
Refunds, deletions, external emails, contract changes: anything hard to undo routes to a human first.
- Human approval gate
Step Functions pauses with a task token (.waitForTaskToken); the proposed action lands in a review UI, and feedback arrives through an API Gateway endpoint that resumes the workflow — the human-augmentation pattern.
- Execute via Lambda tool
The tool Lambda runs with its own timeout (no hung tools) and a least-privilege IAM role scoped to exactly the resources this tool touches.
- Dependency failing?
A circuit breaker tracks downstream failures; past the threshold it opens and calls fail fast to a fallback instead of hammering a dying service with retries.
- Observation returns
Success, a structured error, or the fallback result — the loop (and its budget check) runs again.
- Halt with partial result
Hitting a stopping condition is a feature: the workflow ends deliberately, reports what it has, and never loops forever on someone else's bill.
- Rejected — no action
The human said no; the agent records the refusal as an observation and re-plans or reports.
Interactive sorting exercise: Four rails bound an autonomous agent, and a human gate backs them up. Match each failure mode to the rail that prevents it.
Key terms: AWS Agent Squad, Model ensemble, Human-in-the-loop (HITL), Circuit breaker pattern, Strands Agents
Interactive checkpoint quiz (2 questions) — open this page in a browser to take it.