failproofai README

The project's README from github.com/FailproofAI/failproofai. As one markdown file: README.md.

failproof ai

FailproofAI%2Ffailproofai | Trendshift FailproofAI%2Ffailproofai | Trendshift

npm CI Supply Chain Discord Reddit Docs License

Translations: 简体中文 · 日本語 · 한국어 · Español · Português · Deutsch · Français · Русский · हिन्दी · Türkçe · Tiếng Việt · Italiano · العربية · עברית

Ship agents that never fail.

Your agent ran rm -rf on the wrong directory. It read .env into its context. It spent forty minutes retrying the same broken call, then told you the task was done. Failproof lives in your agent's runtime and hears every hook event it fires: the session starting, every prompt, every tool call and its result, sub-agents spinning up, context about to be compacted, the moment it tries to stop. It can act on any of them: block the bad action before it executes, steer the agent mid-run, or send it back to work when it quits too early. Then it learns from every failure, so your agent's harness gets better with every run.

37% → 69% task success on failures a policy recognised. Same model, no fine-tuning (FIRE study)
~0.7 ms p50 per policy check, from a Rust daemon in the hot path
12 agent harnesses, one policy API: Claude Code, Codex, Cursor, Hermes, OpenClaw and more

Open source and free to start. Install the CLI, connect Failproof Cloud, and your first audit runs on your agents' real history.

Failproof AI in action


Supported harnesses

Twelve harnesses in two classes: ten coding CLIs, and two chat and assistant gateways (Hermes, OpenClaw).

Building your own agent, on any framework or none? Report its runs through the Python SDK or the TypeScript SDK, which give you tracing, sessions, evaluations and audits. Enforcement there needs a hook in your own runtime. Talk to us and we'll map it.

Claude Code OpenAI Codex GitHub Copilot Cursor Agent OpenCode Pi
Hermes OpenClaw Factory Droid Devin CLI Antigravity CLI Goose

Get started: find where your agents fail, then stop it

npm install -g failproofai
failproofai config                # hook your agents, connect to Failproof Cloud (free)
failproofai backfill --since 7d   # bring in the last week of runs already on disk
  1. Connect. failproofai config finds every agent on this machine, hooks into each one, starts the background daemon, and signs you in to Failproof Cloud in your browser. No account yet? Make one right there, on the free plan.
  2. Backfill. Your agents have been running for weeks, and that history is already on this machine. failproofai backfill --since 7d sends the last seven days (for supported harnesses), so you start with real evidence instead of an empty dashboard.
  3. Audit. The moment runs land, Cloud starts your first audit on its own. It reads your sessions, clusters what went wrong into named failure modes, and turns each one into an insight, with the sessions that prove it. The free plan includes audits every month.
  4. Plug in policies built for your agents. Open an insight and hit prevent this →. Failproof drafts a policy for that exact failure and tests it against your agents' own past tool calls. You then roll it out to every machine, watching first or enforcing straight away.

Setting up CI, a container, or letting an agent run the install? failproofai config notices there's no one to ask and applies the defaults without prompting.


One policy, every harness

Every harness speaks its own dialect:

Failproof translates all of it:

So a policy written once against Bash blocks the same command in Claude Code, Codex, Hermes and Goose. A "run the tests before you stop" gate sends the agent back to work on every harness that has a turn-end hook.

Each contract is verified against that CLI and pinned, with what it was verified on, in a capability matrix the test suite checks every claim against. Blocking before a tool runs is verified on all twelve harnesses; turn-end gates on eight. The per-harness matrix shows exactly which events each one honours.


Policies, written for your agents

A policy can listen to any of those events. Before a tool call, it can block the command outright. When a prompt arrives, it can add context. When the agent tries to stop, it can send it back to finish the job. Whatever it decides, the agent is told why. There are two kinds of policy, and you can mix them:

You don't have to write either. Failproof authors them for you. Open an insight in Cloud and hit prevent this →, or describe the rule in a sentence. Failproof drafts the policy, tests it against your agents' own past tool calls, and rolls it out to every machine, observing first or enforcing straight away.

A few examples of what a policy can catch, and what it does about it:

Example What it catches Does
block-env-files Reads of .env and other secret files Blocks
block-kubectl Unreviewed changes to live infrastructure Blocks
warn-destructive-sql DROP, TRUNCATE, an unbounded DELETE Warns the agent and lets it decide
warn-repeated-tool-calls The agent looping on the same failing call Warns the agent to change approach
no-refunds-over-limit (yours) A support agent approving a refund it isn't allowed to Whatever you decide
no-production-writes (yours) File writes and edits to production paths (the code below; shell commands aren't checked) Blocks

Prefer to write one yourself? Save it in .failproofai/policies/ as, say, no-production-writes-policies.mjs and it loads automatically (naming rules). Commit it, and every teammate whose agents run Failproof gets it on their next pull.

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();
  },
});

Every policy returns one of three decisions: allow(), deny(message), or instruct(message). The last is the quiet superpower. Instead of crashing the agent into a wall, it steers it ("run the tests before you stop", "use the staging database") and the agent corrects course on its own.

→ Write a policy · Decision-model policies · More examples


Built for agents that run on their own

A check that costs nothing can run on every event, all the time. That's what lets you hand an agent more autonomy, not less:


