learning-it by example

Back to the video

Excessive Agency: Limit What Your AI Agent Can Do

My demo notes agent could delete every note it held, and nothing in the code would stop it.

Video #92 ยท AI security and governance

Steps in the video

  1. 0:00 My agent could delete every note
  2. 0:27 The idea
  3. 1:01 Setup
  4. 1:22 Notes and hidden instructions
  5. 1:43 One agent, three modes
  6. 2:14 The comparison
  7. 3:14 What this does not show
  8. 3:45 Mistakes to avoid
  9. 4:14 My take and next steps
  10. 4:43 Recap

Files

  • agent.py (67 lines)
  • compare.py (23 lines)
  • notes.py (11 lines)

Download the code (zip)

Tested with

Python 3.12.15 | ollama==0.6.3

What this does not show

Two hidden instructions written by the author, one seed, one small local model (llama3.2). No damage in this run does not mean the model always resists. The approval is a fixed list in code, not a real person. The notes are made up and the tools only touch memory; nothing is deleted or sent.

Sources

Learning IT by Example.