failproofai 0.0.5 → 0.0.6-beta.1

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 (179) hide show
  1. package/.next/standalone/.failproofai/policies/review-policies.mjs +112 -0
  2. package/.next/standalone/.failproofai/policies/workflow-policies.mjs +2 -1
  3. package/.next/standalone/.next/BUILD_ID +1 -1
  4. package/.next/standalone/.next/build-manifest.json +5 -5
  5. package/.next/standalone/.next/prerender-manifest.json +3 -3
  6. package/.next/standalone/.next/required-server-files.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
  8. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  9. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  10. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  13. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  14. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  15. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  16. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  17. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  18. package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
  19. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  20. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  23. package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
  24. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  25. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  26. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  27. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  28. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  29. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  30. package/.next/standalone/.next/server/app/index.html +1 -1
  31. package/.next/standalone/.next/server/app/index.rsc +15 -15
  32. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  33. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  34. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  35. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
  36. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  37. package/.next/standalone/.next/server/app/page/build-manifest.json +2 -2
  38. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  39. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/policies/page/build-manifest.json +2 -2
  42. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  43. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +2 -2
  46. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  47. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +2 -2
  50. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  51. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  52. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
  55. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  56. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +1 -1
  59. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
  60. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
  61. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
  62. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
  63. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
  64. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
  65. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0a~g15g._.js → [root-of-the-server]__0rh.18_._.js} +2 -2
  66. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +6 -6
  67. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0qn95h3._.js → [root-of-the-server]__0~kmh8w._.js} +2 -2
  68. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
  69. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
  70. package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
  71. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
  72. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
  73. package/.next/standalone/.next/server/middleware-build-manifest.js +5 -5
  74. package/.next/standalone/.next/server/pages/404.html +2 -2
  75. package/.next/standalone/.next/server/pages/500.html +1 -1
  76. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
  78. package/.next/standalone/.next/static/chunks/{0sme4lkv.tgn-.js → 01b~z8f1ws0rk.js} +1 -1
  79. package/.next/standalone/.next/static/chunks/{0lgbwkfqmnsmc.js → 03rz6ykw-a2xi.js} +1 -1
  80. package/.next/standalone/.next/static/chunks/{17manv47o-~wp.js → 08t08igdql9yt.js} +1 -1
  81. package/.next/standalone/.next/static/chunks/09_k80d~cq2wg.js +4 -0
  82. package/.next/standalone/.next/static/chunks/{0ksdlt_1hucdm.js → 0bvhsa6zva2o..js} +1 -1
  83. package/.next/standalone/.next/static/chunks/{09ikntpt2-o9b.js → 0gbf4cphy8ksq.js} +1 -1
  84. package/.next/standalone/.next/static/chunks/{0yumumfzx_f27.js → 0v.yd0kg_ld3r.js} +1 -1
  85. package/.next/standalone/.next/static/chunks/{13juklu.vksks.js → 0wlyoif4_kj_t.js} +1 -1
  86. package/.next/standalone/.next/static/chunks/{09e7drilkf1sn.js → 12simlrcfk3g2.js} +1 -1
  87. package/.next/standalone/.next/static/chunks/{0em7tspi4kylh.js → 12~yi9oj8av8p.js} +2 -2
  88. package/.next/standalone/.next/static/chunks/{turbopack-0r26pc8h0y_-e.js → turbopack-0o7k.hakttp4k.js} +1 -1
  89. package/.next/standalone/CHANGELOG.md +13 -0
  90. package/.next/standalone/README.md +2 -2
  91. package/.next/standalone/bun.lock +43 -85
  92. package/.next/standalone/dist/cli.mjs +107 -3
  93. package/.next/standalone/docs/ar/architecture.mdx +65 -64
  94. package/.next/standalone/docs/ar/configuration.mdx +42 -42
  95. package/.next/standalone/docs/ar/custom-policies.mdx +62 -64
  96. package/.next/standalone/docs/built-in-policies.mdx +37 -0
  97. package/.next/standalone/docs/custom-policies.mdx +1 -1
  98. package/.next/standalone/docs/de/architecture.mdx +92 -92
  99. package/.next/standalone/docs/de/configuration.mdx +34 -34
  100. package/.next/standalone/docs/de/custom-policies.mdx +49 -50
  101. package/.next/standalone/docs/es/architecture.mdx +72 -72
  102. package/.next/standalone/docs/es/configuration.mdx +25 -25
  103. package/.next/standalone/docs/es/custom-policies.mdx +48 -49
  104. package/.next/standalone/docs/examples.mdx +54 -0
  105. package/.next/standalone/docs/fr/architecture.mdx +53 -53
  106. package/.next/standalone/docs/fr/configuration.mdx +25 -25
  107. package/.next/standalone/docs/fr/custom-policies.mdx +42 -43
  108. package/.next/standalone/docs/getting-started.mdx +52 -0
  109. package/.next/standalone/docs/he/architecture.mdx +66 -66
  110. package/.next/standalone/docs/he/configuration.mdx +53 -52
  111. package/.next/standalone/docs/he/custom-policies.mdx +72 -73
  112. package/.next/standalone/docs/hi/architecture.mdx +106 -106
  113. package/.next/standalone/docs/hi/configuration.mdx +39 -39
  114. package/.next/standalone/docs/hi/custom-policies.mdx +75 -76
  115. package/.next/standalone/docs/i18n/README.ar.md +66 -66
  116. package/.next/standalone/docs/i18n/README.de.md +38 -38
  117. package/.next/standalone/docs/i18n/README.es.md +38 -38
  118. package/.next/standalone/docs/i18n/README.fr.md +42 -42
  119. package/.next/standalone/docs/i18n/README.he.md +67 -67
  120. package/.next/standalone/docs/i18n/README.hi.md +70 -70
  121. package/.next/standalone/docs/i18n/README.it.md +62 -62
  122. package/.next/standalone/docs/i18n/README.ja.md +54 -54
  123. package/.next/standalone/docs/i18n/README.ko.md +58 -58
  124. package/.next/standalone/docs/i18n/README.pt-br.md +43 -43
  125. package/.next/standalone/docs/i18n/README.ru.md +69 -69
  126. package/.next/standalone/docs/i18n/README.tr.md +76 -76
  127. package/.next/standalone/docs/i18n/README.vi.md +70 -70
  128. package/.next/standalone/docs/i18n/README.zh.md +52 -52
  129. package/.next/standalone/docs/it/architecture.mdx +54 -53
  130. package/.next/standalone/docs/it/configuration.mdx +44 -45
  131. package/.next/standalone/docs/it/custom-policies.mdx +76 -78
  132. package/.next/standalone/docs/ja/architecture.mdx +93 -93
  133. package/.next/standalone/docs/ja/configuration.mdx +47 -47
  134. package/.next/standalone/docs/ja/custom-policies.mdx +62 -63
  135. package/.next/standalone/docs/ko/architecture.mdx +66 -66
  136. package/.next/standalone/docs/ko/configuration.mdx +35 -35
  137. package/.next/standalone/docs/ko/custom-policies.mdx +71 -72
  138. package/.next/standalone/docs/pt-br/architecture.mdx +55 -55
  139. package/.next/standalone/docs/pt-br/configuration.mdx +35 -35
  140. package/.next/standalone/docs/pt-br/custom-policies.mdx +60 -61
  141. package/.next/standalone/docs/ru/architecture.mdx +59 -60
  142. package/.next/standalone/docs/ru/configuration.mdx +52 -53
  143. package/.next/standalone/docs/ru/custom-policies.mdx +68 -69
  144. package/.next/standalone/docs/tr/architecture.mdx +124 -124
  145. package/.next/standalone/docs/tr/configuration.mdx +45 -46
  146. package/.next/standalone/docs/tr/custom-policies.mdx +75 -75
  147. package/.next/standalone/docs/vi/architecture.mdx +65 -64
  148. package/.next/standalone/docs/vi/configuration.mdx +41 -41
  149. package/.next/standalone/docs/vi/custom-policies.mdx +68 -69
  150. package/.next/standalone/docs/zh/architecture.mdx +67 -67
  151. package/.next/standalone/docs/zh/configuration.mdx +34 -34
  152. package/.next/standalone/docs/zh/custom-policies.mdx +53 -54
  153. package/.next/standalone/node_modules/@next/env/package.json +1 -1
  154. package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
  155. package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +7 -7
  156. package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
  157. package/.next/standalone/node_modules/next/dist/server/config-schema.js +10 -2
  158. package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
  159. package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
  160. package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  161. package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  162. package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
  163. package/.next/standalone/node_modules/next/dist/server/render.js +27 -20
  164. package/.next/standalone/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  165. package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  166. package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
  167. package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
  168. package/.next/standalone/node_modules/next/package.json +15 -15
  169. package/.next/standalone/package.json +2 -2
  170. package/.next/standalone/server.js +1 -1
  171. package/.next/standalone/src/hooks/builtin-policies.ts +131 -0
  172. package/README.md +2 -2
  173. package/dist/cli.mjs +107 -3
  174. package/package.json +2 -2
  175. package/src/hooks/builtin-policies.ts +131 -0
  176. package/.next/standalone/.next/static/chunks/0_yayar~bpphd.js +0 -4
  177. /package/.next/standalone/.next/static/{hYQM6iCWnF1W5XDpsIRhV → CkmOT-ZvDN-sVULinGVKT}/_buildManifest.js +0 -0
  178. /package/.next/standalone/.next/static/{hYQM6iCWnF1W5XDpsIRhV → CkmOT-ZvDN-sVULinGVKT}/_clientMiddlewareManifest.js +0 -0
  179. /package/.next/standalone/.next/static/{hYQM6iCWnF1W5XDpsIRhV → CkmOT-ZvDN-sVULinGVKT}/_ssgManifest.js +0 -0