Failproof Cloud: a harness that improves itself

Generic guardrails are written for everyone's agent. Failproof Cloud is built for yours, from your agent's own traces, whether you run one agent or a hundred.

Every run feeds a loop that makes the harness around your agent better:

  1. Trace. Every prompt, model call, tool call and result, live and replayable, with parallel sub-agents on their own lanes, latency, cost and context windows, and SQL over all of it.
  2. Audit. Audits read your sessions on a schedule and cluster what went wrong into named failure modes: the loops, wrong tools and quiet give-ups that are specific to your agent. Each one becomes an insight, backed by the sessions that prove it.
  3. Check. Turn an insight into an eval and every new session is scored for it, by code, the decision model, an LLM judge or an agent. When the failure comes back, alerts reach you on Slack, email or a signed webhook.
  4. Fix. Hit prevent this → and Failproof writes the policy for that exact failure. It tests the policy against your agent's past tool calls, then rolls it out, observing first or enforcing right away.
  5. Repeat. The next audit runs on traces where that failure can't happen any more, and finds the next one.

The model never changes. The harness around it learns from every failure. It's the idea behind our FIRE study, where policies derived from an agent's failures took task success from 37% to 69% on the failures they recognised. Same model, no fine-tuning.

"The audits are the part that changed how we operate. We now have fewer incidents, less compute waste, and faster shipping." — Pratheep Velicherla, CTO, Testsigma

Ask the failproof agent anything about your agent in plain English, or pull the same data into your own tools through the MCP server, Slack and the fp CLI.

Start with one agent on the free plan: 5,000 runs a month, no card. Self-hosting in your own cluster is available on the Enterprise plan.

→ Start free · Pricing · Quickstart · Book a demo


Documentation

Start
Quickstart Install, connect a harness, see the first run
Concepts How the hook system works
Supported harnesses All 12, and what each one can enforce
Observe
Sessions Follow a run: models, tools, errors, latency
Read a trace What the execution graph is telling you
Audits Find failure patterns across many sessions
Evaluations Score every session with code, the decision model or an LLM judge
Enforce
Write a policy From an insight, from a sentence, or in code
Decision-model policies Jev judges calls against what the user asked
Configuration Config scopes, merge rules and policy parameters
Instrument your own agent
Python SDK Report runs from an agent with no harness
TypeScript SDK The same events from a Node agent
Policy SDK allow / deny / instruct reference

License

MIT with Commons Clause — free for internal and personal use; commercial resale of failproofai itself requires a separate agreement. See LICENSE for the full text.


Contributing

See CONTRIBUTING.md. New policies, edge cases, and translations all welcome.


Built with ❤️ by befailproof.ai in SF and Bengaluru.

failproofai (FailproofAI/failproofai)

Searching Database…

What is this?Failproof AI is an observability and enforcement layer that sits inside AI agent harnesses (coding CLIs, chat gateways, self-hosted assistants), capturing every run and blocking dangerous tool calls before they execute.
Is this a CLI tool or a hosted dashboard?It is primarily a local CLI/npm package that hooks into your agent harness and runs policies with zero added latency; it also serves a local web dashboard on localhost:8020, and a separate hosted 'Failproof AI Observability' product exists for teams running agents across a fleet.
How do I get it running?Run the setup command to wire the hooks into your harness (no policies are enabled yet), then add a policy pack separately. In CI or containers with no terminal, failproofai config applies defaults automatically instead of prompting.
Which coding agents and harnesses are supported?Twelve harnesses across two classes: ten coding CLIs (like Claude Code and Codex) plus two chat/assistant gateways (Hermes and OpenClaw), all sharing one policy API and one session history.
Does enforcement work the same way across every harness?Blocking a tool call before it runs is verified on all twelve harnesses, but turn-end gates only work on eight. Agents that run outside these twelve harnesses need the Python SDK for tracing, and enforcement there requires hooking your own runtime.
Does my run data leave my machine?No — the local dashboard reads run history already stored on your machine with no account or signup, and nothing leaves the box unless you opt into the hosted Observability product.
What are the license terms?It's MIT with the Commons Clause: free for internal and personal use, but commercial resale of failproofai itself requires a separate agreement.
What does the always-on policy block even before I set anything up?block-failproofai-commands is the one policy that's always enabled and can't be disabled or paused, specifically so an agent can't use it to switch off every other policy.
How do I write a custom policy?Drop a file into the .failproofai/policies/ folder and it loads automatically with no flags; commit it and the rest of the team gets it on their next pull. Policies return allow(), deny(message), or instruct(message) to permit, block, or steer the agent.
What kinds of risky actions does it catch out of the box?The 40 built-in policies include blocking reads of .env secret files, sudo privilege escalation, recursive rm -rf, unreviewed terraform/kubectl changes, force-pushes to main, and warnings on destructive SQL or repeated tool-call loops.
What does the hosted Observability product add over the free local dashboard?It aggregates every run from every harness across a team, with parallel sub-agent execution graphs, p50/p95/p99 latency, per-model cost tracking, SQL over your traces, scheduled audits, and alerts to Slack, email, or webhooks; self-hosting it in your own cluster is an Enterprise-plan option.
Size
102.3 MB
Stars
9.8K
Age
7mo
Commits · 90 Days