Safe AI Agent Guardrails Pack
The approval model Founder2 runs in production, as four default-deny JSON policies, a 150-line zero-dependency TypeScript evaluator with tests, and a checklist for moving API keys out of your agents and behind a broker. Reads are Green, reversible writes are Amber, and anything that moves money or reaches strangers is Red.
$ curl -fsSL "https://tryfounder2.com/api/packs/agent-guardrails?format=sh" | sh$ curl -fsSL "https://tryfounder2.com/api/packs/agent-guardrails" -o agent-guardrails.zip && unzip agent-guardrails.zipWhat is inside
- 4 default-deny policy files: Stripe, GitHub, email (Resend/Gmail), Postgres
- Reference evaluator with payload-hash-bound approvals, owner re-auth and typed confirmation for Red
- BROKER_CHECKLIST.md: inventory, broker tokens, scoped provider keys, attacker tests
- AGENTS.md snippet and an installable agent-guardrails skill
11 files included
Inspect every file.
Read, copy, or download individual files without extracting the archive.
Start here: The three tiers, what is in the pack and the one rule that matters.
# Safe AI Agent Guardrails Pack
Green / Amber / Red authority policies for the four things an agent can break fastest: **Stripe, GitHub, email and your database**.
This is the model Founder2 runs in production (it lives in our `@founderos/policy` package), rewritten as
plain JSON plus a ~150-line TypeScript evaluator with zero dependencies, so you can use it in your own broker.
## The three tiers
| Tier | Examples | Who approves | Extra friction |
| --- | --- | --- | --- |
| **Green** | Read a subscription, SELECT with a row limit, read a PR | Nobody | Allowlisted paths only, logged |
| **Amber** | Open a PR, pause a subscription, reply 1:1 to a customer | Owner or approver | Approval bound to the payload hash |
| **Red** | Merge to main, refund, bulk email, DELETE, migrations | Owner only | Re-auth within 10 min + typed confirmation |
Anything not listed in a policy file is **denied**. Default deny is the whole point.
## Files
- `policies/stripe.json`, `policies/github.json`, `policies/email.json`, `policies/postgres.json` — the rules.
- `AUTHORITY_MATRIX.md` — every rule on one page.
- `BROKER_CHECKLIST.md` — how to stop handing raw API keys to a VM or a coding agent.
- `src/evaluate.ts` — reference evaluator: `evaluate(action, policy, approval?)` → allow / require_approval / deny.
- `src/evaluate.test.ts` — the cases that matter, runnable with vitest or `node --test` after transpiling.
- `AGENTS.snippet.md` — paste into your repo's AGENTS.md / CLAUDE.md so coding agents know the rules too.
- `skills/agent-guardrails/SKILL.md` — a skill that makes an agent classify every side effect before it acts.
## The one rule that matters
**The agent never holds the credential.** It asks a broker; the broker holds the key, checks the policy, waits for
approval and executes. Everything else in this pack is detail. Start with `BROKER_CHECKLIST.md`.
Agent skills
Installable SKILL.md files in this pack.
Drop these directly into ~/.claude/skills/ with one command.
agent-guardrailsClassify every external side effect as Green, Amber or Red before acting; ask before Amber, hand Red to the owner.
mkdir -p ~/.claude/skills/agent-guardrails && curl -fsSL "https://tryfounder2.com/api/packs/agent-guardrails?file=skills%2Fagent-guardrails%2FSKILL.md" -o ~/.claude/skills/agent-guardrails/SKILL.mdFAQ
Common questions
Why not just use a restricted API key?
Do that too. But a restricted key is still all-or-nothing per resource: if it can refund, the agent can refund every charge. A broker adds per-action approval, payload binding and daily limits on top.
What does 'bound to the payload hash' mean?
The approver approves a hash of the exact request. If the agent changes one field after approval, say the refund amount, the hash changes and the approval no longer applies.
Do I need Founder2 to use this?
No. The policies are plain JSON and the evaluator is a single dependency-free TypeScript file. Founder2 is one place this already runs.
Is the evaluator the same code Founder2 runs?
It is a simplified port of the same rules: default deny, manual-only refusal, owner-only Red with a 10-minute re-auth window and typed confirmation. The production version adds strict per-action payload schemas and scope checks.
Want this enforced without building a broker?
Founder2 holds the keys, applies these tiers to every action your AI co-founder takes, and asks you before anything Amber or Red.