Open source · MIT · Zero dependencies

Stop babysitting
your coding agent.

agent-policy auto-approves the shell commands that are actually safe, blocks the ones that never should run, and hands everything else back to you. One policy for every agent you use.

The problem

Approval fatigue is a security bug.

Your agent asks permission to run git log | head. Then cat package.json. Then ls src. By the fortieth prompt you are clicking "Yes" without reading, which is exactly when the one command that matters slips through. Turning prompts off entirely is worse.

And every tool solves it differently: Claude Code, Codex, Cursor and opencode each have their own allowlist format, none of them understand a pipe, and none of them share a policy.

How it works

Three answers. Every command. Every agent.

ALLOW

Safe runs instantly

Every part is read-only or a known-safe local write: git status, rg, jq, test runners, formatters, terraform plan, installs, writes to temp dirs.

DENY

Bad habits never land

AI attribution trailers, secrets caught by gitleaks before a commit, and shell-based file edits that bypass your editor. The agent is told why and how to retry.

DEFER

Everything else is yours

Unknown or risky commands go to your harness's normal prompt, untouched. git push, kubectl, cloud writes: you stay in the loop.

Why it's different

Built for people who run agents all day.

Reads the whole command

Prefix allowlists see "git" and stop. agent-policy parses chains, pipes, loops, $(…), bash -c and heredocs, and judges every part. git diff | head sails through; git diff | sh does not.

Agents that fix themselves

When a command would trip a prompt for no good reason (a cd X && chain, a path in a shell variable), the agent gets a concrete rewrite and retries on its own. Never the same hint twice.

Guardrails, not vibes

No AI co-author trailers. No secrets committed: gitleaks runs before every git commit. No sed -i edits that dodge your editor, diff view and formatters.

Explain any decision

agent-policy check '<cmd>' prints the verdict and the reason for each part. No black box, no guessing why something prompted.

Per-project, per-folder

A git-ignored .agent-policy.json per repo, inherited by every worktree. Folder scopes for whole client trees. Lists append; denies always win.

Learns, with a human in the loop

Session retros queue candidate rules. Nothing lands until you accept it, and destructive, publishing or credential-touching entries are auto-gated so they can never be accepted.

One policy, six harnesses

Write it once. Every agent obeys it.

HarnessShell policyAfter editsShared AGENTS.md
Claude CodeAllow + deny + rewrite hintsPost-edit checks✓
CodexAllow + deny—✓
CursorAllow + denyFormatting✓
opencodeDeny + auto-answerPost-edit checks✓
PiDenyPost-edit checks✓
Gemini CLIShared instructions—✓

Plus portable commands every agent can call (verify, wait-for, smoke, tf-check) and git hooks that protect humans too.

Configure in JSON, not in six UIs

Per-repo rules in one small file.

Drop a git-ignored .agent-policy.json in a repo. Lists append to the global policy, denies always win, and every worktree inherits it, so parallel agents get the same rules.

Not sure what a command will do? Ask: agent-policy check '<cmd>'.

// .agent-policy.json
{
  "allow_prefixes": ["make test", "docker compose up"],
  "deny_prefixes":  ["terraform apply"],
  "write_allow_globs": ["coverage/**"],
  "guards": {
    "block_shell_edits": true,
    "gitleaks_on_commit": true
  }
}

Install

Up and running in under a minute.

git clone https://github.com/brian-childress/agent-kit ~/.agent-kit && ~/.agent-kit/install.sh
  1. Preview. install.sh --dry-run shows every hook and link first.
  2. Install. Hooks register for each harness it finds. Nothing you own is overwritten.
  3. Check. agent-policy test runs the built-in self-test suite.

Questions

Does it replace my harness's permission system?

No. It sits in front of it. Anything agent-policy does not positively recognize as safe is deferred to your harness's normal prompt, unchanged.

What does it need to run?

Python 3 and a POSIX shell on macOS or Linux. Standard library only: no pip install, no daemon, no network calls, no telemetry. gitleaks and lefthook are optional.

Can I see what it will do before installing?

Yes. install.sh --dry-run prints every link and hook it would add. It never overwrites a file you own, and --uninstall removes only what it added.

What about destructive commands?

rm, pushes, deploys, cloud writes and anything unrecognized are deferred to you. The policy only ever auto-approves read-only commands and a short list of safe local writes.

Is it free?

Yes. MIT licensed. Fork it, change the defaults, ship it to your team.

Fewer prompts. Better guardrails.
Same agents.

Star agent-kit on GitHub →

Free and open source under the MIT license.