learning-it by example

Back to the video

Authorisation for AI Agents With Policy as Code (Cedar)

I changed one line of policy text, and a fifty pound refund was denied, with the checking code unchanged.

Video #234 ยท Enterprise architecture and AI agents

Steps in the video

  1. 0:00 One line of policy changed, and a refund was denied
  2. 0:26 The idea
  3. 1:01 Setup
  4. 1:29 The policy
  5. 1:56 The check
  6. 2:16 Ten calls, then one line changed
  7. 3:25 What this does not show
  8. 4:05 Mistakes to avoid
  9. 4:35 My take and next steps
  10. 5:03 Recap

Files

  • compare.py (33 lines)
  • gate.py (15 lines)
  • policy.cedar (9 lines)

Download the code (zip)

Tested with

Python 3.12.15 | cedarpy==4.12.1

What this does not show

One made-up agent, three orders and ten calls I chose. No agent, model or tool runs, and nothing is blocked. No schema. The run does not show a forbid beating a permit. The user and the amount are taken on trust; a refund of minus 500 is allowed. Results are for cedarpy 4.12.1.

Sources

Learning IT by Example.