Skip to content
PackCodebase & Dev-Founder11 files · CC0-1.0

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.

Download .zipDownload .md
Install into this repo
$ curl -fsSL "https://tryfounder2.com/api/packs/agent-guardrails?format=sh" | sh
Download the zip
$ curl -fsSL "https://tryfounder2.com/api/packs/agent-guardrails" -o agent-guardrails.zip && unzip agent-guardrails.zip

What 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.

Download all (11)
policies/
src/
skills/agent-guardrails/
agent-guardrails/README.md

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-guardrails

Classify every external side effect as Green, Amber or Red before acting; ask before Amber, hand Red to the owner.

View SKILL.md
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.md

Share this pack

Post this on X

Post on X
Don't give your coding agent raw Stripe or GitHub keys. Here's our open Green/Amber/Red agent authority pack: default-deny policies for Stripe, GitHub, email and Postgres + a broker checklist. Steal it before your agent nukes prod.

FAQ

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.

Try Founder2 free in beta