Policy as code for AI agents
Write the rules an agent must follow as code, test them, and watch the agent stop when it should. Build it from a starter template.
- Status
- Planned
- Level
- Intermediate
- Length
- 3 hours
- When
- To be announced
Agents are easy to start and hard to trust. This lab is about the second part: writing down what an agent may do, in code, so the rules are visible, testable, and reviewed like any other change.
What you will build
You start from the starter template, which already runs an agent with a few tools. You then write a policy that decides, for each tool call, whether to allow, ask a person, or block, and you add tests that fail when the policy is wrong.
How the session runs
- A short walkthrough of the starter and the idea of policy as code.
- You build the policy yourself, in small checkpoints, with others building beside you.
- You break your own agent on purpose, and fix the policy.
- You leave with a working repository you can adapt.
Bring
A laptop, Node, and an API key for any model provider you already use.