What is Failproof AI?
Failproof AI is a runtime policy layer for AI agents. It sits in the Guardrails & Security category of the Evaluation & Production Ops tools and is open-source, written in TypeScript and licensed MIT with Commons Clause. To get started: install the CLI.
Overview
Failproof AI is a runtime policy layer for AI agents. It installs into an agent's hook system and hears every event the agent fires: the session starting, each prompt, every tool call and its result, sub-agents spinning up, context about to be compacted, and the moment the agent tries to stop. On any of those events a policy can block the action before it executes, add context, or send the agent back to work when it quits too early. The project's pitch is aimed at the familiar failures: an `rm -rf` on the wrong directory, a `.env` file read into context, or forty minutes spent retrying the same broken call.
Its main trick is translation. Every harness speaks its own dialect: Claude Code reads a JSON verdict, Factory's droid only stops on exit code 2, Cursor forces another turn with a `followup_message`, OpenCode and OpenClaw take in-process plugins and Hermes loads a native Python plugin. Failproof maps every event onto one canonical set of 29 (`SessionStart`, `PreToolUse`, `PostToolUse`, `Stop` and so on), normalises tool names such as `Bash`, `terminal`, `shell` and `exec` to one form, and translates each verdict back into the shape that harness obeys. A policy written once against `Bash` therefore blocks the same command in Claude Code, Codex, Hermes and Goose. The README says blocking before a tool runs is verified on all twelve supported harnesses and turn-end gates on eight.
Policies come in two kinds. Code policies are plain JavaScript files dropped into `.failproofai/policies/` that return `allow()`, `deny(message)` or `instruct(message)`; the last steers the agent rather than stopping it. Decision-model policies are plain-English yes/no questions answered by Jev, the project's fast classifier, for judgment calls a regex cannot make. Checks run through `failproofaid`, a Rust daemon behind an owner-only Unix socket that the project measures at about 0.7 ms p50 per policy check, and it runs as a system service so overnight and detached sessions are covered too.

The CLI is free and the source is published under MIT with the Commons Clause, which allows internal and personal use but not commercial resale of Failproof itself. Failproof Cloud adds tracing, scheduled audits that cluster failures into named insights, evaluations and alerts, and can draft a policy from an insight and test it against the agent's past tool calls; its free plan covers 5,000 runs a month and self-hosting is on the Enterprise plan.
What it does
- Hooks into 12 harnesses: Claude Code, Codex, GitHub Copilot CLI, Cursor Agent, OpenCode, Pi, Hermes, OpenClaw, Factory Droid, Devin CLI, Antigravity CLI and Goose
- One canonical event model (29 events) and tool-name mapping, so a single policy works across every supported harness
- Code policies in plain JavaScript returning `allow`, `deny` or `instruct`, auto-loaded from `.failproofai/policies/` and shared through the repo
- Decision-model policies: plain-English yes/no questions judged by the Jev classifier against what the user actually asked for
- A Rust daemon (`failproofaid`) runs checks at about 0.7 ms p50 and starts at boot, covering cron jobs and detached sessions
- Optional Failproof Cloud: session traces, scheduled failure audits, evaluations, alerts and policies drafted from observed failures
- Python and TypeScript SDKs to report runs from custom agents built on any framework
Getting started
Failproof ships as an npm package. The `config` command finds the agents on the machine, wires up their hooks, starts the daemon and signs you in to Failproof Cloud (free plan); in CI or a container it applies defaults without prompting.
Install the CLI
npm install -g failproofaiHook your agents
Detects every supported agent on this machine, installs the hooks and starts the background daemon.
failproofai configBackfill recent history
Sends the last week of runs already on disk (for supported harnesses), so the first audit has real sessions to work from.
failproofai backfill --since 7dWrite your own policy
Save a file such as `.failproofai/policies/no-production-writes-policies.mjs`; it loads automatically, and committing it gives every teammate the same rule.
import { customPolicies, deny, allow } from "failproofai";
customPolicies.add({
name: "no-production-writes",
match: { events: ["PreToolUse"] },
fn: async (ctx) => {
if (!["Write", "Edit"].includes(ctx.toolName ?? "")) return allow();
if (ctx.toolInput?.file_path?.includes("production"))
return deny("Writes to production paths are blocked.");
return allow();
},
});Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Blocking reads of `.env` and other secret files, or unreviewed `kubectl` changes, across every coding agent a team runs
- Forcing an agent to run the tests before it is allowed to stop, on every harness with a turn-end hook
- Warning an agent that is looping on the same failing tool call so it changes approach
- Finding where a fleet of agents fails from their own traces, then turning each failure mode into an enforced policy

How Failproof AI compares
Failproof AI alongside other open-source guardrails & security tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| SkillSpector | ★ 28.3k | Security scanner for AI agent skills that checks a skill for prompt injection, data exfiltration, privilege escalation and supply-chain risks before you install it. |
| Presidio | ★ 12.1k | An open-source framework for detecting, redacting, masking, and anonymizing personal data (PII) across text, images, and structured data using NER models, regex, and rule-based recognizers. |
| Failproof AI | ★ 10.5k | One policy API that hooks into Claude Code, Codex, Cursor and nine other agent harnesses to block, warn or steer the agent on every event |
| Guardrails AI | ★ 7.7k | A Python framework that wraps LLM calls with composable input/output validators (from the Guardrails Hub) to check structure, type, and safety risks before responses reach users. |
| NeMo Guardrails | ★ 7.6k | NVIDIA's toolkit for adding programmable rails to LLM chat apps, using the Colang language to control dialog flow and block jailbreaks, prompt injection, and off-topic answers. |
| BLA (Blind LLM Agents) | ★ 7.3k | An open-source CLI and MCP server that hardens the apps, WASM modules, databases and model files you ship so AI reverse-engineering agents such as REA hit resource budgets and follow decoys, without changing runtime behaviour. |
| dcg (Destructive Command Guard) | ★ 6.4k | A Rust pre-tool hook for coding agents that inspects each shell or git command before it runs and blocks the destructive ones, with an explanation and a safer alternative. |
| GLiNER | ★ 4.3k | A small zero-shot named-entity recognition model that can extract arbitrary entity types from text and is widely used as a PII detection backend, including inside Presidio. |
