failproofai 0.0.2 → 0.0.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.
- package/.next/standalone/.claude/settings.json +316 -0
- package/.next/standalone/.failproofai/policies/workflow-policies.mjs +62 -0
- package/.next/standalone/.failproofai/policies-config.json +39 -0
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +5 -5
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +3 -1
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +17 -17
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +17 -17
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +16 -16
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +11 -11
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kjo7d_._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_05pz9._._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__12kr5~_._.js → [root-of-the-server]__03kiqd5._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0qo8503._.js → [root-of-the-server]__0bo8s~-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +9 -9
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0a_7sdg.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0ef3uwk.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0j79~gv.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0pbja1x.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0r6o0i2.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_11y81~_.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_12or2kf.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0mebn66._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +5 -5
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
- package/.next/standalone/.next/static/chunks/{0x-625~1vx1lu.js → 02t9.s735hqyq.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0ov60i6md~37t.js → 03oepxbqx6o8~.js} +2 -2
- package/.next/standalone/.next/static/chunks/{031pa5~qfzt~_.js → 09e7drilkf1sn.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0y~0creqvl5wx.js → 0cwft44dh9bww.js} +1 -1
- package/.next/standalone/.next/static/chunks/{06og.7e9nkpjh.js → 0e2uz2g026ckb.js} +1 -1
- package/.next/standalone/.next/static/chunks/0gu_a.a80ritd.css +1 -0
- package/.next/standalone/.next/static/chunks/{15wf7x-e.8ia3.js → 0h5kbvg~.xf.v.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0_4y_t03jn2nq.js → 0od..umlku4bb.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0cvffh-pbsv5u.js → 0xbwzy4dl87-0.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0c_ljlxa._4lc.js → 18cl6wups7ouq.js} +2 -2
- package/.next/standalone/.next/static/chunks/{turbopack-0uc5y~g6h.n7-.js → turbopack-0r26pc8h0y_-e.js} +1 -1
- package/.next/standalone/CHANGELOG.md +103 -0
- package/.next/standalone/CLAUDE.md +28 -0
- package/.next/standalone/Dockerfile.docs +12 -0
- package/.next/standalone/README.md +95 -49
- package/.next/standalone/app/components/session-hooks-panel.tsx +14 -1
- package/.next/standalone/app/policies/hooks-client.tsx +14 -1
- package/.next/standalone/bin/failproofai.mjs +5 -0
- package/.next/standalone/bun.lock +76 -63
- package/.next/standalone/components/navbar.tsx +5 -0
- package/.next/standalone/dist/cli.mjs +539 -90
- package/.next/standalone/dist/index.js +2 -2
- package/.next/standalone/docs/ar/architecture.mdx +333 -0
- package/.next/standalone/docs/ar/built-in-policies.mdx +566 -0
- package/.next/standalone/docs/ar/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/ar/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/ar/cli/hook.mdx +31 -0
- package/.next/standalone/docs/ar/cli/install-policies.mdx +49 -0
- package/.next/standalone/docs/ar/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/ar/cli/remove-policies.mdx +45 -0
- package/.next/standalone/docs/ar/cli/version.mdx +13 -0
- package/.next/standalone/docs/ar/configuration.mdx +223 -0
- package/.next/standalone/docs/ar/custom-policies.mdx +359 -0
- package/.next/standalone/docs/ar/dashboard.mdx +142 -0
- package/.next/standalone/docs/ar/examples.mdx +254 -0
- package/.next/standalone/docs/ar/for-agents.mdx +39 -0
- package/.next/standalone/docs/ar/getting-started.mdx +134 -0
- package/.next/standalone/docs/ar/introduction.mdx +58 -0
- package/.next/standalone/docs/ar/package-aliases.mdx +82 -0
- package/.next/standalone/docs/ar/testing.mdx +261 -0
- package/.next/standalone/docs/{architecture.md → architecture.mdx} +40 -23
- package/.next/standalone/docs/{built-in-policies.md → built-in-policies.mdx} +151 -13
- package/.next/standalone/docs/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/cli/hook.mdx +30 -0
- package/.next/standalone/docs/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/cli/version.mdx +12 -0
- package/.next/standalone/docs/{configuration.md → configuration.mdx} +62 -16
- package/.next/standalone/docs/custom-policies.mdx +357 -0
- package/.next/standalone/docs/{dashboard.md → dashboard.mdx} +26 -29
- package/.next/standalone/docs/de/architecture.mdx +332 -0
- package/.next/standalone/docs/de/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/de/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/de/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/de/cli/hook.mdx +30 -0
- package/.next/standalone/docs/de/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/de/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/de/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/de/cli/version.mdx +12 -0
- package/.next/standalone/docs/de/configuration.mdx +222 -0
- package/.next/standalone/docs/de/custom-policies.mdx +357 -0
- package/.next/standalone/docs/de/dashboard.mdx +142 -0
- package/.next/standalone/docs/de/examples.mdx +253 -0
- package/.next/standalone/docs/de/for-agents.mdx +38 -0
- package/.next/standalone/docs/de/getting-started.mdx +134 -0
- package/.next/standalone/docs/de/introduction.mdx +57 -0
- package/.next/standalone/docs/de/package-aliases.mdx +82 -0
- package/.next/standalone/docs/de/testing.mdx +260 -0
- package/.next/standalone/docs/docs.json +938 -24
- package/.next/standalone/docs/es/architecture.mdx +332 -0
- package/.next/standalone/docs/es/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/es/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/es/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/es/cli/hook.mdx +30 -0
- package/.next/standalone/docs/es/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/es/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/es/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/es/cli/version.mdx +12 -0
- package/.next/standalone/docs/es/configuration.mdx +222 -0
- package/.next/standalone/docs/es/custom-policies.mdx +357 -0
- package/.next/standalone/docs/es/dashboard.mdx +142 -0
- package/.next/standalone/docs/es/examples.mdx +253 -0
- package/.next/standalone/docs/es/for-agents.mdx +38 -0
- package/.next/standalone/docs/es/getting-started.mdx +134 -0
- package/.next/standalone/docs/es/introduction.mdx +57 -0
- package/.next/standalone/docs/es/package-aliases.mdx +82 -0
- package/.next/standalone/docs/es/testing.mdx +260 -0
- package/.next/standalone/docs/examples.mdx +253 -0
- package/.next/standalone/docs/for-agents.mdx +38 -0
- package/.next/standalone/docs/fr/architecture.mdx +332 -0
- package/.next/standalone/docs/fr/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/fr/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/fr/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/fr/cli/hook.mdx +30 -0
- package/.next/standalone/docs/fr/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/fr/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/fr/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/fr/cli/version.mdx +12 -0
- package/.next/standalone/docs/fr/configuration.mdx +222 -0
- package/.next/standalone/docs/fr/custom-policies.mdx +357 -0
- package/.next/standalone/docs/fr/dashboard.mdx +142 -0
- package/.next/standalone/docs/fr/examples.mdx +253 -0
- package/.next/standalone/docs/fr/for-agents.mdx +38 -0
- package/.next/standalone/docs/fr/getting-started.mdx +134 -0
- package/.next/standalone/docs/fr/introduction.mdx +57 -0
- package/.next/standalone/docs/fr/package-aliases.mdx +82 -0
- package/.next/standalone/docs/fr/testing.mdx +260 -0
- package/.next/standalone/docs/getting-started.mdx +134 -0
- package/.next/standalone/docs/he/architecture.mdx +333 -0
- package/.next/standalone/docs/he/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/he/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/he/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/he/cli/hook.mdx +30 -0
- package/.next/standalone/docs/he/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/he/cli/list-policies.mdx +32 -0
- package/.next/standalone/docs/he/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/he/cli/version.mdx +12 -0
- package/.next/standalone/docs/he/configuration.mdx +222 -0
- package/.next/standalone/docs/he/custom-policies.mdx +357 -0
- package/.next/standalone/docs/he/dashboard.mdx +142 -0
- package/.next/standalone/docs/he/examples.mdx +253 -0
- package/.next/standalone/docs/he/for-agents.mdx +38 -0
- package/.next/standalone/docs/he/getting-started.mdx +135 -0
- package/.next/standalone/docs/he/introduction.mdx +57 -0
- package/.next/standalone/docs/he/package-aliases.mdx +82 -0
- package/.next/standalone/docs/he/testing.mdx +260 -0
- package/.next/standalone/docs/hi/architecture.mdx +334 -0
- package/.next/standalone/docs/hi/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/hi/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/hi/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/hi/cli/hook.mdx +30 -0
- package/.next/standalone/docs/hi/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/hi/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/hi/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/hi/cli/version.mdx +12 -0
- package/.next/standalone/docs/hi/configuration.mdx +222 -0
- package/.next/standalone/docs/hi/custom-policies.mdx +357 -0
- package/.next/standalone/docs/hi/dashboard.mdx +142 -0
- package/.next/standalone/docs/hi/examples.mdx +255 -0
- package/.next/standalone/docs/hi/for-agents.mdx +38 -0
- package/.next/standalone/docs/hi/getting-started.mdx +134 -0
- package/.next/standalone/docs/hi/introduction.mdx +57 -0
- package/.next/standalone/docs/hi/package-aliases.mdx +82 -0
- package/.next/standalone/docs/hi/testing.mdx +260 -0
- package/.next/standalone/docs/i18n/README.ar.md +312 -0
- package/.next/standalone/docs/i18n/README.de.md +307 -0
- package/.next/standalone/docs/i18n/README.es.md +307 -0
- package/.next/standalone/docs/i18n/README.fr.md +307 -0
- package/.next/standalone/docs/i18n/README.he.md +312 -0
- package/.next/standalone/docs/i18n/README.hi.md +307 -0
- package/.next/standalone/docs/i18n/README.it.md +307 -0
- package/.next/standalone/docs/i18n/README.ja.md +307 -0
- package/.next/standalone/docs/i18n/README.ko.md +307 -0
- package/.next/standalone/docs/i18n/README.pt-br.md +307 -0
- package/.next/standalone/docs/i18n/README.ru.md +308 -0
- package/.next/standalone/docs/i18n/README.tr.md +308 -0
- package/.next/standalone/docs/i18n/README.vi.md +308 -0
- package/.next/standalone/docs/i18n/README.zh.md +307 -0
- package/.next/standalone/docs/introduction.mdx +57 -0
- package/.next/standalone/docs/it/architecture.mdx +333 -0
- package/.next/standalone/docs/it/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/it/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/it/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/it/cli/hook.mdx +30 -0
- package/.next/standalone/docs/it/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/it/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/it/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/it/cli/version.mdx +12 -0
- package/.next/standalone/docs/it/configuration.mdx +223 -0
- package/.next/standalone/docs/it/custom-policies.mdx +358 -0
- package/.next/standalone/docs/it/dashboard.mdx +142 -0
- package/.next/standalone/docs/it/examples.mdx +253 -0
- package/.next/standalone/docs/it/for-agents.mdx +38 -0
- package/.next/standalone/docs/it/getting-started.mdx +134 -0
- package/.next/standalone/docs/it/introduction.mdx +57 -0
- package/.next/standalone/docs/it/package-aliases.mdx +82 -0
- package/.next/standalone/docs/it/testing.mdx +260 -0
- package/.next/standalone/docs/ja/architecture.mdx +332 -0
- package/.next/standalone/docs/ja/built-in-policies.mdx +562 -0
- package/.next/standalone/docs/ja/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/ja/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/ja/cli/hook.mdx +30 -0
- package/.next/standalone/docs/ja/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/ja/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/ja/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/ja/cli/version.mdx +12 -0
- package/.next/standalone/docs/ja/configuration.mdx +222 -0
- package/.next/standalone/docs/ja/custom-policies.mdx +357 -0
- package/.next/standalone/docs/ja/dashboard.mdx +142 -0
- package/.next/standalone/docs/ja/examples.mdx +253 -0
- package/.next/standalone/docs/ja/for-agents.mdx +38 -0
- package/.next/standalone/docs/ja/getting-started.mdx +134 -0
- package/.next/standalone/docs/ja/introduction.mdx +57 -0
- package/.next/standalone/docs/ja/package-aliases.mdx +82 -0
- package/.next/standalone/docs/ja/testing.mdx +260 -0
- package/.next/standalone/docs/ko/architecture.mdx +332 -0
- package/.next/standalone/docs/ko/built-in-policies.mdx +562 -0
- package/.next/standalone/docs/ko/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/ko/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/ko/cli/hook.mdx +30 -0
- package/.next/standalone/docs/ko/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/ko/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/ko/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/ko/cli/version.mdx +12 -0
- package/.next/standalone/docs/ko/configuration.mdx +222 -0
- package/.next/standalone/docs/ko/custom-policies.mdx +357 -0
- package/.next/standalone/docs/ko/dashboard.mdx +142 -0
- package/.next/standalone/docs/ko/examples.mdx +253 -0
- package/.next/standalone/docs/ko/for-agents.mdx +38 -0
- package/.next/standalone/docs/ko/getting-started.mdx +134 -0
- package/.next/standalone/docs/ko/introduction.mdx +57 -0
- package/.next/standalone/docs/ko/package-aliases.mdx +82 -0
- package/.next/standalone/docs/ko/testing.mdx +260 -0
- package/.next/standalone/docs/logo/dark.svg +21 -0
- package/.next/standalone/docs/logo/light.svg +21 -0
- package/.next/standalone/docs/{package-aliases.md → package-aliases.mdx} +5 -5
- package/.next/standalone/docs/pt-br/architecture.mdx +332 -0
- package/.next/standalone/docs/pt-br/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/pt-br/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/pt-br/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/pt-br/cli/hook.mdx +30 -0
- package/.next/standalone/docs/pt-br/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/pt-br/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/pt-br/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/pt-br/cli/version.mdx +12 -0
- package/.next/standalone/docs/pt-br/configuration.mdx +222 -0
- package/.next/standalone/docs/pt-br/custom-policies.mdx +357 -0
- package/.next/standalone/docs/pt-br/dashboard.mdx +142 -0
- package/.next/standalone/docs/pt-br/examples.mdx +253 -0
- package/.next/standalone/docs/pt-br/for-agents.mdx +38 -0
- package/.next/standalone/docs/pt-br/getting-started.mdx +134 -0
- package/.next/standalone/docs/pt-br/introduction.mdx +57 -0
- package/.next/standalone/docs/pt-br/package-aliases.mdx +82 -0
- package/.next/standalone/docs/pt-br/testing.mdx +260 -0
- package/.next/standalone/docs/ru/architecture.mdx +334 -0
- package/.next/standalone/docs/ru/built-in-policies.mdx +562 -0
- package/.next/standalone/docs/ru/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/ru/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/ru/cli/hook.mdx +30 -0
- package/.next/standalone/docs/ru/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/ru/cli/list-policies.mdx +32 -0
- package/.next/standalone/docs/ru/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/ru/cli/version.mdx +12 -0
- package/.next/standalone/docs/ru/configuration.mdx +223 -0
- package/.next/standalone/docs/ru/custom-policies.mdx +357 -0
- package/.next/standalone/docs/ru/dashboard.mdx +142 -0
- package/.next/standalone/docs/ru/examples.mdx +254 -0
- package/.next/standalone/docs/ru/for-agents.mdx +38 -0
- package/.next/standalone/docs/ru/getting-started.mdx +134 -0
- package/.next/standalone/docs/ru/introduction.mdx +57 -0
- package/.next/standalone/docs/ru/package-aliases.mdx +82 -0
- package/.next/standalone/docs/ru/testing.mdx +260 -0
- package/.next/standalone/docs/{testing.md → testing.mdx} +11 -11
- package/.next/standalone/docs/tr/architecture.mdx +333 -0
- package/.next/standalone/docs/tr/built-in-policies.mdx +562 -0
- package/.next/standalone/docs/tr/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/tr/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/tr/cli/hook.mdx +30 -0
- package/.next/standalone/docs/tr/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/tr/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/tr/cli/remove-policies.mdx +45 -0
- package/.next/standalone/docs/tr/cli/version.mdx +12 -0
- package/.next/standalone/docs/tr/configuration.mdx +223 -0
- package/.next/standalone/docs/tr/custom-policies.mdx +357 -0
- package/.next/standalone/docs/tr/dashboard.mdx +142 -0
- package/.next/standalone/docs/tr/examples.mdx +253 -0
- package/.next/standalone/docs/tr/for-agents.mdx +38 -0
- package/.next/standalone/docs/tr/getting-started.mdx +134 -0
- package/.next/standalone/docs/tr/introduction.mdx +57 -0
- package/.next/standalone/docs/tr/package-aliases.mdx +82 -0
- package/.next/standalone/docs/tr/testing.mdx +260 -0
- package/.next/standalone/docs/vi/architecture.mdx +333 -0
- package/.next/standalone/docs/vi/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/vi/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/vi/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/vi/cli/hook.mdx +30 -0
- package/.next/standalone/docs/vi/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/vi/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/vi/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/vi/cli/version.mdx +13 -0
- package/.next/standalone/docs/vi/configuration.mdx +222 -0
- package/.next/standalone/docs/vi/custom-policies.mdx +357 -0
- package/.next/standalone/docs/vi/dashboard.mdx +142 -0
- package/.next/standalone/docs/vi/examples.mdx +253 -0
- package/.next/standalone/docs/vi/for-agents.mdx +38 -0
- package/.next/standalone/docs/vi/getting-started.mdx +134 -0
- package/.next/standalone/docs/vi/introduction.mdx +57 -0
- package/.next/standalone/docs/vi/package-aliases.mdx +82 -0
- package/.next/standalone/docs/vi/testing.mdx +260 -0
- package/.next/standalone/docs/zh/architecture.mdx +332 -0
- package/.next/standalone/docs/zh/built-in-policies.mdx +562 -0
- package/.next/standalone/docs/zh/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/zh/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/zh/cli/hook.mdx +30 -0
- package/.next/standalone/docs/zh/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/zh/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/zh/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/zh/cli/version.mdx +12 -0
- package/.next/standalone/docs/zh/configuration.mdx +222 -0
- package/.next/standalone/docs/zh/custom-policies.mdx +357 -0
- package/.next/standalone/docs/zh/dashboard.mdx +142 -0
- package/.next/standalone/docs/zh/examples.mdx +253 -0
- package/.next/standalone/docs/zh/for-agents.mdx +38 -0
- package/.next/standalone/docs/zh/getting-started.mdx +134 -0
- package/.next/standalone/docs/zh/introduction.mdx +57 -0
- package/.next/standalone/docs/zh/package-aliases.mdx +82 -0
- package/.next/standalone/docs/zh/testing.mdx +260 -0
- package/.next/standalone/examples/convention-policies/security-policies.mjs +40 -0
- package/.next/standalone/examples/convention-policies/workflow-policies.mjs +41 -0
- package/.next/standalone/next.config.ts +5 -3
- package/.next/standalone/node_modules/@next/env/package.json +1 -1
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/jsonwebtoken/index.js +2 -2
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +7 -2
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/render.js +20 -19
- package/.next/standalone/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/.next/standalone/node_modules/next/package.json +15 -15
- package/.next/standalone/node_modules/react/cjs/react.development.js +1 -1
- package/.next/standalone/node_modules/react/cjs/react.production.js +1 -1
- package/.next/standalone/node_modules/react/package.json +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/package.json +2 -2
- package/.next/standalone/package.json +13 -10
- package/.next/standalone/scripts/translate-docs/cache.ts +62 -0
- package/.next/standalone/scripts/translate-docs/cli.ts +357 -0
- package/.next/standalone/scripts/translate-docs/config.ts +248 -0
- package/.next/standalone/scripts/translate-docs/mdx-translator.ts +153 -0
- package/.next/standalone/scripts/translate-docs/mintlify-nav.ts +107 -0
- package/.next/standalone/scripts/translate-docs/readme-translator.ts +154 -0
- package/.next/standalone/scripts/translate-docs/translator.ts +68 -0
- package/.next/standalone/scripts/translate-docs/types.ts +43 -0
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/skills-lock.json +10 -0
- package/.next/standalone/src/hooks/builtin-policies.ts +405 -25
- package/.next/standalone/src/hooks/custom-hooks-loader.ts +165 -21
- package/.next/standalone/src/hooks/handler.ts +33 -6
- package/.next/standalone/src/hooks/hook-activity-store.ts +6 -1
- package/.next/standalone/src/hooks/hooks-config.ts +47 -2
- package/.next/standalone/src/hooks/llm-client.ts +2 -2
- package/.next/standalone/src/hooks/loader-utils.ts +4 -4
- package/.next/standalone/src/hooks/manager.ts +67 -16
- package/.next/standalone/src/hooks/policy-evaluator.ts +58 -19
- package/.next/standalone/src/hooks/policy-helpers.ts +2 -2
- package/.next/standalone/vitest.config.e2e.mts +3 -0
- package/.next/standalone/vitest.config.mts +3 -0
- package/README.md +95 -49
- package/bin/failproofai.mjs +5 -0
- package/dist/cli.mjs +539 -90
- package/dist/index.js +2 -2
- package/package.json +13 -10
- package/scripts/translate-docs/cache.ts +62 -0
- package/scripts/translate-docs/cli.ts +357 -0
- package/scripts/translate-docs/config.ts +248 -0
- package/scripts/translate-docs/mdx-translator.ts +153 -0
- package/scripts/translate-docs/mintlify-nav.ts +107 -0
- package/scripts/translate-docs/readme-translator.ts +154 -0
- package/scripts/translate-docs/translator.ts +68 -0
- package/scripts/translate-docs/types.ts +43 -0
- package/src/hooks/builtin-policies.ts +405 -25
- package/src/hooks/custom-hooks-loader.ts +165 -21
- package/src/hooks/handler.ts +33 -6
- package/src/hooks/hook-activity-store.ts +6 -1
- package/src/hooks/hooks-config.ts +47 -2
- package/src/hooks/llm-client.ts +2 -2
- package/src/hooks/loader-utils.ts +4 -4
- package/src/hooks/manager.ts +67 -16
- package/src/hooks/policy-evaluator.ts +58 -19
- package/src/hooks/policy-helpers.ts +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02nt~6d._.js +0 -3
- package/.next/standalone/.next/static/chunks/15jpradyu_531.css +0 -1
- package/.next/standalone/docs/cli-reference.md +0 -175
- package/.next/standalone/docs/custom-hooks.md +0 -261
- package/.next/standalone/docs/getting-started.md +0 -128
- package/.next/standalone/docs/introduction.md +0 -47
- /package/.next/standalone/.next/static/{WS-OQSqL1Lp1w_obXfjvl → En9eEShUkUjgeYbY9v6Gy}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{WS-OQSqL1Lp1w_obXfjvl → En9eEShUkUjgeYbY9v6Gy}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{WS-OQSqL1Lp1w_obXfjvl → En9eEShUkUjgeYbY9v6Gy}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 内置策略
|
|
3
|
+
description: "涵盖常见智能体失败模式的全部 30 条内置策略"
|
|
4
|
+
icon: shield
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
failproofai 内置了 30 条策略,用于捕获常见的智能体失败模式。每条策略会在特定的钩子事件类型和工具名称上触发。其中九条策略支持参数配置,让你无需编写代码即可调整其行为。四条 beta 工作流策略会强制执行提交 → 推送 → PR → CI 流水线,直至 Claude 停止运行。
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 概览
|
|
12
|
+
|
|
13
|
+
策略按类别分组如下:
|
|
14
|
+
|
|
15
|
+
| 类别 | 策略 | 钩子类型 |
|
|
16
|
+
|------|------|---------|
|
|
17
|
+
| [危险命令](#dangerous-commands) | block-sudo, block-rm-rf, block-curl-pipe-sh, block-failproofai-commands | PreToolUse |
|
|
18
|
+
| [密钥(清理器)](#secrets-sanitizers) | sanitize-jwt, sanitize-api-keys, sanitize-connection-strings, sanitize-private-key-content, sanitize-bearer-tokens | PostToolUse |
|
|
19
|
+
| [环境变量](#environment) | block-env-files, protect-env-vars | PreToolUse |
|
|
20
|
+
| [文件访问](#file-access) | block-read-outside-cwd, block-secrets-write | PreToolUse |
|
|
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
|
+
| [数据库](#database) | warn-destructive-sql, warn-schema-alteration | PreToolUse |
|
|
23
|
+
| [警告](#warnings) | warn-large-file-write, warn-package-publish, warn-background-process, warn-global-package-install | PreToolUse |
|
|
24
|
+
| [工作流(beta)](#workflow-beta) | require-commit-before-stop, require-push-before-stop, require-pr-before-stop, require-ci-green-before-stop | Stop |
|
|
25
|
+
|
|
26
|
+
- **`block-`** — 阻止智能体继续执行。
|
|
27
|
+
- **`warn-`** — 向智能体提供额外上下文,使其能够自我纠正。
|
|
28
|
+
- **`sanitize-`** — 在智能体读取工具输出之前,清除其中的敏感数据。
|
|
29
|
+
- **`require-`** — 在满足条件之前阻止 Stop 事件触发。
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
<Tip>
|
|
34
|
+
每条策略均支持在 `policyParams` 中配置可选的 `hint` 字段。该提示会附加到 Claude 收到的 deny 或 instruct 消息中,提供可操作的指导,无需修改策略代码。适用于内置策略、自定义策略和约定策略。详情请参阅 [配置 → hint](/zh/configuration#hint-cross-cutting)。
|
|
35
|
+
</Tip>
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 危险命令
|
|
40
|
+
|
|
41
|
+
防止智能体执行难以撤销或可能损坏宿主系统的操作。
|
|
42
|
+
|
|
43
|
+
### `block-sudo`
|
|
44
|
+
|
|
45
|
+
**事件:** PreToolUse (Bash)
|
|
46
|
+
**默认行为:** 拒绝任何包含 `sudo` 的命令。
|
|
47
|
+
|
|
48
|
+
阻止包含 `sudo` 关键字的调用。模式匹配基于解析后的命令令牌(而非原始字符串),以防止通过 shell 运算符注入绕过检测。
|
|
49
|
+
|
|
50
|
+
**参数:**
|
|
51
|
+
|
|
52
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
53
|
+
|------|------|--------|------|
|
|
54
|
+
| `allowPatterns` | `string[]` | `[]` | 允许执行的精确命令前缀。每条记录与解析后的 argv 令牌进行匹配。 |
|
|
55
|
+
|
|
56
|
+
**示例:**
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"policyParams": {
|
|
61
|
+
"block-sudo": {
|
|
62
|
+
"allowPatterns": ["sudo systemctl status", "sudo journalctl"]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
使用此配置后,`sudo systemctl status nginx` 将被允许,但 `sudo rm /etc/hosts` 将被拒绝。
|
|
69
|
+
|
|
70
|
+
<Note>
|
|
71
|
+
模式匹配基于解析后的令牌,而非原始命令字符串。这可以防止通过附加 shell 运算符绕过检测(例如,`sudo systemctl status x; rm -rf /` 不会匹配 `sudo systemctl status *`)。
|
|
72
|
+
</Note>
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### `block-rm-rf`
|
|
77
|
+
|
|
78
|
+
**事件:** PreToolUse (Bash)
|
|
79
|
+
**默认行为:** 拒绝 `rm -rf`、`rm -fr` 及类似的递归删除形式。
|
|
80
|
+
|
|
81
|
+
**参数:**
|
|
82
|
+
|
|
83
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
84
|
+
|------|------|--------|------|
|
|
85
|
+
| `allowPaths` | `string[]` | `[]` | 允许递归删除的安全路径(例如 `/tmp`)。 |
|
|
86
|
+
|
|
87
|
+
**示例:**
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"policyParams": {
|
|
92
|
+
"block-rm-rf": {
|
|
93
|
+
"allowPaths": ["/tmp", "/var/cache"]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### `block-curl-pipe-sh`
|
|
102
|
+
|
|
103
|
+
**事件:** PreToolUse (Bash)
|
|
104
|
+
**默认行为:** 拒绝 `curl <url> | bash`、`curl <url> | sh`、`wget <url> | bash` 及类似模式。
|
|
105
|
+
|
|
106
|
+
无参数。
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### `block-failproofai-commands`
|
|
111
|
+
|
|
112
|
+
**事件:** PreToolUse (Bash)
|
|
113
|
+
**默认行为:** 拒绝会卸载或禁用 failproofai 自身的命令(例如 `npm uninstall failproofai`、`failproofai policies --uninstall`)。
|
|
114
|
+
|
|
115
|
+
无参数。
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 密钥(清理器)
|
|
120
|
+
|
|
121
|
+
防止智能体将凭证泄漏到其上下文或输出中。清理器策略在 **PostToolUse** 事件上触发。当 Claude 运行 Bash 命令、读取文件或调用任何工具时,这些策略会在输出返回给 Claude 之前对其进行检查。一旦检测到密钥模式,策略将返回拒绝决定,阻止输出被传回。
|
|
122
|
+
|
|
123
|
+
### `sanitize-jwt`
|
|
124
|
+
|
|
125
|
+
**事件:** PostToolUse(所有工具)
|
|
126
|
+
**默认行为:** 清除 JWT 令牌(由 `.` 分隔的三段 base64url 字符串)。
|
|
127
|
+
|
|
128
|
+
无参数。
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### `sanitize-api-keys`
|
|
133
|
+
|
|
134
|
+
**事件:** PostToolUse(所有工具)
|
|
135
|
+
**默认行为:** 清除常见 API 密钥格式:Anthropic(`sk-ant-`)、OpenAI(`sk-`)、GitHub PAT(`ghp_`)、AWS 访问密钥(`AKIA`)、Stripe 密钥(`sk_live_`、`sk_test_`)以及 Google API 密钥(`AIza`)。
|
|
136
|
+
|
|
137
|
+
**参数:**
|
|
138
|
+
|
|
139
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
140
|
+
|------|------|--------|------|
|
|
141
|
+
| `additionalPatterns` | `{ regex: string; label: string }[]` | `[]` | 需要视为密钥的额外正则表达式模式。 |
|
|
142
|
+
|
|
143
|
+
**示例:**
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"policyParams": {
|
|
148
|
+
"sanitize-api-keys": {
|
|
149
|
+
"additionalPatterns": [
|
|
150
|
+
{ "regex": "myco_[A-Za-z0-9]{32}", "label": "MyCo internal API key" },
|
|
151
|
+
{ "regex": "pat_[0-9a-f]{40}", "label": "Internal PAT" }
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### `sanitize-connection-strings`
|
|
161
|
+
|
|
162
|
+
**事件:** PostToolUse(所有工具)
|
|
163
|
+
**默认行为:** 清除包含嵌入凭证的数据库连接字符串(例如 `postgresql://user:password@host/db`)。
|
|
164
|
+
|
|
165
|
+
无参数。
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
### `sanitize-private-key-content`
|
|
170
|
+
|
|
171
|
+
**事件:** PostToolUse(所有工具)
|
|
172
|
+
**默认行为:** 清除 PEM 块(`-----BEGIN PRIVATE KEY-----`、`-----BEGIN RSA PRIVATE KEY-----` 等)。
|
|
173
|
+
|
|
174
|
+
无参数。
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### `sanitize-bearer-tokens`
|
|
179
|
+
|
|
180
|
+
**事件:** PostToolUse(所有工具)
|
|
181
|
+
**默认行为:** 清除令牌长度不低于 20 个字符的 `Authorization: Bearer <token>` 请求头。
|
|
182
|
+
|
|
183
|
+
无参数。
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## 环境变量
|
|
188
|
+
|
|
189
|
+
防止智能体读取或暴露敏感的环境配置。
|
|
190
|
+
|
|
191
|
+
### `block-env-files`
|
|
192
|
+
|
|
193
|
+
**事件:** PreToolUse (Bash, Read)
|
|
194
|
+
**默认行为:** 拒绝通过 `cat .env`、文件路径为 `.env` 的 `Read` 工具调用等方式读取 `.env` 文件。
|
|
195
|
+
|
|
196
|
+
不会阻止 `.envrc` 或其他环境相关文件,仅阻止名称完全为 `.env` 的文件。
|
|
197
|
+
|
|
198
|
+
无参数。
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### `protect-env-vars`
|
|
203
|
+
|
|
204
|
+
**事件:** PreToolUse (Bash)
|
|
205
|
+
**默认行为:** 拒绝打印环境变量的命令:`printenv`、`env`、`echo $VAR`。
|
|
206
|
+
|
|
207
|
+
无参数。
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 文件访问
|
|
212
|
+
|
|
213
|
+
将智能体的操作限制在项目目录内,避免其访问敏感文件。
|
|
214
|
+
|
|
215
|
+
### `block-read-outside-cwd`
|
|
216
|
+
|
|
217
|
+
**事件:** PreToolUse (Read, Bash)
|
|
218
|
+
**默认行为:** 拒绝读取当前工作目录(项目根目录)以外的文件。
|
|
219
|
+
|
|
220
|
+
**参数:**
|
|
221
|
+
|
|
222
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
223
|
+
|------|------|--------|------|
|
|
224
|
+
| `allowPaths` | `string[]` | `[]` | 即使位于当前工作目录之外也允许访问的绝对路径前缀。 |
|
|
225
|
+
|
|
226
|
+
**示例:**
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"policyParams": {
|
|
231
|
+
"block-read-outside-cwd": {
|
|
232
|
+
"allowPaths": ["/shared/data", "/opt/company/config"]
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
### `block-secrets-write`
|
|
241
|
+
|
|
242
|
+
**事件:** PreToolUse (Write, Edit)
|
|
243
|
+
**默认行为:** 拒绝写入常用于存储私钥和证书的文件:`id_rsa`、`id_ed25519`、`*.key`、`*.pem`、`*.p12`、`*.pfx`。
|
|
244
|
+
|
|
245
|
+
**参数:**
|
|
246
|
+
|
|
247
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
248
|
+
|------|------|--------|------|
|
|
249
|
+
| `additionalPatterns` | `string[]` | `[]` | 需要阻止的额外文件名模式(glob 风格)。 |
|
|
250
|
+
|
|
251
|
+
**示例:**
|
|
252
|
+
|
|
253
|
+
```json
|
|
254
|
+
{
|
|
255
|
+
"policyParams": {
|
|
256
|
+
"block-secrets-write": {
|
|
257
|
+
"additionalPatterns": [".token", ".secret"]
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Git
|
|
266
|
+
|
|
267
|
+
防止意外推送、强制推送以及难以撤销的分支误操作。
|
|
268
|
+
|
|
269
|
+
### `block-push-master`
|
|
270
|
+
|
|
271
|
+
**事件:** PreToolUse (Bash)
|
|
272
|
+
**默认行为:** 拒绝 `git push origin main` 和 `git push origin master`。
|
|
273
|
+
|
|
274
|
+
**参数:**
|
|
275
|
+
|
|
276
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
277
|
+
|------|------|--------|------|
|
|
278
|
+
| `protectedBranches` | `string[]` | `["main", "master"]` | 不允许直接推送的分支名称。 |
|
|
279
|
+
|
|
280
|
+
**示例:**
|
|
281
|
+
|
|
282
|
+
```json
|
|
283
|
+
{
|
|
284
|
+
"policyParams": {
|
|
285
|
+
"block-push-master": {
|
|
286
|
+
"protectedBranches": ["main", "master", "release", "prod"]
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
<Tip>
|
|
293
|
+
若要允许推送到所有分支(即在不从 `enabledPolicies` 中移除该策略的情况下将其禁用),可将 `protectedBranches` 设置为 `[]`。
|
|
294
|
+
</Tip>
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
### `block-work-on-main`
|
|
299
|
+
|
|
300
|
+
**事件:** PreToolUse (Bash)
|
|
301
|
+
**默认行为:** 拒绝直接检出 `main` 或 `master` 分支。
|
|
302
|
+
|
|
303
|
+
**参数:**
|
|
304
|
+
|
|
305
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
306
|
+
|------|------|--------|------|
|
|
307
|
+
| `protectedBranches` | `string[]` | `["main", "master"]` | 不允许直接检出的分支名称。 |
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
### `block-force-push`
|
|
312
|
+
|
|
313
|
+
**事件:** PreToolUse (Bash)
|
|
314
|
+
**默认行为:** 拒绝 `git push --force` 和 `git push -f`。
|
|
315
|
+
|
|
316
|
+
无策略专属参数。可使用跨策略的 [`hint`](/zh/configuration#hint-cross-cutting) 字段建议替代方案:
|
|
317
|
+
|
|
318
|
+
```json
|
|
319
|
+
{
|
|
320
|
+
"policyParams": {
|
|
321
|
+
"block-force-push": {
|
|
322
|
+
"hint": "Create a new branch from your current HEAD (e.g. `git checkout -b <new-branch>`) and push that instead."
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
### `warn-git-amend`
|
|
331
|
+
|
|
332
|
+
**事件:** PreToolUse (Bash)
|
|
333
|
+
**默认行为:** 当 Claude 运行 `git commit --amend` 时,提示其谨慎操作。不阻止该命令执行。
|
|
334
|
+
|
|
335
|
+
无参数。
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
### `warn-git-stash-drop`
|
|
340
|
+
|
|
341
|
+
**事件:** PreToolUse (Bash)
|
|
342
|
+
**默认行为:** 当 Claude 运行 `git stash drop` 前,提示其进行确认。不阻止该命令执行。
|
|
343
|
+
|
|
344
|
+
无参数。
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
### `warn-all-files-staged`
|
|
349
|
+
|
|
350
|
+
**事件:** PreToolUse (Bash)
|
|
351
|
+
**默认行为:** 当 Claude 运行 `git add -A` 或 `git add .` 时,提示其审查所暂存的内容。不阻止该命令执行。
|
|
352
|
+
|
|
353
|
+
无参数。
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## 数据库
|
|
358
|
+
|
|
359
|
+
在破坏性 SQL 操作执行之前将其拦截。
|
|
360
|
+
|
|
361
|
+
### `warn-destructive-sql`
|
|
362
|
+
|
|
363
|
+
**事件:** PreToolUse (Bash)
|
|
364
|
+
**默认行为:** 当 Claude 执行包含 `DROP TABLE`、`DROP DATABASE` 或不带 `WHERE` 子句的 `DELETE` 的 SQL 语句前,提示其进行确认。
|
|
365
|
+
|
|
366
|
+
无参数。
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
### `warn-schema-alteration`
|
|
371
|
+
|
|
372
|
+
**事件:** PreToolUse (Bash)
|
|
373
|
+
**默认行为:** 当 Claude 执行 `ALTER TABLE` 语句前,提示其进行确认。
|
|
374
|
+
|
|
375
|
+
无参数。
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## 警告
|
|
380
|
+
|
|
381
|
+
在智能体执行潜在风险但非破坏性的操作之前,提供额外上下文。
|
|
382
|
+
|
|
383
|
+
### `warn-large-file-write`
|
|
384
|
+
|
|
385
|
+
**事件:** PreToolUse (Write)
|
|
386
|
+
**默认行为:** 当 Claude 写入大于 1024 KB 的文件前,提示其进行确认。
|
|
387
|
+
|
|
388
|
+
**参数:**
|
|
389
|
+
|
|
390
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
391
|
+
|------|------|--------|------|
|
|
392
|
+
| `thresholdKb` | `number` | `1024` | 触发警告的文件大小阈值(单位:KB)。 |
|
|
393
|
+
|
|
394
|
+
**示例:**
|
|
395
|
+
|
|
396
|
+
```json
|
|
397
|
+
{
|
|
398
|
+
"policyParams": {
|
|
399
|
+
"warn-large-file-write": {
|
|
400
|
+
"thresholdKb": 256
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
<Note>
|
|
407
|
+
钩子处理程序对 stdin 载荷强制限制为 1 MB。如需使用较小内容测试此策略,请将 `thresholdKb` 设置为远低于 1024 的值。
|
|
408
|
+
</Note>
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
### `warn-package-publish`
|
|
413
|
+
|
|
414
|
+
**事件:** PreToolUse (Bash)
|
|
415
|
+
**默认行为:** 当 Claude 运行 `npm publish` 前,提示其进行确认。
|
|
416
|
+
|
|
417
|
+
无参数。
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
### `warn-background-process`
|
|
422
|
+
|
|
423
|
+
**事件:** PreToolUse (Bash)
|
|
424
|
+
**默认行为:** 当 Claude 通过 `nohup`、`&`、`disown` 或 `screen` 启动后台进程时,提示其注意风险。
|
|
425
|
+
|
|
426
|
+
无参数。
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
### `warn-global-package-install`
|
|
431
|
+
|
|
432
|
+
**事件:** PreToolUse (Bash)
|
|
433
|
+
**默认行为:** 当 Claude 运行 `npm install -g`、`yarn global add` 或未在虚拟环境中执行 `pip install` 前,提示其进行确认。
|
|
434
|
+
|
|
435
|
+
无参数。
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## AI 行为
|
|
440
|
+
|
|
441
|
+
检测智能体陷入卡死或异常行为的情况。
|
|
442
|
+
|
|
443
|
+
### `warn-repeated-tool-calls`
|
|
444
|
+
|
|
445
|
+
**事件:** PreToolUse(所有工具)
|
|
446
|
+
**默认行为:** 当同一工具以相同参数被连续调用 3 次及以上时,提示 Claude 重新考虑——这通常是智能体陷入循环的常见信号。
|
|
447
|
+
|
|
448
|
+
无参数。
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## 工作流(beta)
|
|
453
|
+
|
|
454
|
+
强制执行规范的会话结束工作流。这些策略在 **Stop** 事件上触发,并阻止 Claude 在每个条件满足之前停止运行。它们遵循自然的依赖链:提交 → 推送 → PR → CI。若某条策略拒绝,链中后续策略将被跳过(拒绝会短路后续检查)。
|
|
455
|
+
|
|
456
|
+
所有工作流策略均采用**失败开放**模式:若所需工具不可用(例如未安装 `gh`、无 git 远程仓库),策略将放行并附上说明跳过原因的提示信息。
|
|
457
|
+
|
|
458
|
+
### `require-commit-before-stop`
|
|
459
|
+
|
|
460
|
+
**事件:** Stop
|
|
461
|
+
**默认行为:** 当存在未提交的变更(已修改、已暂存或未跟踪的文件)时,拒绝停止。当工作目录干净时,返回提示信息。
|
|
462
|
+
|
|
463
|
+
无参数。
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
### `require-push-before-stop`
|
|
468
|
+
|
|
469
|
+
**事件:** Stop
|
|
470
|
+
**默认行为:** 当存在未推送的提交,或当前分支没有远程跟踪分支时,拒绝停止。如需创建跟踪分支,建议使用 `git push -u`。若未配置远程仓库,则失败开放。
|
|
471
|
+
|
|
472
|
+
**参数:**
|
|
473
|
+
|
|
474
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
475
|
+
|------|------|--------|------|
|
|
476
|
+
| `remote` | `string` | `"origin"` | 推送目标的远程仓库名称。 |
|
|
477
|
+
|
|
478
|
+
**示例:**
|
|
479
|
+
|
|
480
|
+
```json
|
|
481
|
+
{
|
|
482
|
+
"policyParams": {
|
|
483
|
+
"require-push-before-stop": {
|
|
484
|
+
"remote": "upstream"
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
### `require-pr-before-stop`
|
|
493
|
+
|
|
494
|
+
**事件:** Stop
|
|
495
|
+
**默认行为:** 当当前分支不存在拉取请求,或现有 PR 已关闭/已合并时,拒绝停止。提示 Claude 使用 `gh pr create` 创建 PR。
|
|
496
|
+
|
|
497
|
+
无参数。
|
|
498
|
+
|
|
499
|
+
<Note>
|
|
500
|
+
此策略需要安装并完成身份验证的 [GitHub CLI](https://cli.github.com/)(`gh`)。
|
|
501
|
+
请运行 `gh auth login`,并使用具有 `repo` 权限(用于读取拉取请求)的个人访问令牌进行认证。若未安装 `gh` 或未完成认证,策略将失败开放并向 Claude 报告原因。
|
|
502
|
+
</Note>
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
### `require-ci-green-before-stop`
|
|
507
|
+
|
|
508
|
+
**事件:** Stop
|
|
509
|
+
**默认行为:** 当当前分支的 CI 检查失败或仍在运行时,拒绝停止。同时检查 GitHub Actions 工作流运行状态和第三方机器人检查(例如 CodeRabbit、SonarCloud、Codecov)。将 `skipped` 结论视为成功。所有检查通过时,返回提示信息。
|
|
510
|
+
|
|
511
|
+
无参数。
|
|
512
|
+
|
|
513
|
+
<Note>
|
|
514
|
+
此策略需要安装并完成身份验证的 [GitHub CLI](https://cli.github.com/)(`gh`)。
|
|
515
|
+
请运行 `gh auth login`,并使用具有 `repo` 权限(用于读取 Actions 工作流运行状态和 Checks API)的个人访问令牌进行认证。若未安装 `gh` 或未完成认证,策略将失败开放并向 Claude 报告原因。
|
|
516
|
+
</Note>
|
|
517
|
+
|
|
518
|
+
---
|
|
519
|
+
|
|
520
|
+
## Beta 策略
|
|
521
|
+
|
|
522
|
+
部分策略标记为 `beta`,默认不安装。Beta 策略可能存在一定的不稳定性或误报情况,将在后续版本中升级为稳定版。
|
|
523
|
+
|
|
524
|
+
**当前 beta 策略:**
|
|
525
|
+
|
|
526
|
+
- `require-commit-before-stop` — 停止前提交所有变更
|
|
527
|
+
- `require-push-before-stop` — 将所有提交推送到远程仓库
|
|
528
|
+
- `require-pr-before-stop` — 确保分支存在对应的 PR
|
|
529
|
+
- `require-ci-green-before-stop` — 所有 CI 检查必须通过
|
|
530
|
+
|
|
531
|
+
这四条策略共同强制执行 **提交 → 推送 → PR → CI** 工作流。
|
|
532
|
+
|
|
533
|
+
安装所有 beta 策略:
|
|
534
|
+
|
|
535
|
+
```bash
|
|
536
|
+
failproofai policies --install --beta
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
或安装指定的工作流策略:
|
|
540
|
+
|
|
541
|
+
```bash
|
|
542
|
+
failproofai policies --install require-commit-before-stop require-push-before-stop require-pr-before-stop require-ci-green-before-stop
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
运行 `failproofai policies` 可查看哪些策略带有 beta 标识。
|
|
546
|
+
|
|
547
|
+
---
|
|
548
|
+
|
|
549
|
+
## 禁用单条策略
|
|
550
|
+
|
|
551
|
+
从配置文件的 `enabledPolicies` 中移除指定策略,或在控制面板的「策略」标签页中将其关闭。
|
|
552
|
+
|
|
553
|
+
```json
|
|
554
|
+
{
|
|
555
|
+
"enabledPolicies": [
|
|
556
|
+
"block-rm-rf",
|
|
557
|
+
"sanitize-api-keys"
|
|
558
|
+
]
|
|
559
|
+
}
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
未在 `enabledPolicies` 中列出的策略不会运行,即使 `policyParams` 中存在对应的配置项也是如此。
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 查看会话
|
|
3
|
+
description: "启动仪表板以浏览 Agent 会话并管理策略"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
failproofai
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
在 `http://localhost:8020` 启动 Web 仪表板。
|
|
11
|
+
|
|
12
|
+
## 选项
|
|
13
|
+
|
|
14
|
+
| 标志 | 描述 |
|
|
15
|
+
|------|------|
|
|
16
|
+
| `--port <number>` | 监听端口(默认:`8020`) |
|
|
17
|
+
| `--projects-path <path>` | 覆盖 Claude Code 项目文件夹的查找路径 |
|
|
18
|
+
| `--allowed-origins <origins>` | 允许访问开发资源的主机/IP,以逗号分隔 |
|
|
19
|
+
|
|
20
|
+
## 示例
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 在其他端口启动
|
|
24
|
+
failproofai --port 9000
|
|
25
|
+
|
|
26
|
+
# 使用自定义项目路径
|
|
27
|
+
failproofai --projects-path ~/my-claude-projects
|
|
28
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 环境变量
|
|
3
|
+
description: "通过环境变量配置 failproofai 的行为"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 控制台
|
|
7
|
+
|
|
8
|
+
| 变量 | 描述 |
|
|
9
|
+
|----------|-------------|
|
|
10
|
+
| `PORT` | 控制台端口(默认:`8020`) |
|
|
11
|
+
| `CLAUDE_PROJECTS_PATH` | 覆盖 Claude Code 项目文件夹的查找路径 |
|
|
12
|
+
| `FAILPROOFAI_DISABLE_PAGES=policies,projects` | 以逗号分隔的控制台页面列表,用于隐藏指定页面 |
|
|
13
|
+
| `FAILPROOFAI_ALLOWED_DEV_ORIGINS` | 允许访问开发资源的主机/IP,与 `--allowed-origins` 相同 |
|
|
14
|
+
|
|
15
|
+
## 日志
|
|
16
|
+
|
|
17
|
+
| 变量 | 描述 |
|
|
18
|
+
|----------|-------------|
|
|
19
|
+
| `FAILPROOFAI_LOG_LEVEL=info\|warn\|error` | 服务器日志级别(默认:`warn`) |
|
|
20
|
+
| `FAILPROOFAI_HOOK_LOG_FILE` | 自定义 Hook 日志文件路径,或设为 `true` 使用默认路径(`~/.failproofai/logs/hooks.log`) |
|
|
21
|
+
|
|
22
|
+
## 遥测
|
|
23
|
+
|
|
24
|
+
| 变量 | 描述 |
|
|
25
|
+
|----------|-------------|
|
|
26
|
+
| `FAILPROOFAI_TELEMETRY_DISABLED=1` | 禁用匿名使用遥测 |
|
|
27
|
+
|
|
28
|
+
## LLM(用于策略评估)
|
|
29
|
+
|
|
30
|
+
| 变量 | 描述 |
|
|
31
|
+
|----------|-------------|
|
|
32
|
+
| `FAILPROOFAI_LLM_BASE_URL` | LLM API 端点(默认:`https://api.openai.com/v1`) |
|
|
33
|
+
| `FAILPROOFAI_LLM_API_KEY` | LLM 驱动策略所需的 API 密钥 |
|
|
34
|
+
| `FAILPROOFAI_LLM_MODEL` | 模型名称(默认:`gpt-4o-mini`) |
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Hook 处理程序(内部)
|
|
3
|
+
description: "Claude Code 在每次工具事件时调用的子进程"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
failproofai --hook <EventType>
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
这是由 `failproofai policies --install` 注册到 Claude Code 的 `settings.json` 中的命令。通常情况下,你不需要直接调用它。
|
|
11
|
+
|
|
12
|
+
该命令从 stdin 读取 JSON 载荷,评估所有已启用的策略,并以退出码的形式返回决策结果:
|
|
13
|
+
|
|
14
|
+
| 退出码 | 决策 | 效果 |
|
|
15
|
+
|--------|------|------|
|
|
16
|
+
| `0` | `allow` | 允许该操作 |
|
|
17
|
+
| `1` | `deny` | 阻止该操作——Claude 将看到拒绝原因 |
|
|
18
|
+
| `2` | `instruct` | 向 Claude 的上下文中注入指导信息 |
|
|
19
|
+
|
|
20
|
+
### 支持的事件类型
|
|
21
|
+
|
|
22
|
+
| 分类 | 事件 |
|
|
23
|
+
|------|------|
|
|
24
|
+
| **工具执行** | `PreToolUse`、`PostToolUse`、`PostToolUseFailure`、`PermissionRequest`、`PermissionDenied` |
|
|
25
|
+
| **会话生命周期** | `SessionStart`、`SessionEnd`、`Stop`、`StopFailure` |
|
|
26
|
+
| **用户交互** | `UserPromptSubmit`、`Notification`、`Elicitation`、`ElicitationResult` |
|
|
27
|
+
| **子智能体与任务** | `SubagentStart`、`SubagentStop`、`TaskCreated`、`TaskCompleted`、`TeammateIdle` |
|
|
28
|
+
| **配置** | `InstructionsLoaded`、`ConfigChange`、`CwdChanged` |
|
|
29
|
+
| **文件系统** | `FileChanged`、`WorktreeCreate`、`WorktreeRemove` |
|
|
30
|
+
| **上下文** | `PreCompact`、`PostCompact` |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 安装策略
|
|
3
|
+
description: "启用策略,使其在每次代理工具调用时运行"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
failproofai policies --install [policy-names...] [options]
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
将钩子条目写入 Claude Code 的 `settings.json`,使 failproofai 能够拦截工具调用。
|
|
11
|
+
|
|
12
|
+
别名:`failproofai p -i`
|
|
13
|
+
|
|
14
|
+
## 选项
|
|
15
|
+
|
|
16
|
+
| 标志 | 描述 |
|
|
17
|
+
|------|------|
|
|
18
|
+
| `--scope user` | 安装到 `~/.claude/settings.json`(默认 - 适用于所有会话) |
|
|
19
|
+
| `--scope project` | 安装到当前目录的 `.claude/settings.json` |
|
|
20
|
+
| `--scope local` | 安装到当前目录的 `.claude/settings.local.json` |
|
|
21
|
+
| `--custom <path>` / `-c` | 包含自定义钩子策略的 JS 文件路径 |
|
|
22
|
+
| `--beta` | 包含测试版策略 |
|
|
23
|
+
|
|
24
|
+
## 行为说明
|
|
25
|
+
|
|
26
|
+
- **不指定策略名称** - 打开交互式提示以选择策略
|
|
27
|
+
- **指定具体名称** - 启用对应策略(追加到已启用的策略中)
|
|
28
|
+
- **`all`** - 启用所有可用策略
|
|
29
|
+
|
|
30
|
+
安装操作为增量式:再次运行 `--install` 只会添加新策略,不会移除已有策略。
|
|
31
|
+
|
|
32
|
+
## 示例
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# 全局安装所有默认策略(交互式)
|
|
36
|
+
failproofai policies --install
|
|
37
|
+
|
|
38
|
+
# 为当前项目安装指定策略
|
|
39
|
+
failproofai policies --install block-sudo sanitize-api-keys --scope project
|
|
40
|
+
|
|
41
|
+
# 一次性启用所有策略
|
|
42
|
+
failproofai policies --install all
|
|
43
|
+
|
|
44
|
+
# 使用自定义策略文件进行安装
|
|
45
|
+
failproofai policies --install --custom ./my-policies.js
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
当提供 `--custom <path>` 时,文件会立即进行验证——它必须至少调用一次 `customPolicies.add()`。解析后的路径将作为 `customPoliciesPath` 保存到 `policies-config.json` 中。
|