Write a policy from an audit
An audit finds a failure; a policy stops it happening again. Failproof AI drafts the policy from the finding’s own evidence.1. Run an audit
Run an audit over the sessions where the failure happens. Each finding carries its evidence sessions, a root cause, and a suggested prevention path. Work from a finding with a repeatable action pattern — a policy can only stop what it can recognize in a hook event.2. Generate the draft
- Dashboard
- CLI
- Open the finding’s insight under analyse → insights and check its cited sessions, root cause, and recommendation.
- Read its prevent it with a policy card. Failproof AI first says whether a policy can express the problem at all. no policy fits this one means the fix is an alert, a workflow change, or a person — not a policy.
-
Select prevent this →. The insight’s title, finding, root cause, and recommendation become a draft in fix → policies → new policy. The button stays available when you disagree with the card’s verdict.

3. Review the draft
A draft is a starting point, not a verdict. Before publishing, check that it:- Names the failure mode in operational language.
- Matches only the hook events and tools that carry enough evidence to decide.
- Uses the narrowest condition that catches the unsafe action.
- Returns a reason that tells the agent what to do instead.
- Uses
instructwhere the agent can safely correct course, anddenyonly where allowing the action is unacceptable or irreversible.
4. Test it, then turn it on
test replays the draft against calls your agents already made and shows the ones it would have acted on; mark a wrong one to add an exception. Test a policy covers that and the other checks. When it behaves, select continue →. On turn on, name it, choose its mode — enforcing now, or observing first — and its machines, and select publish v… with its version number. That mints an immutable version and puts it on the machines you chose; with no machine connected it applies once it is deployed. From a terminal, publishing mints the version and deploys nothing:publish parse-checks the source before sending it, so a syntax error surfaces here instead of on a machine at enforcement time.
Describe it in plain words
Go to fix → policies → new policy. Under what should failproof enforce?, describe the rule, pick the agent whose past calls the test replays and the machines it will run on, and select draft the policy →. Or start from one we flagged in your agents’ tool calls this week, or pick a common one. Then review, test, and turn it on as in steps 3 and 4 above.Write it yourself
A policy is JavaScript or TypeScript against thefailproofai API:
production/config.yml, /srv/production/config.yml, /srv/production, and C:\\production\\config.yml for both Write and Edit, but not production-backup: production has to be a whole path segment. The context also carries the event type, normalized payload, session metadata, parameters, and source CLI when available — see the policy SDK.
To publish it as a version, open fix → policies → new policy, select write it yourself or upload a file, and follow steps 3 and 4 above, or publish the file from a terminal with fp policies publish.
To run it on a machine without Cloud, save it under .failproofai/policies/ with a name ending in policies.js, policies.mjs or policies.ts — those load automatically at project and user scope — or install it by path:

