Security
Guardrail hooks
Rules that run before an AI agent acts: protected apps need my approval, and anything containing a secret is refused.
The problem
AI agents can be fooled, so I wanted rules that hold even if one is.
Result
Tested live on both machines (19 Nov). The live test found a real gap in the PowerShell path, which was then fixed and re-tested. I also tested on a copy with planted attacks, and the agents followed none of them.
Process
- Step 01
Agent acts
An agent tries to edit a protected app or make a commit.
- Step 02
Hook checks
A guardrail hook looks at the action before it happens.
- Step 03
Approve or refuse
Editing a protected app needs my on-screen approval. A commit containing a secret or token is refused.
Guardrails
- Emails are treated as data, never instructions, which guards against prompt injection.
- Suspicious text is flagged and logged.
- Drafts can only go to approved contacts. Reads are scoped to the workspace.
Why I test live
The live test found the PowerShell gap. That is why I test guardrails live and do not just trust that they work.
My part
I built this with Claude Code. I decided which actions need approval and which must be refused, and tested them on both machines.