failproofai 0.0.2-beta.2 → 0.0.2-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  5. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  9. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  10. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  11. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  12. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  13. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  18. package/.next/standalone/.next/server/app/_not-found.rsc +17 -17
  19. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +17 -17
  20. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  21. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
  22. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  23. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  24. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  25. package/.next/standalone/.next/server/app/index.html +1 -1
  26. package/.next/standalone/.next/server/app/index.rsc +16 -16
  27. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  28. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +16 -16
  29. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  30. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +11 -11
  31. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  32. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  33. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  36. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  39. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  42. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  43. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  46. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  47. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/chunks/[root-of-the-server]__02nt~6d._.js +1 -1
  49. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
  50. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0103jwf._.js → [root-of-the-server]__07k6eu-._.js} +2 -2
  51. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
  52. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
  53. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
  54. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
  55. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ovwjau._.js → [root-of-the-server]__0kfv9fw._.js} +2 -2
  56. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
  57. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +5 -5
  58. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
  59. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
  60. package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +1 -1
  61. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
  62. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
  63. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  64. package/.next/standalone/.next/server/pages/404.html +2 -2
  65. package/.next/standalone/.next/server/pages/500.html +1 -1
  66. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
  68. package/.next/standalone/.next/static/chunks/{0uftmw5od9kdz.js → 0.jo.465b6_k..js} +1 -1
  69. package/.next/standalone/.next/static/chunks/{0wtcha31~i7rm.js → 01haq0a3zrx0v.js} +1 -1
  70. package/.next/standalone/.next/static/chunks/08f78tecvx61l.css +1 -0
  71. package/.next/standalone/.next/static/chunks/{0tl2f-3yc.rqc.js → 0a6xi1a8f_qlp.js} +1 -1
  72. package/.next/standalone/.next/static/chunks/{0tbr0o7vwc~-s.js → 0mq7ze1vkeo1p.js} +1 -1
  73. package/.next/standalone/.next/static/chunks/{0sm1iqi3m~xiz.js → 0p_fpyfmmohnx.js} +1 -1
  74. package/.next/standalone/.next/static/chunks/{0pdd7~yp8ytu6.js → 0qwyj3m400l_g.js} +1 -1
  75. package/.next/standalone/.next/static/chunks/{001k0zayn2o.s.js → 0t94r_mk0s7e4.js} +1 -1
  76. package/.next/standalone/.next/static/chunks/{0jrzwsyo7wo26.js → 139~00zc9.u7s.js} +1 -1
  77. package/.next/standalone/Dockerfile.docs +12 -0
  78. package/.next/standalone/README.md +59 -46
  79. package/.next/standalone/dist/cli.mjs +215 -20
  80. package/.next/standalone/dist/index.js +2 -2
  81. package/.next/standalone/docs/{architecture.md → architecture.mdx} +40 -23
  82. package/.next/standalone/docs/{built-in-policies.md → built-in-policies.mdx} +134 -12
  83. package/.next/standalone/docs/cli/dashboard.mdx +28 -0
  84. package/.next/standalone/docs/cli/environment-variables.mdx +34 -0
  85. package/.next/standalone/docs/cli/hook.mdx +30 -0
  86. package/.next/standalone/docs/cli/install-policies.mdx +48 -0
  87. package/.next/standalone/docs/cli/list-policies.mdx +31 -0
  88. package/.next/standalone/docs/cli/remove-policies.mdx +44 -0
  89. package/.next/standalone/docs/cli/version.mdx +12 -0
  90. package/.next/standalone/docs/{configuration.md → configuration.mdx} +16 -16
  91. package/.next/standalone/docs/{custom-hooks.md → custom-policies.mdx} +80 -42
  92. package/.next/standalone/docs/{dashboard.md → dashboard.mdx} +26 -29
  93. package/.next/standalone/docs/docs.json +31 -4
  94. package/.next/standalone/docs/examples.mdx +253 -0
  95. package/.next/standalone/docs/for-agents.mdx +38 -0
  96. package/.next/standalone/docs/getting-started.mdx +134 -0
  97. package/.next/standalone/docs/introduction.mdx +57 -0
  98. package/.next/standalone/docs/logo/dark.svg +21 -0
  99. package/.next/standalone/docs/logo/light.svg +21 -0
  100. package/.next/standalone/docs/{package-aliases.md → package-aliases.mdx} +5 -5
  101. package/.next/standalone/docs/{testing.md → testing.mdx} +11 -11
  102. package/.next/standalone/package.json +6 -9
  103. package/.next/standalone/scripts/publish-aliases.mjs +4 -2
  104. package/.next/standalone/skills-lock.json +10 -0
  105. package/.next/standalone/src/hooks/builtin-policies.ts +259 -20
  106. package/.next/standalone/src/hooks/policy-evaluator.ts +19 -1
  107. package/.next/standalone/src/hooks/policy-helpers.ts +2 -2
  108. package/.next/standalone/vitest.config.e2e.mts +3 -0
  109. package/.next/standalone/vitest.config.mts +3 -0
  110. package/README.md +59 -46
  111. package/dist/cli.mjs +215 -20
  112. package/dist/index.js +2 -2
  113. package/package.json +6 -9
  114. package/scripts/publish-aliases.mjs +4 -2
  115. package/src/hooks/builtin-policies.ts +259 -20
  116. package/src/hooks/policy-evaluator.ts +19 -1
  117. package/src/hooks/policy-helpers.ts +2 -2
  118. package/.next/standalone/.next/static/chunks/15jpradyu_531.css +0 -1
  119. package/.next/standalone/docs/cli-reference.md +0 -175
  120. package/.next/standalone/docs/getting-started.md +0 -128
  121. package/.next/standalone/docs/introduction.md +0 -47
  122. /package/.next/standalone/.next/static/{JksWDLwDoPy6bcczVWlff → 7fR022u1Sj-s5MfKO1q9Y}/_buildManifest.js +0 -0
  123. /package/.next/standalone/.next/static/{JksWDLwDoPy6bcczVWlff → 7fR022u1Sj-s5MfKO1q9Y}/_clientMiddlewareManifest.js +0 -0
  124. /package/.next/standalone/.next/static/{JksWDLwDoPy6bcczVWlff → 7fR022u1Sj-s5MfKO1q9Y}/_ssgManifest.js +0 -0
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  title: Built-in Policies
3
- description: "All 35+ security policies with descriptions and parameters"
3
+ description: "All 30 built-in policies that catch common agent failure modes"
4
4
  icon: shield