@@ -21,23 +21,23 @@
21
21
  [![CI](https://img.shields.io/github/actions/workflow/status/exospherehost/failproofai/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/exospherehost/failproofai/actions)
22
22
  [![Slack](https://img.shields.io/badge/Slack-join%20us-4A154B?style=flat-square&logo=slack)](https://join.slack.com/t/failproofai/shared_invite/zt-3v63b7k5e-O3NBHmj8X6n9gZSGDx6ggQ)
23
23
 
24
- **Dịch**: [简体中文](docs/i18n/README.zh.md) | [日本語](docs/i18n/README.ja.md) | [한국어](docs/i18n/README.ko.md) | [Español](docs/i18n/README.es.md) | [Português](docs/i18n/README.pt-br.md) | [Deutsch](docs/i18n/README.de.md) | [Français](docs/i18n/README.fr.md) | [Русский](docs/i18n/README.ru.md) | [हिन्दी](docs/i18n/README.hi.md) | [Türkçe](docs/i18n/README.tr.md) | [Tiếng Việt](docs/i18n/README.vi.md) | [Italiano](docs/i18n/README.it.md) | [العربية](docs/i18n/README.ar.md) | [עברית](docs/i18n/README.he.md)
24
+ **Bản dịch**: [简体中文](docs/i18n/README.zh.md) | [日本語](docs/i18n/README.ja.md) | [한국어](docs/i18n/README.ko.md) | [Español](docs/i18n/README.es.md) | [Português](docs/i18n/README.pt-br.md) | [Deutsch](docs/i18n/README.de.md) | [Français](docs/i18n/README.fr.md) | [Русский](docs/i18n/README.ru.md) | [हिन्दी](docs/i18n/README.hi.md) | [Türkçe](docs/i18n/README.tr.md) | [Tiếng Việt](docs/i18n/README.vi.md) | [Italiano](docs/i18n/README.it.md) | [العربية](docs/i18n/README.ar.md) | [עברית](docs/i18n/README.he.md)
25
25
 
26
- Cách dễ nhất để quản lý các chính sách giữ cho các agent AI của bạn đáng tin cậy, tập trung vào mục tiêu và chạy tự động - cho **Claude Code** & **Agents SDK**.
26
+ Cách dễ nhất để quản lý các chính sách giúp AI agents của bạn hoạt động đáng tin cậy, tập trung vào nhiệm vụ và chạy tự động - cho **Claude Code** & **Agents SDK**.
27
27
 
28
- - **30 Chính sách tích hợp sẵn** - Bắt các lỗi phổ biến của agent ngay từ đầu. Chặn các lệnh phá hoại, ngăn chặn rò rỉ bí mật, giữ các agent trong ranh giới dự án, phát hiện vòng lặp và nhiều hơn nữa.
29
- - **Chính sách tùy chỉnh** - Viết các quy tắc độ tin cậy của riêng bạn bằng JavaScript. Sử dụng API `allow`/`deny`/`instruct` để thực thi các quy ước, ngăn chặn sự trôi dạt, kiểm soát các phép toán hoặc tích hợp với các hệ thống bên ngoài.
30
- - **Cấu hình dễ dàng** - Điều chỉnh bất kỳ chính sách nào mà không cần viết mã. Đặt danh sách cho phép, nhánh được bảo vệ, ngưỡng cho từng dự án hoặc toàn cầu. Hợp nhất cấu hình ba phạm vi tự động.
31
- - **Agent Monitor** - Xem những gì các agent của bạn đã làm khi bạn vắng mặt. Duyệt các phiên, kiểm tra từng lệnh gọi công cụ và xem xét chính xác nơi các chính sách được kích hoạt.
28
+ - **30 Chính sách tích hợp sẵn** - Bắt các chế độ lỗi phổ biến của agent ngay lập tức. Chặn các lệnh nguy hiểm, ngăn chặn rò rỉ bí mật, giữ agents trong ranh giới dự án, phát hiện vòng lặp, và nhiều hơn nữa.
29
+ - **Chính sách tùy chỉnh** - Viết các quy tắc độ tin cậy của riêng bạn bằng JavaScript. Sử dụng API `allow`/`deny`/`instruct` để thực thi các quy ước, ngăn chặn sự lệch lạc, kiểm soát các hoạt động, hoặc tích hợp với các hệ thống bên ngoài.
30
+ - **Cấu hình dễ dàng** - Tinh chỉnh bất kỳ chính sách nào mà không cần viết code. Đặt danh sách cho phép, nhánh được bảo vệ, ngưỡng cho mỗi dự án hoặc toàn cục. Ba phạm vi cấu hình tự động hợp nhất.
31
+ - **Agent Monitor** - Xem những gì agents của bạn đã làm khi bạn vắng mặt. Duyệt các phiên làm việc, kiểm tra từng lệnh gọi công cụ, và xem xét chính xác nơi các chính sách được áp dụng.
32
32
 
33
- Mọi thứ chạy cục bộ - không có dữ liệu nào rời khỏi máy tính của bạn.
33
+ Mọi thứ chạy cục bộ - không có dữ liệu nào rời khỏi máy của bạn.
34
34
 
35
35
  ---
36
36
 
37
37
  ## Yêu cầu
38
38
 
39
39
  - Node.js >= 20.9.0
40
- - Bun >= 1.3.0 (tùy chọn - chỉ cần thiết để phát triển / xây dựng từ nguồn)
40
+ - Bun >= 1.3.0 (tùy chọn - chỉ cần thiết cho phát triển / xây dựng từ nguồn)
41
41
 
42
42
  ---
43
43
 
@@ -53,7 +53,7 @@ bun add -g failproofai
53
53
 
54
54
  ## Bắt đầu nhanh
55
55
 
56
- ### 1. Bật chính sách trên toàn cầu
56
+ ### 1. Bật chính sách toàn cục
57
57
 
58
58
  ```bash
59
59
  failproofai policies --install
@@ -61,13 +61,13 @@ failproofai policies --install
61
61
 
62
62
  Ghi các mục hook vào `~/.claude/settings.json`. Claude Code sẽ gọi failproofai trước và sau mỗi lệnh gọi công cụ.
63
63
 
64
- ### 2. Khởi chạy bảng điều khiển
64
+ ### 2. Khởi động bảng điều khiển
65
65
 
66
66
  ```bash
67
67
  failproofai
68
68
  ```
69
69
 
70
- Mở `http://localhost:8020` - duyệt các phiên, kiểm tra nhật ký, quản lý chính sách.
70
+ Mở `http://localhost:8020` - duyệt các phiên làm việc, kiểm tra nhật ký, quản lý chính sách.
71
71
 
72
72
  ### 3. Kiểm tra những gì đang hoạt động
73
73
 
@@ -81,9 +81,9 @@ failproofai policies
81
81
 
82
82
  ### Phạm vi
83
83
 
84
- | Phạm vi | Lệnh | Nơi ghi |
85
- |--------|------|-----------|
86
- | Toàn cầu (mặc định) | `failproofai policies --install` | `~/.claude/settings.json` |
84
+ | Phạm vi | Lệnh | Nơi ghi |
85
+ |--------|------|---------|
86
+ | Toàn cục (mặc định) | `failproofai policies --install` | `~/.claude/settings.json` |
87
87
  | Dự án | `failproofai policies --install --scope project` | `.claude/settings.json` |
88
88
  | Cục bộ | `failproofai policies --install --scope local` | `.claude/settings.local.json` |
89
89
 
@@ -105,7 +105,7 @@ failproofai policies --uninstall --scope project
105
105
 
106
106
  ## Cấu hình
107
107
 
108
- Cấu hình chính sách nằm trong `~/.failproofai/policies-config.json` (toàn cầu) hoặc `.failproofai/policies-config.json` trong dự án của bạn (mỗi dự án).
108
+ Cấu hình chính sách nằm trong `~/.failproofai/policies-config.json` (toàn cục) hoặc `.failproofai/policies-config.json` trong dự án của bạn (theo dự án).
109
109
 
110
110
  ```json
111
111
  {
@@ -120,15 +120,15 @@ Cấu hình chính sách nằm trong `~/.failproofai/policies-config.json` (toà
120
120
  "policyParams": {
121
121
  "block-sudo": {
122
122
  "allowPatterns": ["sudo systemctl status", "sudo journalctl"],
123
- "hint": "Sử dụng apt-get trực tiếp mà không cần sudo."
123
+ "hint": "Use apt-get directly without sudo."
124
124
  },
125
125
  "block-push-master": {
126
126
  "protectedBranches": ["main", "release", "prod"],
127
- "hint": "Hãy thử tạo một nhánh mới thay vào đó."
127
+ "hint": "Try creating a fresh branch instead."
128
128
  },
129
129
  "sanitize-api-keys": {
130
130
  "additionalPatterns": [
131
- { "regex": "myco_[A-Za-z0-9]{32}", "label": "Khóa API MyCo" }
131
+ { "regex": "myco_[A-Za-z0-9]{32}", "label": "MyCo API key" }
132
132
  ]
133
133
  },
134
134
  "warn-large-file-write": {
@@ -138,39 +138,39 @@ Cấu hình chính sách nằm trong `~/.failproofai/policies-config.json` (toà
138
138
  }
139
139
  ```
140
140
 
141
- **Ba phạm vi cấu hình** được hợp nhất tự động (dự án → cục bộ → toàn cầu). Xem [docs/configuration.mdx](docs/configuration.mdx) để biết các quy tắc hợp nhất đầy đủ.
141
+ **Ba phạm vi cấu hình** được hợp nhất tự động (dự án → cục bộ → toàn cục). Xem [docs/configuration.mdx](docs/configuration.mdx) để biết các quy tắc hợp nhất đầy đủ.
142
142
 
143
143
  ---
144
144
 
145
145
  ## Chính sách tích hợp sẵn
146
146
 
147
147
  | Chính sách | Mô tả | Có thể cấu hình |
148
- |-----------|--------|:---:|
149
- | `block-sudo` | Ngăn chặn các agent chạy các lệnh hệ thống có đặc quyền | `allowPatterns` |
150
- | `block-rm-rf` | Ngăn chặn xóa tệp đệ quy vô tình | `allowPaths` |
151
- | `block-curl-pipe-sh` | Ngăn chặn các agent đưa các tập lệnh không đáng tin cậy vào shell | |
152
- | `block-failproofai-commands` | Ngăn chặn tự dỡ cài đặt | |
153
- | `sanitize-jwt` | Dừng các mã thông báo JWT bị rò rỉ vào ngữ cảnh agent | |
154
- | `sanitize-api-keys` | Dừng các khóa API bị rò rỉ vào ngữ cảnh agent | `additionalPatterns` |
155
- | `sanitize-connection-strings` | Dừng thông tin xác thực cơ sở dữ liệu bị rò rỉ vào ngữ cảnh agent | |
156
- | `sanitize-private-key-content` | Che đi các khối khóa riêng PEM khỏi đầu ra | |
157
- | `sanitize-bearer-tokens` | Che đi các mã thông báo Bearer Authorization khỏi đầu ra | |
158
- | `block-env-files` | Ngăn chặn các agent đọc tệp .env | |
159
- | `protect-env-vars` | Ngăn chặn các agent in các biến môi trường | |
160
- | `block-read-outside-cwd` | Giữ các agent trong ranh giới dự án | `allowPaths` |
161
- | `block-secrets-write` | Ngăn chặn ghi vào các tệp khóa riêng và chứng chỉ | `additionalPatterns` |
162
- | `block-push-master` | Ngăn chặn đẩy vô tình tới main/master | `protectedBranches` |
163
- | `block-work-on-main` | Giữ các agent không các nhánh được bảo vệ | `protectedBranches` |
164
- | `block-force-push` | Ngăn chặn `git push --force` | |
165
- | `warn-git-amend` | Nhắc nhở các agent trước khi sửa đổi commit | |
166
- | `warn-git-stash-drop` | Nhắc nhở các agent trước khi xóa stashes | |
148
+ |-----------|-------|:---:|
149
+ | `block-sudo` | Ngăn agents chạy các lệnh hệ thống có đặc quyền | `allowPatterns` |
150
+ | `block-rm-rf` | Ngăn xóa tệp đệ quy vô tình | `allowPaths` |
151
+ | `block-curl-pipe-sh` | Ngăn agents đưa các tập lệnh không đáng tin cậy vào shell | |
152
+ | `block-failproofai-commands` | Ngăn tự gỡ cài đặt | |
153
+ | `sanitize-jwt` | Dừng các mã JWT rò rỉ vào ngữ cảnh agent | |
154
+ | `sanitize-api-keys` | Dừng các khóa API rò rỉ vào ngữ cảnh agent | `additionalPatterns` |
155
+ | `sanitize-connection-strings` | Dừng thông tin xác thực cơ sở dữ liệu rò rỉ vào ngữ cảnh agent | |
156
+ | `sanitize-private-key-content` | Che mờ các khối khóa riêng PEM khỏi đầu ra | |
157
+ | `sanitize-bearer-tokens` | Che mờ các mã Authorization Bearer từ đầu ra | |
158
+ | `block-env-files` | Giữ agents không đọc các tệp .env | |
159
+ | `protect-env-vars` | Ngăn agents in các biến môi trường | |
160
+ | `block-read-outside-cwd` | Giữ agents trong ranh giới dự án | `allowPaths` |
161
+ | `block-secrets-write` | Ngăn ghi vào các tệp khóa riêng và chứng chỉ | `additionalPatterns` |
162
+ | `block-push-master` | Ngăn đẩy vô tình tới main/master | `protectedBranches` |
163
+ | `block-work-on-main` | Giữ agents không hoạt động trên các nhánh được bảo vệ | `protectedBranches` |
164
+ | `block-force-push` | Ngăn `git push --force` | |
165
+ | `warn-git-amend` | Nhắc nhở agents trước khi sửa đổi commit | |
166
+ | `warn-git-stash-drop` | Nhắc nhở agents trước khi xóa stash | |
167
167
  | `warn-all-files-staged` | Bắt `git add -A` vô tình | |
168
- | `warn-destructive-sql` | Bắt DROP/DELETE SQL trước khi thực thi | |
169
- | `warn-schema-alteration` | Bắt ALTER TABLE trước khi thực thi | |
170
- | `warn-large-file-write` | Bắt ghi tệp lớn bất ngờ | `thresholdKb` |
168
+ | `warn-destructive-sql` | Bắt SQL DROP/DELETE trước khi thực hiện | |
169
+ | `warn-schema-alteration` | Bắt ALTER TABLE trước khi thực hiện | |
170
+ | `warn-large-file-write` | Bắt các lần ghi tệp lớn bất ngờ | `thresholdKb` |
171
171
  | `warn-package-publish` | Bắt `npm publish` vô tình | |
172
- | `warn-background-process` | Bắt khởi chạy quá trình nền không dự định | |
173
- | `warn-global-package-install` | Bắt cài đặt gói toàn cầu không dự định | |
172
+ | `warn-background-process` | Bắt khởi chạy quy trình nền không dự định | |
173
+ | `warn-global-package-install` | Bắt cài đặt gói toàn cục không dự định | |
174
174
  | …và nhiều hơn nữa | | |
175
175
 
176
176
  Chi tiết chính sách đầy đủ và tham chiếu tham số: [docs/built-in-policies.mdx](docs/built-in-policies.mdx)
@@ -179,19 +179,19 @@ Chi tiết chính sách đầy đủ và tham chiếu tham số: [docs/built-in-
179
179
 
180
180
  ## Chính sách tùy chỉnh
181
181
 
182
- Viết chính sách của riêng bạn để giữ cho các agent đáng tin cậy và tập trung vào mục tiêu:
182
+ Viết các chính sách của riêng bạn để giữ agents đáng tin cậy và tập trung vào nhiệm vụ:
183
183
 
184
184
  ```js
185
185
  import { customPolicies, allow, deny, instruct } from "failproofai";
186
186
 
187
187
  customPolicies.add({
188
188
  name: "no-production-writes",
189
- description: "Chặn ghi vào các đường dẫn chứa 'production'",
189
+ description: "Block writes to paths containing 'production'",
190
190
  match: { events: ["PreToolUse"] },
191
191
  fn: async (ctx) => {
192
192
  if (!["Write", "Edit"].includes(ctx.toolName ?? "")) return allow();
193
193
  const path = ctx.toolInput?.file_path ?? "";
194
- if (path.includes("production")) return deny("Ghi vào các đường dẫn production bị chặn");
194
+ if (path.includes("production")) return deny("Writes to production paths are blocked");
195
195
  return allow();
196
196
  },
197
197
  });
@@ -205,49 +205,49 @@ failproofai policies --install --custom ./my-policies.js
205
205
 
206
206
  ### Trợ giúp quyết định
207
207
 
208
- | Hàm | Hiệu ứng |
208
+ | Hàm | Hiệu quả |
209
209
  |-----|---------|
210
210
  | `allow()` | Cho phép thao tác |
211
- | `allow(message)` | Cho phép và gửi ngữ cảnh thông tin tới Claude |
212
- | `deny(message)` | Chặn thao tác; thông báo được hiển thị tới Claude |
213
- | `instruct(message)` | Thêm ngữ cảnh vào yêu cầu của Claude; không chặn |
211
+ | `allow(message)` | Cho phép và gửi bối cảnh thông tin đến Claude |
212
+ | `deny(message)` | Chặn thao tác; tin nhắn được hiển thị cho Claude |
213
+ | `instruct(message)` | Thêm bối cảnh vào lời nhắc của Claude; không chặn |
214
214
 
215
215
  ### Đối tượng ngữ cảnh (`ctx`)
216
216
 
217
217
  | Trường | Loại | Mô tả |
218
- |-------|------|--------|
218
+ |-------|------|-------|
219
219
  | `eventType` | `string` | `"PreToolUse"`, `"PostToolUse"`, `"Notification"`, `"Stop"` |
220
220
  | `toolName` | `string` | Công cụ được gọi (`"Bash"`, `"Write"`, `"Read"`, …) |
221
- | `toolInput` | `object` | Tham số đầu vào của công cụ |
222
- | `payload` | `object` | Tải trọng sự kiện thô đầy đủ |
221
+ | `toolInput` | `object` | Các tham số đầu vào của công cụ |
222
+ | `payload` | `object` | Toàn bộ trọng tải sự kiện thô |
223
223
  | `session.cwd` | `string` | Thư mục làm việc của phiên Claude Code |
224
- | `session.sessionId` | `string` | định danh phiên |
224
+ | `session.sessionId` | `string` | Định danh phiên |
225
225
  | `session.transcriptPath` | `string` | Đường dẫn đến tệp phiên ghi âm |
226
226
 
227
- Các hook tùy chỉnh hỗ trợ nhập cục bộ chuyển tiếp, async/await và truy cập `process.env`. Các lỗi fail-open (được ghi vào `~/.failproofai/hook.log`, các chính sách tích hợp sẵn tiếp tục). Xem [docs/custom-hooks.mdx](docs/custom-hooks.mdx) để biết hướng dẫn đầy đủ.
227
+ Hook tùy chỉnh hỗ trợ nhập cục bộ chuyển tiếp, async/await, và truy cập vào `process.env`. Các lỗi mở không kiểm soát được (ghi vào `~/.failproofai/hook.log`, các chính sách tích hợp sẵn tiếp tục). Xem [docs/custom-hooks.mdx](docs/custom-hooks.mdx) để biết hướng dẫn đầy đủ.
228
228
 
229
229
  ### Chính sách dựa trên quy ước
230
230
 
231
- Thả các tệp `*policies.{js,mjs,ts}` vào `.failproofai/policies/` và chúng sẽ được tải tự động — không cần cờ `--custom` hoặc thay đổi cấu hình. Hoạt động giống như git hooks: thả một tệp, nó hoạt động.
231
+ Bỏ các tệp `*policies.{js,mjs,ts}` vào `.failproofai/policies/` và chúng sẽ tự động được tải — không cần cờ `--custom` hoặc thay đổi cấu hình. Hoạt động giống như git hooks: bỏ một tệp, nó chỉ hoạt động.
232
232
 
233
233
  ```text
234
- # Cấp độ dự án — được commit vào git, chia sẻ với nhóm
234
+ # Cấp dự án — được commit vào git, chia sẻ với đội
235
235
  .failproofai/policies/security-policies.mjs
236
236
  .failproofai/policies/workflow-policies.mjs
237
237
 
238
- # Cấp độ người dùng — cá nhân, áp dụng cho tất cả các dự án
238
+ # Cấp người dùng — cá nhân, áp dụng cho tất cả các dự án
239
239
  ~/.failproofai/policies/my-policies.mjs
240
240
  ```
241
241
 
242
- Cả hai cấp độ đều tải (union). Tệp được tải theo thứ tự bảng chữ cái trong mỗi thư mục. Tiền tố với `01-`, `02-`, v.v. để kiểm soát thứ tự. Xem [examples/convention-policies/](examples/convention-policies/) để biết các ví dụ sẵn sàng sử dụng.
242
+ Cả hai cấp tải (hợp nhất). Các tệp được tải theo thứ tự bảng chữ cái trong mỗi thư mục. Tiền tố bằng `01-`, `02-`, v.v. để kiểm soát thứ tự. Xem [examples/convention-policies/](examples/convention-policies/) để biết các ví dụ sẵn sàng sử dụng.
243
243
 
244
244
  ---
245
245
 
246
- ## Đo lường hiệu suất
246
+ ## Telemetry
247
247
 
248
- Failproof AI thu thập telemetry sử dụng ẩn danh thông qua PostHog để hiểu cách sử dụng tính năng. Không bao giờ gửi nội dung phiên, tên tệp, đầu vào công cụ hoặc thông tin cá nhân.
248
+ Failproof AI thu thập telemetry sử dụng ẩn danh thông qua PostHog để hiểu mức độ sử dụng tính năng. Nội dung phiên, tên tệp, đầu vào công cụ hoặc thông tin cá nhân không bao giờ được gửi.
249
249
 
250
- Tắt nó:
250
+ hiệu hóa nó:
251
251
 
252
252
  ```bash
253
253
  FAILPROOFAI_TELEMETRY_DISABLED=1 failproofai
@@ -258,14 +258,14 @@ FAILPROOFAI_TELEMETRY_DISABLED=1 failproofai
258
258
  ## Tài liệu
259
259
 
260
260
  | Hướng dẫn | Mô tả |
261
- |---------|--------|
261
+ |---------|-------|
262
262
  | [Getting Started](docs/getting-started.mdx) | Cài đặt và các bước đầu tiên |
263
263
  | [Built-in Policies](docs/built-in-policies.mdx) | Tất cả 30 chính sách tích hợp sẵn với các tham số |
264
- | [Custom Policies](docs/custom-policies.mdx) | Viết chính sách của riêng bạn |
264
+ | [Custom Policies](docs/custom-policies.mdx) | Viết các chính sách của riêng bạn |
265
265
  | [Configuration](docs/configuration.mdx) | Định dạng tệp cấu hình và hợp nhất phạm vi |
266
266
  | [Dashboard](docs/dashboard.mdx) | Giám sát các phiên và xem xét hoạt động chính sách |
267
267
  | [Architecture](docs/architecture.mdx) | Cách hệ thống hook hoạt động |
268
- | [Testing](docs/testing.mdx) | Chạy các bài kiểm tra và viết bài kiểm tra mới |
268
+ | [Testing](docs/testing.mdx) | Chạy bài kiểm tra và viết các bài mới |
269
269
 
270
270
  ### Chạy tài liệu cục bộ
271
271
 
@@ -274,7 +274,7 @@ docker build -f Dockerfile.docs -t failproofai-docs .
274
274
  docker run --rm -p 3000:3000 failproofai-docs
275
275
  ```
276
276
 
277
- Mở trang Mintlify docs tại `http://localhost:3000`. Container theo dõi những thay đổi nếu bạn gắn thư mục tài liệu:
277
+ Mở trang web tài liệu Mintlify tại `http://localhost:3000`. Container theo dõi các thay đổi nếu bạn gắn thư mục tài liệu:
278
278
 
279
279
  ```bash
280
280
  docker run --rm -p 3000:3000 -v $(pwd)/docs:/app/docs failproofai-docs
@@ -282,11 +282,11 @@ docker run --rm -p 3000:3000 -v $(pwd)/docs:/app/docs failproofai-docs
282
282
 
283
283
  ---
284
284
 
285
- ## Ghi chú cho những người đóng góp failproofai
285
+ ## Lưu ý cho những người đóng góp failproofai
286
286
 
287
- Tệp `.claude/settings.json` của kho này sử dụng `bun ./bin/failproofai.mjs --hook <EventType>` thay vì lệnh `npx -y failproofai` tiêu chuẩn. Điều này là vì chạy `npx -y failproofai` bên trong chính dự án failproofai tạo ra xung đột tự tham chiếu.
287
+ `.claude/settings.json` của repo này sử dụng `bun ./bin/failproofai.mjs --hook <EventType>` thay vì lệnh `npx -y failproofai` tiêu chuẩn. Điều này là vì chạy `npx -y failproofai` bên trong chính dự án failproofai tạo ra một xung đột tự tham chiếu.
288
288
 
289
- Đối với tất cả các kho khác, phương pháp được khuyến nghị là `npx -y failproofai`, được cài đặt thông qua:
289
+ Đối với tất cả các repo khác, phương pháp được khuyến nghị là `npx -y failproofai`, được cài đặt thông qua:
290
290
 
291
291
  ```bash
292
292
  failproofai policies --install --scope project
@@ -304,5 +304,5 @@ Xem [LICENSE](LICENSE).
304
304
 
305
305
  ---
306
306
 
307
- Được xây dựng và duy trì bởi **ExosphereHost: Phòng thí nghiệm nghiên cứu độ tin cậy cho các Agent của bạn**. Chúng tôi giúp các doanh nghiệp và các công ty khởi nghiệp cải thiện độ tin cậy của các agent AI của họ thông qua các agent, phần mềm và chuyên môn của chúng tôi. Tìm hiểu thêm tại [exosphere.host](https://exosphere.host).
307
+ Được xây dựng và duy trì bởi **ExosphereHost: Phòng thí nghiệm nghiên cứu độ tin cậy cho Agents của bạn**. Chúng tôi giúp các doanh nghiệp và startup cải thiện độ tin cậy của các AI agents của họ thông qua các agents, phần mềm và chuyên môn của chính chúng tôi. Tìm hiểu thêm tại [exosphere.host](https://exosphere.host).
308
308
  ```
@@ -21,23 +21,23 @@
21
21
  [![CI](https://img.shields.io/github/actions/workflow/status/exospherehost/failproofai/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/exospherehost/failproofai/actions)
22
22
  [![Slack](https://img.shields.io/badge/Slack-join%20us-4A154B?style=flat-square&logo=slack)](https://join.slack.com/t/failproofai/shared_invite/zt-3v63b7k5e-O3NBHmj8X6n9gZSGDx6ggQ)
23
23
 
24
- **翻译版本**: [简体中文](docs/i18n/README.zh.md) | [日本語](docs/i18n/README.ja.md) | [한국어](docs/i18n/README.ko.md) | [Español](docs/i18n/README.es.md) | [Português](docs/i18n/README.pt-br.md) | [Deutsch](docs/i18n/README.de.md) | [Français](docs/i18n/README.fr.md) | [Русский](docs/i18n/README.ru.md) | [हिन्दी](docs/i18n/README.hi.md) | [Türkçe](docs/i18n/README.tr.md) | [Tiếng Việt](docs/i18n/README.vi.md) | [Italiano](docs/i18n/README.it.md) | [العربية](docs/i18n/README.ar.md) | [עברית](docs/i18n/README.he.md)
24
+ **语言版本**: [简体中文](docs/i18n/README.zh.md) | [日本語](docs/i18n/README.ja.md) | [한국어](docs/i18n/README.ko.md) | [Español](docs/i18n/README.es.md) | [Português](docs/i18n/README.pt-br.md) | [Deutsch](docs/i18n/README.de.md) | [Français](docs/i18n/README.fr.md) | [Русский](docs/i18n/README.ru.md) | [हिन्दी](docs/i18n/README.hi.md) | [Türkçe](docs/i18n/README.tr.md) | [Tiếng Việt](docs/i18n/README.vi.md) | [Italiano](docs/i18n/README.it.md) | [العربية](docs/i18n/README.ar.md) | [עברית](docs/i18n/README.he.md)
25
25
 
26
- 管理策略的最简便方式,让你的 AI 智能体保持可靠、专注任务、自主运行——适用于 **Claude Code** 和 **Agents SDK**。
26
+ 管理策略的最简方式,让你的 AI 智能体保持可靠、专注任务、自主运行 —— 适用于 **Claude Code** 和 **Agents SDK**。
27
27
 
28
- - **30 条内置策略** - 开箱即用,覆盖常见的智能体故障模式。拦截破坏性命令、防止密钥泄露、将智能体限制在项目边界内、检测循环等。
29
- - **自定义策略** - 用 JavaScript 编写你自己的可靠性规则。使用 `allow`/`deny`/`instruct` API 强制执行规范、防止漂移、控制操作或与外部系统集成。
30
- - **简易配置** - 无需编写代码即可调整任意策略。按项目或全局设置允许列表、受保护分支、阈值,三级配置自动合并。
31
- - **智能体监控** - 查看智能体在你离开期间的所有操作。浏览会话、检查每次工具调用,精确回顾策略触发的位置。
28
+ - **30 条内置策略** - 开箱即用,捕捉常见的智能体故障模式。阻止破坏性命令、防止密钥泄露、将智能体限制在项目边界内、检测死循环等。
29
+ - **自定义策略** - 用 JavaScript 编写你自己的可靠性规则。使用 `allow`/`deny`/`instruct` API 来执行规范、防止偏差、管控操作,或与外部系统集成。
30
+ - **简便配置** - 无需编写代码即可调整任意策略。可按项目或全局设置白名单、受保护分支、阈值。三级配置作用域自动合并。
31
+ - **智能体监控** - 查看智能体在你离开时的所有操作。浏览会话记录、检查每次工具调用,精确回溯策略触发位置。
32
32
 
33
- 一切均在本地运行——数据不会离开你的机器。
33
+ 所有内容均在本地运行 —— 数据不会离开你的机器。
34
34
 
35
35
  ---
36
36
 
37
- ## 系统要求
37
+ ## 环境要求
38
38
 
39
39
  - Node.js >= 20.9.0
40
- - Bun >= 1.3.0(可选——仅在开发或从源码构建时需要)
40
+ - Bun >= 1.3.0(可选 —— 仅在开发或从源码构建时需要)
41
41
 
42
42
  ---
43
43
 
@@ -59,7 +59,7 @@ bun add -g failproofai
59
59
  failproofai policies --install
60
60
  ```
61
61
 
62
- 将 hook 条目写入 `~/.claude/settings.json`。Claude Code 此后将在每次工具调用前后调用 failproofai。
62
+ 将 hook 条目写入 `~/.claude/settings.json`。此后 Claude Code 将在每次工具调用前后自动调用 failproofai。
63
63
 
64
64
  ### 2. 启动控制台
65
65
 
@@ -67,7 +67,7 @@ failproofai policies --install
67
67
  failproofai
68
68
  ```
69
69
 
70
- 打开 `http://localhost:8020`——浏览会话、查看日志、管理策略。
70
+ 打开 `http://localhost:8020` —— 浏览会话记录、查看日志、管理策略。
71
71
 
72
72
  ### 3. 查看当前启用的策略
73
73
 
@@ -82,12 +82,12 @@ failproofai policies
82
82
  ### 作用域
83
83
 
84
84
  | 作用域 | 命令 | 写入位置 |
85
- |--------|------|---------|
85
+ |--------|------|----------|
86
86
  | 全局(默认) | `failproofai policies --install` | `~/.claude/settings.json` |
87
87
  | 项目级 | `failproofai policies --install --scope project` | `.claude/settings.json` |
88
88
  | 本地级 | `failproofai policies --install --scope local` | `.claude/settings.local.json` |
89
89
 
90
- ### 安装指定策略
90
+ ### 安装特定策略
91
91
 
92
92
  ```bash
93
93
  failproofai policies --install block-sudo block-rm-rf sanitize-api-keys
@@ -105,7 +105,7 @@ failproofai policies --uninstall --scope project
105
105
 
106
106
  ## 配置
107
107
 
108
- 策略配置存储在 `~/.failproofai/policies-config.json`(全局)或项目目录下的 `.failproofai/policies-config.json`(项目级)。
108
+ 策略配置文件位于全局的 `~/.failproofai/policies-config.json`,或项目级的 `.failproofai/policies-config.json`。
109
109
 
110
110
  ```json
111
111
  {
@@ -138,32 +138,32 @@ failproofai policies --uninstall --scope project
138
138
  }
139
139
  ```
140
140
 
141
- **三级配置作用域**自动合并(项目级 → 本地级 → 全局级)。完整合并规则参见 [docs/configuration.mdx](docs/configuration.mdx)。
141
+ **三级配置作用域**自动合并(项目级 → 本地级 → 全局)。完整合并规则请参阅 [docs/configuration.mdx](docs/configuration.mdx)。
142
142
 
143
143
  ---
144
144
 
145
145
  ## 内置策略
146
146
 
147
147
  | 策略 | 说明 | 可配置项 |
148
- |------|------|:---:|
148
+ |------|------|:--------:|
149
149
  | `block-sudo` | 阻止智能体运行特权系统命令 | `allowPatterns` |
150
150
  | `block-rm-rf` | 防止意外递归删除文件 | `allowPaths` |
151
- | `block-curl-pipe-sh` | 阻止智能体将不可信脚本通过管道传给 shell | |
152
- | `block-failproofai-commands` | 阻止自我卸载 | |
153
- | `sanitize-jwt` | 防止 JWT 令牌泄露到智能体上下文中 | |
154
- | `sanitize-api-keys` | 防止 API 密钥泄露到智能体上下文中 | `additionalPatterns` |
155
- | `sanitize-connection-strings` | 防止数据库凭据泄露到智能体上下文中 | |
156
- | `sanitize-private-key-content` | 从输出中删除 PEM 私钥块 | |
157
- | `sanitize-bearer-tokens` | 从输出中删除 Authorization Bearer 令牌 | |
151
+ | `block-curl-pipe-sh` | 阻止智能体将不可信脚本通过管道传入 shell | |
152
+ | `block-failproofai-commands` | 防止自卸载 | |
153
+ | `sanitize-jwt` | 阻止 JWT 令牌泄露到智能体上下文中 | |
154
+ | `sanitize-api-keys` | 阻止 API 密钥泄露到智能体上下文中 | `additionalPatterns` |
155
+ | `sanitize-connection-strings` | 阻止数据库凭据泄露到智能体上下文中 | |
156
+ | `sanitize-private-key-content` | 从输出中脱敏 PEM 私钥块 | |
157
+ | `sanitize-bearer-tokens` | 从输出中脱敏 Authorization Bearer 令牌 | |
158
158
  | `block-env-files` | 阻止智能体读取 .env 文件 | |
159
- | `protect-env-vars` | 阻止智能体打印环境变量 | |
159
+ | `protect-env-vars` | 防止智能体打印环境变量 | |
160
160
  | `block-read-outside-cwd` | 将智能体限制在项目边界内 | `allowPaths` |
161
- | `block-secrets-write` | 阻止向私钥和证书文件写入 | `additionalPatterns` |
162
- | `block-push-master` | 防止意外推送到 main/master | `protectedBranches` |
163
- | `block-work-on-main` | 禁止智能体操作受保护分支 | `protectedBranches` |
161
+ | `block-secrets-write` | 防止向私钥和证书文件写入内容 | `additionalPatterns` |
162
+ | `block-push-master` | 防止意外推送到 main/master 分支 | `protectedBranches` |
163
+ | `block-work-on-main` | 阻止智能体在受保护分支上操作 | `protectedBranches` |
164
164
  | `block-force-push` | 阻止 `git push --force` | |
165
165
  | `warn-git-amend` | 在修改提交前提醒智能体 | |
166
- | `warn-git-stash-drop` | 在丢弃储藏区前提醒智能体 | |
166
+ | `warn-git-stash-drop` | 在丢弃 stash 前提醒智能体 | |
167
167
  | `warn-all-files-staged` | 捕获意外的 `git add -A` | |
168
168
  | `warn-destructive-sql` | 在执行前捕获 DROP/DELETE SQL | |
169
169
  | `warn-schema-alteration` | 在执行前捕获 ALTER TABLE | |
@@ -171,7 +171,7 @@ failproofai policies --uninstall --scope project
171
171
  | `warn-package-publish` | 捕获意外的 `npm publish` | |
172
172
  | `warn-background-process` | 捕获意外启动的后台进程 | |
173
173
  | `warn-global-package-install` | 捕获意外的全局包安装 | |
174
- | …以及更多 | | |
174
+ | ……以及更多 | | |
175
175
 
176
176
  完整策略详情和参数参考:[docs/built-in-policies.mdx](docs/built-in-policies.mdx)
177
177
 
@@ -179,7 +179,7 @@ failproofai policies --uninstall --scope project
179
179
 
180
180
  ## 自定义策略
181
181
 
182
- 编写你自己的策略,使智能体保持可靠并专注任务:
182
+ 编写你自己的策略,让智能体保持可靠和专注:
183
183
 
184
184
  ```js
185
185
  import { customPolicies, allow, deny, instruct } from "failproofai";
@@ -197,7 +197,7 @@ customPolicies.add({
197
197
  });
198
198
  ```
199
199
 
200
- 通过以下命令安装:
200
+ 安装方式:
201
201
 
202
202
  ```bash
203
203
  failproofai policies --install --custom ./my-policies.js
@@ -208,44 +208,44 @@ failproofai policies --install --custom ./my-policies.js
208
208
  | 函数 | 效果 |
209
209
  |------|------|
210
210
  | `allow()` | 允许该操作 |
211
- | `allow(message)` | 允许并向 Claude 发送信息性上下文 |
212
- | `deny(message)` | 阻止该操作;消息将显示给 Claude |
213
- | `instruct(message)` | 向 Claude 的提示词添加上下文;不会阻止操作 |
211
+ | `allow(message)` | 允许操作,并向 Claude 发送信息性上下文 |
212
+ | `deny(message)` | 阻止操作;消息将显示给 Claude |
213
+ | `instruct(message)` | 向 Claude 的提示词中添加上下文;不阻止操作 |
214
214
 
215
215
  ### 上下文对象(`ctx`)
216
216
 
217
217
  | 字段 | 类型 | 说明 |
218
218
  |------|------|------|
219
219
  | `eventType` | `string` | `"PreToolUse"`、`"PostToolUse"`、`"Notification"`、`"Stop"` |
220
- | `toolName` | `string` | 被调用的工具(`"Bash"`、`"Write"`、`"Read"` 等) |
220
+ | `toolName` | `string` | 被调用的工具(`"Bash"`、`"Write"`、`"Read"`……) |
221
221
  | `toolInput` | `object` | 工具的输入参数 |
222
- | `payload` | `object` | 完整的原始事件载荷 |
222
+ | `payload` | `object` | 完整的原始事件负载 |
223
223
  | `session.cwd` | `string` | Claude Code 会话的工作目录 |
224
224
  | `session.sessionId` | `string` | 会话标识符 |
225
- | `session.transcriptPath` | `string` | 会话记录文件的路径 |
225
+ | `session.transcriptPath` | `string` | 会话记录文件路径 |
226
226
 
227
- 自定义 hook 支持传递性本地导入、async/await,以及访问 `process.env`。错误采用放行处理(记录到 `~/.failproofai/hook.log`,内置策略继续执行)。完整指南参见 [docs/custom-hooks.mdx](docs/custom-hooks.mdx)。
227
+ 自定义 hook 支持传递式本地导入、async/await,以及访问 `process.env`。错误采用开放失败策略(记录到 `~/.failproofai/hook.log`,内置策略继续执行)。完整指南请参阅 [docs/custom-hooks.mdx](docs/custom-hooks.mdx)。
228
228
 
229
229
  ### 基于约定的策略
230
230
 
231
- 将 `*policies.{js,mjs,ts}` 文件放入 `.failproofai/policies/` 目录,它们将自动加载——无需 `--custom` 标志或配置变更。就像 git hooks 一样:放入文件即可生效。
231
+ 将 `*policies.{js,mjs,ts}` 文件放入 `.failproofai/policies/` 目录,它们会被自动加载 —— 无需 `--custom` 标志或任何配置变更。就像 git hooks 一样:放入文件即可生效。
232
232
 
233
233
  ```text
234
- # 项目级——提交到 git,与团队共享
234
+ # 项目级 —— 提交到 git,与团队共享
235
235
  .failproofai/policies/security-policies.mjs
236
236
  .failproofai/policies/workflow-policies.mjs
237
237
 
238
- # 用户级——个人专属,适用于所有项目
238
+ # 用户级 —— 个人专属,适用于所有项目
239
239
  ~/.failproofai/policies/my-policies.mjs
240
240
  ```
241
241
 
242
- 两个级别均会加载(取并集)。文件在各目录内按字母顺序加载。使用 `01-`、`02-` 等前缀来控制加载顺序。即用型示例参见 [examples/convention-policies/](examples/convention-policies/)。
242
+ 两个级别均会加载(取并集)。同一目录内的文件按字母顺序加载。可使用 `01-`、`02-` 等前缀控制加载顺序。开箱即用的示例请参阅 [examples/convention-policies/](examples/convention-policies/)。
243
243
 
244
244
  ---
245
245
 
246
246
  ## 遥测
247
247
 
248
- Failproof AI 通过 PostHog 收集匿名使用遥测数据,用于了解功能使用情况。会话内容、文件名、工具输入或任何个人信息均不会被发送。
248
+ Failproof AI 通过 PostHog 收集匿名使用遥测数据,以了解功能使用情况。我们从不发送任何会话内容、文件名、工具输入或个人信息。
249
249
 
250
250
  禁用遥测:
251
251
 
@@ -259,8 +259,8 @@ FAILPROOFAI_TELEMETRY_DISABLED=1 failproofai
259
259
 
260
260
  | 指南 | 说明 |
261
261
  |------|------|
262
- | [快速入门](docs/getting-started.mdx) | 安装与初步使用 |
263
- | [内置策略](docs/built-in-policies.mdx) | 全部 30 条内置策略及其参数 |
262
+ | [入门指南](docs/getting-started.mdx) | 安装与初步使用 |
263
+ | [内置策略](docs/built-in-policies.mdx) | 全部 30 条内置策略及参数说明 |
264
264
  | [自定义策略](docs/custom-policies.mdx) | 编写你自己的策略 |
265
265
  | [配置](docs/configuration.mdx) | 配置文件格式与作用域合并规则 |
266
266
  | [控制台](docs/dashboard.mdx) | 监控会话并查看策略活动 |
@@ -274,7 +274,7 @@ docker build -f Dockerfile.docs -t failproofai-docs .
274
274
  docker run --rm -p 3000:3000 failproofai-docs
275
275
  ```
276
276
 
277
- 在 `http://localhost:3000` 打开 Mintlify 文档站点。挂载 docs 目录后,容器会监听文件变更:
277
+ 在 `http://localhost:3000` 打开 Mintlify 文档站点。如果挂载 docs 目录,容器将监听文件变更:
278
278
 
279
279
  ```bash
280
280
  docker run --rm -p 3000:3000 -v $(pwd)/docs:/app/docs failproofai-docs
@@ -282,26 +282,26 @@ docker run --rm -p 3000:3000 -v $(pwd)/docs:/app/docs failproofai-docs
282
282
 
283
283
  ---
284
284
 
285
- ## failproofai 贡献者的说明
285
+ ## failproofai 贡献者须知
286
286
 
287
287
  本仓库的 `.claude/settings.json` 使用 `bun ./bin/failproofai.mjs --hook <EventType>` 而非标准的 `npx -y failproofai` 命令。这是因为在 failproofai 项目内部运行 `npx -y failproofai` 会产生自引用冲突。
288
288
 
289
- 对于所有其他仓库,推荐的方式是使用 `npx -y failproofai`,通过以下命令安装:
289
+ 对于所有其他仓库,推荐使用 `npx -y failproofai`,通过以下命令安装:
290
290
 
291
291
  ```bash
292
292
  failproofai policies --install --scope project
293
293
  ```
294
294
 
295
- ## 贡献指南
295
+ ## 参与贡献
296
296
 
297
- 参见 [CONTRIBUTING.md](CONTRIBUTING.md)。
297
+ 请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
298
298
 
299
299
  ---
300
300
 
301
301
  ## 许可证
302
302
 
303
- 参见 [LICENSE](LICENSE)。
303
+ 请参阅 [LICENSE](LICENSE)。
304
304
 
305
305
  ---
306
306
 
307
- 由 **ExosphereHost: 智能体可靠性研究实验室** 构建与维护。我们通过自研智能体、软件和专业知识,帮助企业和初创公司提升 AI 智能体的可靠性。了解更多,请访问 [exosphere.host](https://exosphere.host)。
307
+ 由 **ExosphereHost: 智能体可靠性研究实验室** 构建与维护。我们通过自研智能体、软件和专业知识,帮助企业和初创公司提升 AI 智能体的可靠性。了解更多请访问 [exosphere.host](https://exosphere.host)。