Bedrock Agents supervisor: Supervisor Patterns on Bedrock Agents

Day 56: Supervisor Patterns on Bedrock Agents
8 views
This guide focuses on Bedrock Agents supervisor for production systems, with practical trade-offs for reliability, security, and cost. Bedrock Agents with action groups are only as safe as the OpenAPI you publish. A supervisor pattern means the orchestrator selects specialists, and every action group typechecks against real handlers before deploy.
⚡ TL;DR: Define action group OpenAPI from handler signatures; fail CI on drift. Supervisor agent may only call specialist agents/tools, never raw shell. Version action groups with the Lambda alias.

Bedrock Agents supervisor: production guidance

User → Supervisor (Bedrock Agent)
         ├─ PlanAgent (action group)
         ├─ CodeAgent (action group)
         └─ ReviewAgent (action group)
python
# handlers/code_agent.py
from pydantic import BaseModel

class ApplyIntentIn(BaseModel):
    run_id: str
    intent_id: str
    dry_run: bool = True

def apply_intent(event, _ctx):
    inp = ApplyIntentIn.model_validate(event)
    # ✅ never accept undeclared fields
    return {"status": "ok", "intent_id": inp.intent_id, "dry_run": inp.dry_run}

OpenAPI must match handlers

yaml
# action-groups/code-agent.yaml
openapi: 3.0.0
info: { title: CodeAgent, version: "1.2.0" }
paths:
  /apply_intent:
    post:
      operationId: apply_intent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ApplyIntentIn"
bash
# ✅ CI drift check
python scripts/openapi_vs_handlers.py \
  --openapi action-groups/code-agent.yaml \
  --handlers handlers/code_agent.py
❌ Hand-editing OpenAPI in the console while Lambda code moved on — that is how agents call phantom ops.

Closing checklist

  • [ ] Generate or verify OpenAPI from handlers
  • [ ] Supervisor-only routing to specialists
  • [ ] Pin Lambda aliases per action group version
  • [ ] Schema-validate every invocation
  • [ ] Integration test the supervisor path end-to-end

Series navigation

Day 55: Swarm Failure Modes · Day 57: Coding Agents That Only Emit Intents Last updated September 11, 2026 Related: Bedrock Agents: Idempotent Tool Calls Against DynamoDB Writes; Bedrock Agents Memory: Session Scratchpads Versus Long-Term Stores; Bedrock ApplyGuardrail API: Pre/Post Filters for Tool I/O in Coding Agents.

Watch: 100 Days of AI on YouTube

Short videos from CheatCoders, one AI engineering topic per day.

Open the playlist on YouTube · CheatCoders on YouTube

Deep-dive PDF

Get the expanded guide for this post — extra diagrams-style checklists, failure modes, and a production walkthrough. Free when you subscribe to CheatCoders.

Already subscribed? or open the subscribe page.


Discover more from CheatCoders

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

Leave a comment

No account needed. Name and email are optional.