Skip to course content
Free CrewAI course

CrewAI for Multi-Agent Automation

Module 05 Activity

Scenario

The crew is about to be trusted with something that cannot be undone. This is the layer that makes that defensible.

What you build

A guardrail that fails closed, assertions in callbacks, one well-placed human gate, and rejections an agent can act on.

Steps

  1. Write a guardrail checking parse, shape and policy, with the policy limits as data at the top of the file.
  2. Wrap it so that an error in the check BLOCKS rather than allows. Prove it by breaking the checker deliberately.
  3. Attach assertions to task callbacks - including one that flags hedging language in a decision output.
  4. Sort your steps by reversibility and place the minimum number of gates, immediately before the irreversible steps.
  5. Design the rejection format with three fields: what was wrong, what is correct, what to do next. Use it for human reviewers too.
  6. Measure what happens after a rejection - does the retry differ from the first attempt?

Evidence to hand in

Review checklist