| title | Getting started |
|---|---|
| description | Install failproofai, enable policies, and let your agents run reliably |
| icon | rocket |
- Node.js >= 20.9.0
- Bun >= 1.3.0 (optional - only needed for building from source)
npm install -g failproofaibun add -g failproofaiPolicies are rules that run before and after every agent tool call. They catch destructive commands, secret leakage, and other failure modes before they cause damage.
```bash
failproofai policies --install
```
This writes hook entries into Claude Code's `settings.json`. You can also install for a single project or pick specific policies:
```bash
failproofai policies --install --scope project
failproofai policies --install block-sudo block-rm-rf sanitize-api-keys
```
Shows every policy, whether it's enabled, and any configured parameters.
Opens a local dashboard at `http://localhost:8020` where you can browse sessions, inspect tool calls, and manage policies.
Every time an agent runs a tool, Claude Code calls failproofai as a subprocess:
Claude Code → failproofai --hook PreToolUse → reads stdin JSON
evaluates policies
writes decision to stdout
Each policy returns one of three decisions:
- allow - the agent proceeds normally
- deny - the action is blocked, the agent is told why
- instruct - extra context is added to the agent's prompt
The fastest way to establish quality standards across your team is the .failproofai/policies/ convention. Drop policy files into this directory and they're loaded automatically — no flags, no config changes, no install commands.
```bash
cp node_modules/failproofai/examples/convention-policies/*.mjs .failproofai/policies/
```
Or create a new one:
```js
// .failproofai/policies/team-policies.mjs
import { customPolicies, allow, deny, instruct } from "failproofai";
customPolicies.add({
name: "test-before-commit",
match: { events: ["PreToolUse"] },
fn: async (ctx) => {
if (ctx.toolName !== "Bash") return allow();
if (/git\s+commit/.test(ctx.toolInput?.command ?? "")) {
return instruct("Run tests before committing.");
}
return allow();
},
});
```
Every team member who has failproofai installed picks up these policies automatically. No per-developer setup needed.
All configuration and logs stay on your machine:
| Path | What it stores |
|---|---|
~/.failproofai/policies-config.json |
Global policy config |
~/.failproofai/hook-activity.jsonl |
Hook execution history |
~/.failproofai/hook.log |
Debug log for custom hook errors |
.failproofai/policies-config.json |
Per-project config (committed) |
.failproofai/policies-config.local.json |
Personal overrides (gitignored) |
failproofai policies --uninstallRemoves hook entries from ~/.claude/settings.json. Config files in ~/.failproofai/ are kept.
Scopes and config file format All 26 policies with parameters Write your own policies in JavaScript Monitor sessions and review policy activity