Module 14 Wrap-up: The Collaborative AI
Hands-on: Design a human-in-the-loop workflow for a high-value financial transaction agent.
Module 14 Wrap-up: The Safe Orchestrator
You have learned that the best AI is the one that knows when to ask for help. You have mastered the patterns of Approval Flows for high-risk actions and Escalation for complex or emotional conversations. This balance of autonomy and oversight is the gold standard for enterprise systems.
Hands-on Exercise: The Safe Payout
1. The Scenario
You are building an agent that pays out bonuses to employees.
- Goal: Automate payouts $100.
- Constraint: Anything $1,000 requires a manager's "Approve" click.
- Constraint: Anything between $101 and $999 requires a "Second Opinion" from a different AI agent.
2. The Task
Write the logic for the Action Group Lambda.
- Use
if/elsestatements to return different status codes depending on the amount. - For the $1,000 case, return a message:
"STALL: Managerial Approval Required."
Module 14 Summary
- Human-in-the-Loop: Essential for high-stakes, irreversible tasks.
- Pause and Resume: The mechanical way HitL is implemented in Bedrock.
- Escalation: Safeguarding user experience when AI logic fails.
- Context Packages: Ensuring humans have the full picture during a handoff.
Coming Up Next...
In Module 15, we look at Observability. We will learn how to use CloudWatch and AWS X-Ray to see exactly what our agents are doing, how much they cost, and why they occasionally fail.
Module 14 Checklist
- I can describe the benefit of a "Pause and Approve" flow.
- I understand how to detect "Anger" as an escalation trigger.
- I have written a Lambda response that signals a manual review is needed.
- I know why "Summary Handoffs" are a best practice.
- I have identified at least 2 "Irreversible" actions in my business.