5
5
  ---
6
6
 
7
- failproofai ships with 35+ built-in security policies. Each policy fires on a specific hook event type and tool name. Eight policies accept parameters that let you tune their behavior without writing code.
7
+ failproofai ships with 30 built-in policies that catch common agent failure modes. Each policy fires on a specific hook event type and tool name. Nine policies accept parameters that let you tune their behavior without writing code. Four beta workflow policies enforce a commit → push → PR → CI pipeline before Claude stops.
8
8
 
9
9
  ---
10
10
 
@@ -21,13 +21,19 @@ Policies are grouped into categories:
21
21
  | [Git](#git) | block-push-master, block-work-on-main, block-force-push, warn-git-amend, warn-git-stash-drop, warn-all-files-staged | PreToolUse |
22
22
  | [Database](#database) | warn-destructive-sql, warn-schema-alteration | PreToolUse |
23
23
  | [Warnings](#warnings) | warn-large-file-write, warn-package-publish, warn-background-process, warn-global-package-install | PreToolUse |
24
+ | [Workflow (beta)](#workflow-beta) | require-commit-before-stop, require-push-before-stop, require-pr-before-stop, require-ci-green-before-stop | Stop |
24
25
 
25
- Policies that start with `block-` return a **deny** decision (Claude cannot proceed). Policies that start with `warn-` return an **instruct** decision (Claude gets extra context but can proceed). Policies that start with `sanitize-` also return deny but fire after tool execution to redact secrets from output before Claude sees it.
26
+ - **`block-`** stop the agent from proceeding.
27
+ - **`warn-`** — give the agent additional context so it can self-correct.
28
+ - **`sanitize-`** — scrub sensitive data from tool output before the agent sees it.
29
+ - **`require-`** — block the Stop event until conditions are met.
26
30
 
27
31
  ---
28
32
 
29
33
  ## Dangerous commands
30
34
 
35
+ Prevent agents from running operations that are hard to undo or that could damage the host system.
36
+
31
37
  ### `block-sudo`
32
38
 
33
39
  **Event:** PreToolUse (Bash)
@@ -55,7 +61,9 @@ Blocks invocations that include the `sudo` keyword. Pattern matching is done on
55
61
 
56
62
  With this config, `sudo systemctl status nginx` is allowed, but `sudo rm /etc/hosts` is denied.
57
63
 
58
- > **Security note:** Patterns are matched against parsed tokens, not the raw command string. This prevents bypass via appended shell operators (e.g. `sudo systemctl status x; rm -rf /` does not match `sudo systemctl status *`).
64
+ <Note>
65
+ Patterns are matched against parsed tokens, not the raw command string. This prevents bypass via appended shell operators (e.g. `sudo systemctl status x; rm -rf /` does not match `sudo systemctl status *`).
66
+ </Note>
59
67
 
60
68
  ---
61
69
 
@@ -96,7 +104,7 @@ No parameters.
96
104
  ### `block-failproofai-commands`
97
105
 
98
106
  **Event:** PreToolUse (Bash)
99
- **Default:** Denies commands that would uninstall or disable failproofai itself (e.g. `npm uninstall failproofai`, `failproofai --remove-policies`).
107
+ **Default:** Denies commands that would uninstall or disable failproofai itself (e.g. `npm uninstall failproofai`, `failproofai policies --uninstall`).
100
108
 
101
109
  No parameters.
102
110
 
@@ -104,7 +112,7 @@ No parameters.
104
112
 
105
113
  ## Secrets (sanitizers)
106
114
 
107
- Sanitizer policies fire on **PostToolUse** events. When Claude runs a Bash command, reads a file, or calls any tool, these policies inspect the output before it is returned to Claude. If a secret pattern is detected, the policy returns a deny decision that prevents the output from being passed back.
115
+ Stop agents from leaking credentials into their context or output. Sanitizer policies fire on **PostToolUse** events. When Claude runs a Bash command, reads a file, or calls any tool, these policies inspect the output before it is returned to Claude. If a secret pattern is detected, the policy returns a deny decision that prevents the output from being passed back.
108
116
 
109
117
  ### `sanitize-jwt`
110
118
 
@@ -172,12 +180,14 @@ No parameters.
172
180
 
173
181
  ## Environment
174
182
 
183
+ Protect sensitive environment configuration from being read or exposed by agents.
184
+
175
185
  ### `block-env-files`
176
186
 
177
187
  **Event:** PreToolUse (Bash, Read)
178
188
  **Default:** Denies reading `.env` files via `cat .env`, `Read` tool calls with `.env` as the file path, etc.
179
189
 
180
- Does not block `.envrc` or other environment-adjacent files only files named exactly `.env`.
190
+ Does not block `.envrc` or other environment-adjacent files - only files named exactly `.env`.
181
191
 
182
192
  No parameters.
183
193
 
@@ -194,6 +204,8 @@ No parameters.
194
204
 
195
205
  ## File access
196
206
 
207
+ Keep agents working inside project boundaries and away from sensitive files.
208
+
197
209
  ### `block-read-outside-cwd`
198
210
 
199
211
  **Event:** PreToolUse (Read, Bash)
@@ -246,6 +258,8 @@ No parameters.
246
258
 
247
259
  ## Git
248
260
 
261
+ Prevent accidental pushes, force-pushes, and branch mistakes that are hard to undo.
262
+
249
263
  ### `block-push-master`
250
264
 
251
265
  **Event:** PreToolUse (Bash)
@@ -269,7 +283,9 @@ No parameters.
269
283
  }
270
284
  ```
271
285
 
272
- > To allow pushing to all branches (effectively disabling this policy without removing it from `enabledPolicies`), set `protectedBranches: []`.
286
+ <Tip>
287
+ To allow pushing to all branches (effectively disabling this policy without removing it from `enabledPolicies`), set `protectedBranches: []`.
288
+ </Tip>
273
289
 
274
290
  ---
275
291
 
@@ -324,6 +340,8 @@ No parameters.
324
340
 
325
341
  ## Database
326
342
 
343
+ Catch destructive SQL operations before they execute against your database.
344
+
327
345
  ### `warn-destructive-sql`
328
346
 
329
347
  **Event:** PreToolUse (Bash)
@@ -344,6 +362,8 @@ No parameters.
344
362
 
345
363
  ## Warnings
346
364
 
365
+ Give agents extra context before potentially risky but non-destructive operations.
366
+
347
367
  ### `warn-large-file-write`
348
368
 
349
369
  **Event:** PreToolUse (Write)
@@ -367,7 +387,9 @@ No parameters.
367
387
  }
368
388
  ```
369
389
 
370
- > **Note:** The hook handler enforces a 1 MB stdin limit on payloads. To test this policy with small content, set `thresholdKb` to a value well below 1024.
390
+ <Note>
391
+ The hook handler enforces a 1 MB stdin limit on payloads. To test this policy with small content, set `thresholdKb` to a value well below 1024.
392
+ </Note>
371
393
 
372
394
  ---
373
395
 
@@ -398,15 +420,115 @@ No parameters.
398
420
 
399
421
  ---
400
422
 
423
+ ## AI behavior
424
+
425
+ Detect when agents get stuck or behave unexpectedly.
426
+
427
+ ### `warn-repeated-tool-calls`
428
+
429
+ **Event:** PreToolUse (all tools)
430
+ **Default:** Instructs Claude to reconsider when the same tool is called 3+ times with identical parameters - a common sign the agent is stuck in a loop.
431
+
432
+ No parameters.
433
+
434
+ ---
435
+
436
+ ## Workflow (beta)
437
+
438
+ Enforce a disciplined end-of-session workflow. These policies fire on the **Stop** event and deny Claude from stopping until each condition is met. They follow a natural dependency chain: commit → push → PR → CI. If a policy denies, later policies in the chain are skipped (deny short-circuits).
439
+
440
+ All workflow policies are **fail-open**: if the required tool is not available (e.g. `gh` not installed, no git remote), the policy allows with an informational message explaining why the check was skipped.
441
+
442
+ ### `require-commit-before-stop`
443
+
444
+ **Event:** Stop
445
+ **Default:** Denies stopping when there are uncommitted changes (modified, staged, or untracked files). Returns an informational message when the working directory is clean.
446
+
447
+ No parameters.
448
+
449
+ ---
450
+
451
+ ### `require-push-before-stop`
452
+
453
+ **Event:** Stop
454
+ **Default:** Denies stopping when there are unpushed commits or when the current branch has no remote tracking branch. Suggests `git push -u` to create a tracking branch if needed. Fails open if no remote is configured.
455
+
456
+ **Parameters:**
457
+
458
+ | Param | Type | Default | Description |
459
+ |-------|------|---------|-------------|
460
+ | `remote` | `string` | `"origin"` | Remote name to push to. |
461
+
462
+ **Example:**
463
+
464
+ ```json
465
+ {
466
+ "policyParams": {
467
+ "require-push-before-stop": {
468
+ "remote": "upstream"
469
+ }
470
+ }
471
+ }
472
+ ```
473
+
474
+ ---
475
+
476
+ ### `require-pr-before-stop`
477
+
478
+ **Event:** Stop
479
+ **Default:** Denies stopping when no pull request exists for the current branch, or when the existing PR is closed/merged. Instructs Claude to create a PR with `gh pr create`.
480
+
481
+ No parameters.
482
+
483
+ <Note>
484
+ This policy requires [GitHub CLI](https://cli.github.com/) (`gh`) to be installed and authenticated.
485
+ Run `gh auth login` with a personal access token that has `repo` scope for read access to
486
+ pull requests. If `gh` is not installed or not authenticated, the policy fails open and reports the reason to Claude.
487
+ </Note>
488
+
489
+ ---
490
+
491
+ ### `require-ci-green-before-stop`
492
+
493
+ **Event:** Stop
494
+ **Default:** Denies stopping when CI checks are failing or still running on the current branch. Treats `skipped` conclusions as success. Returns an informational message when all checks pass.
495
+
496
+ No parameters.
497
+
498
+ <Note>
499
+ This policy requires [GitHub CLI](https://cli.github.com/) (`gh`) to be installed and authenticated.
500
+ Run `gh auth login` with a personal access token that has `repo` scope for read access to
501
+ Actions workflow runs. If `gh` is not installed or not authenticated, the policy fails open and reports the reason to Claude.
502
+ </Note>
503
+
504
+ ---
505
+
401
506
  ## Beta policies
402
507
 
403
- Some policies are marked `beta` and are not installed by default. To include them:
508
+ Some policies are marked `beta` and are not installed by default. Beta policies may have rough edges or generate false positives. They graduate to stable in future releases.
509
+
510
+ **Current beta policies:**
511
+
512
+ - `require-commit-before-stop` — commit all changes before stopping
513
+ - `require-push-before-stop` — push all commits to remote
514
+ - `require-pr-before-stop` — ensure a PR exists for the branch
515
+ - `require-ci-green-before-stop` — all CI checks must pass
516
+
517
+ Together, these enforce a **commit → push → PR → CI** workflow.
518
+
519
+ To install all beta policies:
520
+
521
+ ```bash
522
+ failproofai policies --install --beta
523
+ ```
524
+
525
+ Or install specific workflow policies:
404
526
 
405
527
  ```bash
406
- failproofai --install-policies --beta
528
+ failproofai policies --install require-commit-before-stop require-push-before-stop require-pr-before-stop require-ci-green-before-stop
407
529
  ```
408
530
 
409
- Beta policies may have rough edges or generate false positives. Use `failproofai --list-policies` to see which policies carry the beta flag.
531
+ Run `failproofai policies` to see which policies carry the beta flag.
410
532
 
411
533
  ---
412
534
 
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: View sessions
3
+ description: "Launch the dashboard to browse agent sessions and manage policies"
4
+ ---
5
+
6
+ ```bash
7
+ failproofai
8
+ ```
9
+
10
+ Starts the web dashboard at `http://localhost:8020`.
11
+
12
+ ## Options
13
+
14
+ | Flag | Description |
15
+ |------|-------------|
16
+ | `--port <number>` | Port to listen on (default: `8020`) |
17
+ | `--projects-path <path>` | Override where Claude Code project folders are found |
18
+ | `--allowed-origins <origins>` | Comma-separated hosts/IPs allowed to access dev resources |
19
+
20
+ ## Examples
21
+
22
+ ```bash
23
+ # Launch on a different port
24
+ failproofai --port 9000
25
+
26
+ # Use a custom projects path
27
+ failproofai --projects-path ~/my-claude-projects
28
+ ```
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: Environment variables
3
+ description: "Configure failproofai behavior with environment variables"
4
+ ---
5
+
6
+ ## Dashboard
7
+
8
+ | Variable | Description |
9
+ |----------|-------------|
10
+ | `PORT` | Dashboard port (default: `8020`) |
11
+ | `CLAUDE_PROJECTS_PATH` | Override where Claude Code project folders are found |
12
+ | `FAILPROOFAI_DISABLE_PAGES=policies,projects` | Comma-separated dashboard pages to hide |
13
+ | `FAILPROOFAI_ALLOWED_DEV_ORIGINS` | Hosts/IPs allowed to access dev resources. Same as `--allowed-origins`. |
14
+
15
+ ## Logging
16
+
17
+ | Variable | Description |
18
+ |----------|-------------|
19
+ | `FAILPROOFAI_LOG_LEVEL=info\|warn\|error` | Server log level (default: `warn`) |
20
+ | `FAILPROOFAI_HOOK_LOG_FILE` | Custom hook log file path, or `true` for default (`~/.failproofai/logs/hooks.log`) |
21
+
22
+ ## Telemetry
23
+
24
+ | Variable | Description |
25
+ |----------|-------------|
26
+ | `FAILPROOFAI_TELEMETRY_DISABLED=1` | Disable anonymous usage telemetry |
27
+
28
+ ## LLM (for policy evaluation)
29
+
30
+ | Variable | Description |
31
+ |----------|-------------|
32
+ | `FAILPROOFAI_LLM_BASE_URL` | LLM API endpoint (default: `https://api.openai.com/v1`) |
33
+ | `FAILPROOFAI_LLM_API_KEY` | API key for LLM-powered policies |
34
+ | `FAILPROOFAI_LLM_MODEL` | Model name (default: `gpt-4o-mini`) |
@@ -0,0 +1,30 @@
1
+ ---
2
+ title: Hook handler (internal)
3
+ description: "The subprocess Claude Code calls on each tool event"
4
+ ---
5
+
6
+ ```bash
7
+ failproofai --hook <EventType>
8
+ ```
9
+
10
+ This is the command registered in Claude Code's `settings.json` by `failproofai policies --install`. You don't normally call this directly.
11
+
12
+ Reads a JSON payload from stdin, evaluates all enabled policies, and exits with a code indicating the decision:
13
+
14
+ | Exit code | Decision | Effect |
15
+ |-----------|----------|--------|
16
+ | `0` | `allow` | Permit the action |
17
+ | `1` | `deny` | Block the action - Claude sees the denial reason |
18
+ | `2` | `instruct` | Inject guidance into Claude's context |
19
+
20
+ ### Supported event types
21
+
22
+ | Category | Events |
23
+ |----------|--------|
24
+ | **Tool execution** | `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `PermissionDenied` |
25
+ | **Session lifecycle** | `SessionStart`, `SessionEnd`, `Stop`, `StopFailure` |
26
+ | **User interaction** | `UserPromptSubmit`, `Notification`, `Elicitation`, `ElicitationResult` |
27
+ | **Subagents & tasks** | `SubagentStart`, `SubagentStop`, `TaskCreated`, `TaskCompleted`, `TeammateIdle` |
28
+ | **Configuration** | `InstructionsLoaded`, `ConfigChange`, `CwdChanged` |
29
+ | **File system** | `FileChanged`, `WorktreeCreate`, `WorktreeRemove` |
30
+ | **Context** | `PreCompact`, `PostCompact` |
@@ -0,0 +1,48 @@
1
+ ---
2
+ title: Install policies
3
+ description: "Enable policies so they run on every agent tool call"
4
+ ---
5
+
6
+ ```bash
7
+ failproofai policies --install [policy-names...] [options]
8
+ ```
9
+
10
+ Writes hook entries into Claude Code's `settings.json` so failproofai intercepts tool calls.
11
+
12
+ Aliases: `failproofai p -i`
13
+
14
+ ## Options
15
+
16
+ | Flag | Description |
17
+ |------|-------------|
18
+ | `--scope user` | Install into `~/.claude/settings.json` (default - all sessions) |
19
+ | `--scope project` | Install into `.claude/settings.json` in the current directory |
20
+ | `--scope local` | Install into `.claude/settings.local.json` in the current directory |
21
+ | `--custom <path>` / `-c` | Path to a JS file containing custom hook policies |
22
+ | `--beta` | Include beta policies |
23
+
24
+ ## Behavior
25
+
26
+ - **No policy names** - opens an interactive prompt to select policies
27
+ - **Specific names** - enables those policies (added to any already enabled)
28
+ - **`all`** - enables every available policy
29
+
30
+ Installation is additive: running `--install` again adds new policies without removing existing ones.
31
+
32
+ ## Examples
33
+
34
+ ```bash
35
+ # Install all default policies globally (interactive)
36
+ failproofai policies --install
37
+
38
+ # Install specific policies for the current project
39
+ failproofai policies --install block-sudo sanitize-api-keys --scope project
40
+
41
+ # Enable all policies at once
42
+ failproofai policies --install all
43
+
44
+ # Install with a custom policies file
45
+ failproofai policies --install --custom ./my-policies.js
46
+ ```
47
+
48
+ When `--custom <path>` is provided, the file is validated immediately - it must call `customPolicies.add()` at least once. The resolved path is saved to `policies-config.json` as `customPoliciesPath`.
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: List policies
3
+ description: "See which policies are enabled, their parameters, and custom policies"
4
+ ---
5
+
6
+ ```bash
7
+ failproofai policies
8
+ ```
9
+
10
+ Shows all policies with their status, configured parameters, and custom policies.
11
+
12
+ ## Sample output
13
+
14
+ ```text
15
+ Failproof AI Hook Policies (user)
16
+
17
+ Status Name Description
18
+ ────── ──────────────────────────────────────────────────────────────
19
+ ✓ block-sudo Block sudo commands
20
+ allowPatterns: ["sudo systemctl status"]
21
+ ✓ block-rm-rf Block recursive deletions
22
+ ✗ block-curl-pipe-sh Block curl|bash patterns
23
+ ✓ sanitize-api-keys Redact API keys from output
24
+ additionalPatterns: [{ regex: "MY_TOKEN_...", label: "..." }]
25
+
26
+ ── Custom Policies (/home/alice/myproject/my-policies.js) ──────────────
27
+ ✓ require-jira-ticket Block commits without ticket
28
+ ✓ approval-gate Approval gate for destructive ops
29
+ ```
30
+
31
+ Unknown keys in `policyParams` are flagged here so you can catch typos early.
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: Uninstall policies
3
+ description: "Remove hook entries from Claude Code's settings"
4
+ ---
5
+
6
+ ```bash
7
+ failproofai policies --uninstall [policy-names...] [options]
8
+ ```
9
+
10
+ Removes failproofai hook entries from Claude Code's `settings.json`.
11
+
12
+ Aliases: `failproofai p -u`
13
+
14
+ ## Options
15
+
16
+ | Flag | Description |
17
+ |------|-------------|
18
+ | `--scope user` | Remove from global settings (default) |
19
+ | `--scope project` | Remove from project settings |
20
+ | `--scope local` | Remove from local settings |
21
+ | `--scope all` | Remove from all scopes at once |
22
+ | `--custom` / `-c` | Clear the `customPoliciesPath` from config |
23
+ | `--beta` | Remove only beta policies from config |
24
+
25
+ ## Behavior
26
+
27
+ - **No policy names** - removes all failproofai hook entries from the settings file
28
+ - **Specific names** - disables those policies but keeps hooks installed
29
+
30
+ ## Examples
31
+
32
+ ```bash
33
+ # Remove all hooks globally
34
+ failproofai policies --uninstall
35
+
36
+ # Disable a specific policy (keeps hooks installed)
37
+ failproofai policies --uninstall block-sudo
38
+
39
+ # Remove hooks from every scope
40
+ failproofai policies --uninstall --scope all
41
+
42
+ # Clear custom policies path
43
+ failproofai policies --uninstall --custom
44
+ ```
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: Check version
3
+ description: "Print the installed failproofai version"
4
+ ---
5
+
6
+ ```bash
7
+ failproofai --version
8
+ # or
9
+ failproofai -v
10
+ ```
11
+
12
+ Prints the installed version number.
@@ -4,7 +4,7 @@ description: "Config file format, three-scope system, and merge rules"
4
4
  icon: gear
5
5
  ---
6
6
 
7
- failproofai uses JSON configuration files to control which policies are active, how they behave, and where custom hooks are loaded from.
7
+ failproofai uses JSON configuration files to control which policies are active, how they behave, and where custom policies are loaded from. Configuration is designed to be easy to share with your team - commit it to your repo and every developer gets the same agent safety net.
8
8
 
9
9
  ---
10
10
 
@@ -22,9 +22,9 @@ When failproofai receives a hook event, it loads and merges all three files that
22
22
 
23
23
  ### Merge rules
24
24
 
25
- **`enabledPolicies`** the union of all three scopes. A policy enabled at any level is active.
25
+ **`enabledPolicies`** - the union of all three scopes. A policy enabled at any level is active.
26
26
 
27
- ```
27
+ ```text
28
28
  project: ["block-sudo"]
29
29
  local: ["block-rm-rf"]
30
30
  global: ["block-sudo", "sanitize-api-keys"]
@@ -32,16 +32,16 @@ global: ["block-sudo", "sanitize-api-keys"]
32
32
  resolved: ["block-sudo", "block-rm-rf", "sanitize-api-keys"] ← deduplicated union
33
33
  ```
34
34
 
35
- **`policyParams`** first scope that defines params for a given policy wins entirely. There is no deep merging of values within a policy's params.
35
+ **`policyParams`** - first scope that defines params for a given policy wins entirely. There is no deep merging of values within a policy's params.
36
36
 
37
- ```
37
+ ```text
38
38
  project: block-sudo → { allowPatterns: ["sudo apt-get update"] }
39
39
  global: block-sudo → { allowPatterns: ["sudo systemctl status"] }
40
40
 
41
41
  resolved: { allowPatterns: ["sudo apt-get update"] } ← project wins, global ignored
42
42
  ```
43
43
 
44
- ```
44
+ ```text
45
45
  project: (no block-sudo entry)
46
46
  local: (no block-sudo entry)
47
47
  global: block-sudo → { allowPatterns: ["sudo systemctl status"] }
@@ -49,9 +49,9 @@ global: block-sudo → { allowPatterns: ["sudo systemctl status"] }
49
49
  resolved: { allowPatterns: ["sudo systemctl status"] } ← falls through to global
50
50
  ```
51
51
 
52
- **`customPoliciesPath`** first scope that defines it wins.
52
+ **`customPoliciesPath`** - first scope that defines it wins.
53
53
 
54
- **`llm`** first scope that defines it wins.
54
+ **`llm`** - first scope that defines it wins.
55
55
 
56
56
  ---
57
57
 
@@ -102,7 +102,7 @@ resolved: { allowPatterns: ["sudo systemctl status"] } ← falls through to glo
102
102
 
103
103
  Type: `string[]`
104
104
 
105
- List of policy names to enable. Names must match exactly the policy identifiers shown in `failproofai --list-policies`. See [Built-in Policies](./built-in-policies.md) for the full list.
105
+ List of policy names to enable. Names must match exactly the policy identifiers shown by `failproofai policies`. See [Built-in Policies](/built-in-policies) for the full list.
106
106
 
107
107
  Policies not in `enabledPolicies` are inactive, even if they have entries in `policyParams`.
108
108
 
@@ -110,19 +110,19 @@ Policies not in `enabledPolicies` are inactive, even if they have entries in `po
110
110
 
111
111
  Type: `Record<string, Record<string, unknown>>`
112
112
 
113
- Per-policy parameter overrides. The outer key is the policy name; the inner keys are policy-specific. Each policy documents its available parameters in [Built-in Policies](./built-in-policies.md).
113
+ Per-policy parameter overrides. The outer key is the policy name; the inner keys are policy-specific. Each policy documents its available parameters in [Built-in Policies](/built-in-policies).
114
114
 
115
115
  If a policy has parameters but you don't specify them, the policy's built-in defaults are used. Users who do not configure `policyParams` at all get identical behavior to previous versions.
116
116
 
117
- Unknown keys inside a policy's params block are silently ignored at hook-fire time but flagged as warnings when you run `failproofai --list-policies`.
117
+ Unknown keys inside a policy's params block are silently ignored at hook-fire time but flagged as warnings when you run `failproofai policies`.
118
118
 
119
119
  ### `customPoliciesPath`
120
120
 
121
121
  Type: `string` (absolute path)
122
122
 
123
- Path to a JavaScript file containing custom hook policies. This is set automatically by `failproofai --install-policies --custom <path>` (the path is resolved to absolute before being stored).
123
+ Path to a JavaScript file containing custom hook policies. This is set automatically by `failproofai policies --install --custom <path>` (the path is resolved to absolute before being stored).
124
124
 
125
- The file is loaded fresh on every hook event there is no caching. See [Custom Hooks](./custom-hooks.md) for authoring details.
125
+ The file is loaded fresh on every hook event - there is no caching. See [Custom Policies](/custom-policies) for authoring details.
126
126
 
127
127
  ### `llm`
128
128
 
@@ -143,10 +143,10 @@ LLM client configuration for policies that make AI calls. Not required for most
143
143
 
144
144
  ## Managing configuration from the CLI
145
145
 
146
- The `--install-policies` and `--remove-policies` commands write to Claude Code's `settings.json` (the hook entry points), while `policies-config.json` is the file you manage directly. The two are separate:
146
+ The `policies --install` and `policies --uninstall` commands write to Claude Code's `settings.json` (the hook entry points), while `policies-config.json` is the file you manage directly. The two are separate:
147
147
 
148
- - **`settings.json`** tells Claude Code to call `failproofai --hook <event>` on each tool use
149
- - **`policies-config.json`** tells failproofai which policies to evaluate and with what params
148
+ - **`settings.json`** - tells Claude Code to call `failproofai --hook <event>` on each tool use
149
+ - **`policies-config.json`** - tells failproofai which policies to evaluate and with what params
150
150
 
151
151
  You can edit `policies-config.json` directly at any time; changes take effect immediately on the next hook event with no restart needed.
152
152