failproofai 0.0.6-beta.1 → 0.0.6-beta.2

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 (160) hide show
  1. package/.next/standalone/.failproofai/policies/review-policies.mjs +4 -3
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/build-manifest.json +3 -3
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/required-server-files.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  11. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  12. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  13. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  14. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  15. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  20. package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
  21. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  22. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  23. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  24. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  25. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  26. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  27. package/.next/standalone/.next/server/app/index.html +1 -1
  28. package/.next/standalone/.next/server/app/index.rsc +15 -15
  29. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  30. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  31. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  32. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
  33. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  34. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  35. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  38. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  41. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  44. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  45. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  48. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +1 -1
  51. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
  52. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0~kmh8w._.js → [root-of-the-server]__05akje6._.js} +2 -2
  53. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
  54. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
  55. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
  56. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
  57. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0rh.18_._.js → [root-of-the-server]__0i5kvry._.js} +2 -2
  58. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
  59. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +2 -2
  60. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
  61. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
  62. package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
  63. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
  64. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
  65. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  66. package/.next/standalone/.next/server/pages/404.html +2 -2
  67. package/.next/standalone/.next/server/pages/500.html +1 -1
  68. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
  70. package/.next/standalone/.next/static/chunks/{08t08igdql9yt.js → 00j0rr7rh8ef8.js} +1 -1
  71. package/.next/standalone/.next/static/chunks/{12~yi9oj8av8p.js → 05j1px0r8yzh6.js} +2 -2
  72. package/.next/standalone/.next/static/chunks/{09_k80d~cq2wg.js → 0badv41uxa56..js} +1 -1
  73. package/.next/standalone/.next/static/chunks/{0wlyoif4_kj_t.js → 0ijk_kek9_wyx.js} +1 -1
  74. package/.next/standalone/.next/static/chunks/{0bvhsa6zva2o..js → 0ksdlt_1hucdm.js} +1 -1
  75. package/.next/standalone/.next/static/chunks/{03rz6ykw-a2xi.js → 0npb~873.wvg3.js} +1 -1
  76. package/.next/standalone/.next/static/chunks/{01b~z8f1ws0rk.js → 0xpl.oscrakvx.js} +1 -1
  77. package/.next/standalone/.next/static/chunks/{0gbf4cphy8ksq.js → 1052sguyd-.ka.js} +1 -1
  78. package/.next/standalone/.next/static/chunks/{0v.yd0kg_ld3r.js → 14cl9poem30dq.js} +1 -1
  79. package/.next/standalone/CHANGELOG.md +11 -0
  80. package/.next/standalone/dist/cli.mjs +3 -3
  81. package/.next/standalone/docs/ar/built-in-policies.mdx +124 -87
  82. package/.next/standalone/docs/ar/custom-policies.mdx +72 -72
  83. package/.next/standalone/docs/ar/examples.mdx +86 -33
  84. package/.next/standalone/docs/ar/getting-started.mdx +82 -29
  85. package/.next/standalone/docs/built-in-policies.mdx +1 -1
  86. package/.next/standalone/docs/de/built-in-policies.mdx +93 -56
  87. package/.next/standalone/docs/de/custom-policies.mdx +56 -56
  88. package/.next/standalone/docs/de/examples.mdx +72 -18
  89. package/.next/standalone/docs/de/getting-started.mdx +72 -20
  90. package/.next/standalone/docs/es/built-in-policies.mdx +115 -78
  91. package/.next/standalone/docs/es/custom-policies.mdx +55 -55
  92. package/.next/standalone/docs/es/examples.mdx +73 -19
  93. package/.next/standalone/docs/es/getting-started.mdx +72 -20
  94. package/.next/standalone/docs/fr/built-in-policies.mdx +83 -46
  95. package/.next/standalone/docs/fr/custom-policies.mdx +51 -51
  96. package/.next/standalone/docs/fr/examples.mdx +78 -24
  97. package/.next/standalone/docs/fr/getting-started.mdx +65 -13
  98. package/.next/standalone/docs/he/built-in-policies.mdx +156 -117
  99. package/.next/standalone/docs/he/custom-policies.mdx +75 -75
  100. package/.next/standalone/docs/he/examples.mdx +87 -33
  101. package/.next/standalone/docs/he/getting-started.mdx +84 -33
  102. package/.next/standalone/docs/hi/built-in-policies.mdx +101 -60
  103. package/.next/standalone/docs/hi/custom-policies.mdx +71 -70
  104. package/.next/standalone/docs/hi/examples.mdx +90 -36
  105. package/.next/standalone/docs/hi/getting-started.mdx +80 -27
  106. package/.next/standalone/docs/i18n/README.ar.md +69 -69
  107. package/.next/standalone/docs/i18n/README.de.md +46 -46
  108. package/.next/standalone/docs/i18n/README.es.md +42 -42
  109. package/.next/standalone/docs/i18n/README.fr.md +39 -39
  110. package/.next/standalone/docs/i18n/README.he.md +83 -83
  111. package/.next/standalone/docs/i18n/README.hi.md +69 -69
  112. package/.next/standalone/docs/i18n/README.it.md +72 -72
  113. package/.next/standalone/docs/i18n/README.ja.md +71 -71
  114. package/.next/standalone/docs/i18n/README.ko.md +52 -52
  115. package/.next/standalone/docs/i18n/README.pt-br.md +44 -44
  116. package/.next/standalone/docs/i18n/README.ru.md +66 -66
  117. package/.next/standalone/docs/i18n/README.tr.md +82 -83
  118. package/.next/standalone/docs/i18n/README.vi.md +70 -71
  119. package/.next/standalone/docs/i18n/README.zh.md +51 -51
  120. package/.next/standalone/docs/it/built-in-policies.mdx +118 -81
  121. package/.next/standalone/docs/it/custom-policies.mdx +69 -69
  122. package/.next/standalone/docs/it/examples.mdx +93 -39
  123. package/.next/standalone/docs/it/getting-started.mdx +73 -21
  124. package/.next/standalone/docs/ja/built-in-policies.mdx +98 -61
  125. package/.next/standalone/docs/ja/custom-policies.mdx +71 -71
  126. package/.next/standalone/docs/ja/examples.mdx +76 -22
  127. package/.next/standalone/docs/ja/getting-started.mdx +65 -13
  128. package/.next/standalone/docs/ko/built-in-policies.mdx +137 -100
  129. package/.next/standalone/docs/ko/custom-policies.mdx +67 -67
  130. package/.next/standalone/docs/ko/examples.mdx +87 -33
  131. package/.next/standalone/docs/ko/getting-started.mdx +61 -9
  132. package/.next/standalone/docs/pt-br/built-in-policies.mdx +94 -57
  133. package/.next/standalone/docs/pt-br/custom-policies.mdx +56 -56
  134. package/.next/standalone/docs/pt-br/examples.mdx +78 -24
  135. package/.next/standalone/docs/pt-br/getting-started.mdx +64 -12
  136. package/.next/standalone/docs/ru/built-in-policies.mdx +142 -105
  137. package/.next/standalone/docs/ru/custom-policies.mdx +82 -81
  138. package/.next/standalone/docs/ru/examples.mdx +77 -22
  139. package/.next/standalone/docs/ru/getting-started.mdx +74 -22
  140. package/.next/standalone/docs/tr/built-in-policies.mdx +104 -67
  141. package/.next/standalone/docs/tr/custom-policies.mdx +59 -60
  142. package/.next/standalone/docs/tr/examples.mdx +97 -42
  143. package/.next/standalone/docs/tr/getting-started.mdx +75 -23
  144. package/.next/standalone/docs/vi/built-in-policies.mdx +110 -72
  145. package/.next/standalone/docs/vi/custom-policies.mdx +68 -68
  146. package/.next/standalone/docs/vi/examples.mdx +93 -38
  147. package/.next/standalone/docs/vi/getting-started.mdx +74 -22
  148. package/.next/standalone/docs/zh/built-in-policies.mdx +132 -95
  149. package/.next/standalone/docs/zh/custom-policies.mdx +49 -49
  150. package/.next/standalone/docs/zh/examples.mdx +90 -36
  151. package/.next/standalone/docs/zh/getting-started.mdx +73 -21
  152. package/.next/standalone/package.json +1 -1
  153. package/.next/standalone/server.js +1 -1
  154. package/.next/standalone/src/hooks/builtin-policies.ts +5 -1
  155. package/dist/cli.mjs +3 -3
  156. package/package.json +1 -1
  157. package/src/hooks/builtin-policies.ts +5 -1
  158. /package/.next/standalone/.next/static/{CkmOT-ZvDN-sVULinGVKT → A9pNTZdoYJTVyPAYwQMx5}/_buildManifest.js +0 -0
  159. /package/.next/standalone/.next/static/{CkmOT-ZvDN-sVULinGVKT → A9pNTZdoYJTVyPAYwQMx5}/_clientMiddlewareManifest.js +0 -0
  160. /package/.next/standalone/.next/static/{CkmOT-ZvDN-sVULinGVKT → A9pNTZdoYJTVyPAYwQMx5}/_ssgManifest.js +0 -0
@@ -21,14 +21,14 @@
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
- **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)
24
+ **Translations**: [简体中文](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ú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**.
26
+ Cách dễ nhất để quản lý các chính sách giữ cho các AI agent 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**.
27
27
 
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.
28
+ - **30 Chính sách tích hợp** - Bắt các chế độ lỗi phổ biến của agent ngay lập tức. 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.v.
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 sai lệch, gating 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** - Đ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, các nhánh được bảo vệ, ngưỡng cho mỗi dự án hoặc toàn cầu. Ba cấu hình phạm vi hợp nhất 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 qua các phiên, kiểm tra từng lệnh gọi công cụ, và xem lại chính xác nơi các chính sách đã kích hoạt.
32
32
 
33
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
 
@@ -53,23 +53,23 @@ bun add -g failproofai
53
53
 
54
54
  ## Bắt đầu nhanh
55
55
 
56
- ### 1. Bật chính sách toàn cục
56
+ ### 1. Bật chính sách toàn cầu
57
57
 
58
58
  ```bash
59
59
  failproofai policies --install
60
60
  ```
61
61
 
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ụ.
62
+ Ghi các mục hook vào `~/.claude/settings.json`. Claude Code sẽ bây giờ gọi failproofai trước và sau mỗi lệnh gọi công cụ.
63
63
 
64
- ### 2. Khởi động bảng điều khiển
64
+ ### 2. Khởi chạy 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 làm việc, kiểm tra nhật ký, quản lý chính sách.
70
+ Mở `http://localhost:8020` - duyệt qua các phiên, kiểm tra nhật ký, quản lý chính sách.
71
71
 
72
- ### 3. Kiểm tra những gì đang hoạt động
72
+ ### 3. Kiểm tra cái gì đang hoạt động
73
73
 
74
74
  ```bash
75
75
  failproofai policies
@@ -83,17 +83,17 @@ failproofai policies
83
83
 
84
84
  | Phạm vi | Lệnh | Nơi ghi |
85
85
  |--------|------|---------|
86
- | Toàn cục (mặc định) | `failproofai policies --install` | `~/.claude/settings.json` |
86
+ | Toàn cầu (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
 
90
- ### Cài đặt chính sách cụ thể
90
+ ### Cài đặt các chính sách cụ thể
91
91
 
92
92
  ```bash
93
93
  failproofai policies --install block-sudo block-rm-rf sanitize-api-keys
94
94
  ```
95
95
 
96
- ### Gỡ bỏ chính sách
96
+ ### Xóa chính sách
97
97
 
98
98
  ```bash
99
99
  failproofai policies --uninstall
@@ -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ục) hoặc `.failproofai/policies-config.json` trong dự án của bạn (theo dự án).
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 (cho mỗi dự án).
109
109
 
110
110
  ```json
111
111
  {
@@ -120,11 +120,11 @@ 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": "Use apt-get directly without sudo."
123
+ "hint": "Sử dụng apt-get trực tiếp mà không cần sudo."
124
124
  },
125
125
  "block-push-master": {
126
126
  "protectedBranches": ["main", "release", "prod"],
127
- "hint": "Try creating a fresh branch instead."
127
+ "hint": "Hãy thử tạo một nhánh mới thay thế."
128
128
  },
129
129
  "sanitize-api-keys": {
130
130
  "additionalPatterns": [
@@ -138,40 +138,40 @@ 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ục). 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 (projectlocalglobal). 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
- ## Chính sách tích hợp sẵn
145
+ ## Chính sách tích hợp
146
146
 
147
147
  | Chính sách | Mô tả | Có thể cấu hình |
148
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 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 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
- | `warn-all-files-staged` | Bắt `git add -A` tình | |
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
- | `warn-package-publish` | Bắt `npm publish` tì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
- | …và nhiều hơn nữa | | |
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 việc xóa tệp đệ quy ngẫu nhiên | `allowPaths` |
151
+ | `block-curl-pipe-sh` | Ngăn chặn các agent từ piping các tập lệnh không tin cậy vào shell | |
152
+ | `block-failproofai-commands` | Ngăn chặn tự gỡ cài đặt | |
153
+ | `sanitize-jwt` | Dừng các mã thông báo JWT rò rỉ vào bối cảnh agent | |
154
+ | `sanitize-api-keys` | Dừng các khóa API rò rỉ vào bối 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 bối 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 Authorization Bearer khỏi đầu ra | |
158
+ | `block-env-files` | Giữ các agent khỏi đọc các tệp .env | |
159
+ | `protect-env-vars` | Ngăn chặn các agent từ in các biến môi trường | |
160
+ | `block-read-outside-cwd` | Giữ các agent bên 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 các push ngẫu nhiên vào main/master | `protectedBranches` |
163
+ | `block-work-on-main` | Giữ các agent khỏi 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 bỏ stash | |
167
+ | `warn-all-files-staged` | Bắt `git add -A` ngẫu nhiên | |
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 ngoài dự kiến | `thresholdKb` |
171
+ | `warn-package-publish` | Bắt `npm publish` ngẫu nhiên | |
172
+ | `warn-background-process` | Bắt các khởi chạy quy trình nền không dự định | |
173
+ | `warn-global-package-install` | Bắt các cài đặt gói toàn cầu không dự định | |
174
+ | …và 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)
177
177
 
@@ -179,25 +179,25 @@ 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 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ụ:
182
+ Viết các 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:
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: "Block writes to paths containing 'production'",
189
+ description: "Chặn ghi vào các đường dẫn chứa '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("Writes to production paths are blocked");
194
+ if (path.includes("production")) return deny("Ghi vào các đường dẫn production bị chặn");
195
195
  return allow();
196
196
  },
197
197
  });
198
198
  ```
199
199
 
200
- Cài đặt với:
200
+ Cài đặt bằng:
201
201
 
202
202
  ```bash
203
203
  failproofai policies --install --custom ./my-policies.js
@@ -205,47 +205,47 @@ failproofai policies --install --custom ./my-policies.js
205
205
 
206
206
  ### Trợ giúp quyết định
207
207
 
208
- | Hàm | Hiệu quả |
208
+ | Hàm | Hiệu ứng |
209
209
  |-----|---------|
210
- | `allow()` | Cho phép thao tác |
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 |
210
+ | `allow()` | Cho phép hoạt động |
211
+ | `allow(message)` | Cho phép và gửi bối cảnh thông tin tới Claude |
212
+ | `deny(message)` | Chặn hoạt động; tin nhắn được hiển thị cho Claude |
213
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
- ### Đối tượng ngữ cảnh (`ctx`)
215
+ ### Đối tượng bối 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
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ô |
222
+ | `payload` | `object` | Toàn bộ tải trọng sự kiện thô |
223
223
  | `session.cwd` | `string` | Thư mục làm việc của phiên Claude Code |
224
224
  | `session.sessionId` | `string` | Định danh phiên |
225
- | `session.transcriptPath` | `string` | Đường dẫn đến tệp phiên ghi âm |
225
+ | `session.transcriptPath` | `string` | Đường dẫn tới tệp bảng lưu ý phiên |
226
226
 
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 đủ.
227
+ Các hook tùy chỉnh hỗ trợ nhập cục bộ chuyên chở, async/await, và truy cập vào `process.env`. Các lỗi được mở rộng (ghi vào `~/.failproofai/hook.log`, các chính sách tích hợp 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
- 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, chỉ hoạt động.
231
+ Thả các tệp `*policies.{js,mjs,ts}` vào `.failproofai/policies/` và chúng sẽ được tự động tải - không cần cờ hoặc thay đổi cấu hình. Cam kết thư mục vào git mọi thành viên trong nhóm sẽ tự động có được cùng tiêu chuẩn chất lượng.
232
232
 
233
233
  ```text
234
- # Cấp dự án — được commit vào git, chia sẻ với đội
234
+ # Cấp độ dự án — cam kết vào git, chia sẻ với nhóm
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ả dự án
239
239
  ~/.failproofai/policies/my-policies.mjs
240
240
  ```
241
241
 
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.
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ố với `01-`, `02-`, v.v. để kiểm soát thứ tự. Khi nhóm của bạn khám phá ra các chế độ lỗi mới, hãy thêm một chính sách và đẩy - mọi người sẽ nhận được cập nhật trên pull tiếp theo của họ. 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
- ## Telemetry
246
+ ## Viễn thông
247
247
 
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.
248
+ Failproof AI thu thập telemetry sử dụng ẩn danh 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.
249
249
 
250
250
  Vô hiệu hóa nó:
251
251
 
@@ -260,12 +260,12 @@ FAILPROOFAI_TELEMETRY_DISABLED=1 failproofai
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
- | [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ố |
263
+ | [Built-in Policies](docs/built-in-policies.mdx) | Tất cả 30 chính sách tích hợp với các tham số |
264
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
- | [Dashboard](docs/dashboard.mdx) | Giám sát các phiên và xem xét hoạt động chính sách |
266
+ | [Dashboard](docs/dashboard.mdx) | Giám sát phiên và xem lại 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 bài kiểm tra và viết các bài mới |
268
+ | [Testing](docs/testing.mdx) | Chạy các bài kiểm tra và viết các bài kiểm tra 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 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:
277
+ Mở trang web Mintlify docs tại `http://localhost:3000`. Container sẽ theo dõi các thay đổi nếu bạn gắn thư mục docs:
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
- ## Lưu ý cho những người đóng góp failproofai
285
+ ## Ghi chú cho những người đóng góp failproofai
286
286
 
287
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 repo 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, cách tiếp cận được khuyến nghị là `npx -y failproofai`, được cài đặt qua:
290
290
 
291
291
  ```bash
292
292
  failproofai policies --install --scope project
@@ -304,5 +304,4 @@ 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 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
- ```
307
+ Được xây dựng và Bảo trì bởi **ExosphereHost: Reliability Research Lab cho các Agent của bạn**. Chúng tôi giúp các doanh nghiệp và startups cải thiện độ tin cậy của các AI agent của họ thông qua các agent, phần mềm và chuyên môn của riêng chúng tôi. Tìm hiểu thêm tại [exosphere.host](https://exosphere.host).
@@ -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,17 +59,17 @@ 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
- ### 2. 启动控制台
64
+ ### 2. 启动控制面板
65
65
 
66
66
  ```bash
67
67
  failproofai
68
68
  ```
69
69
 
70
- 打开 `http://localhost:8020` —— 浏览会话记录、查看日志、管理策略。
70
+ 打开 `http://localhost:8020`——浏览会话、检查日志、管理策略。
71
71
 
72
- ### 3. 查看当前启用的策略
72
+ ### 3. 查看当前生效的策略
73
73
 
74
74
  ```bash
75
75
  failproofai policies
@@ -84,8 +84,8 @@ failproofai policies
84
84
  | 作用域 | 命令 | 写入位置 |
85
85
  |--------|------|----------|
86
86
  | 全局(默认) | `failproofai policies --install` | `~/.claude/settings.json` |
87
- | 项目级 | `failproofai policies --install --scope project` | `.claude/settings.json` |
88
- | 本地级 | `failproofai policies --install --scope local` | `.claude/settings.local.json` |
87
+ | 项目 | `failproofai policies --install --scope project` | `.claude/settings.json` |
88
+ | 本地 | `failproofai policies --install --scope local` | `.claude/settings.local.json` |
89
89
 
90
90
  ### 安装特定策略
91
91
 
@@ -97,7 +97,7 @@ failproofai policies --install block-sudo block-rm-rf sanitize-api-keys
97
97
 
98
98
  ```bash
99
99
  failproofai policies --uninstall
100
- # 或针对特定作用域:
100
+ # 或指定作用域:
101
101
  failproofai policies --uninstall --scope project
102
102
  ```
103
103
 
@@ -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,48 +138,48 @@ 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
- | `block-sudo` | 阻止智能体运行特权系统命令 | `allowPatterns` |
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` | 阻止数据库凭据泄露到智能体上下文中 | |
149
+ | `block-sudo` | 阻止智能体执行特权系统命令 | `allowPatterns` |
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
156
  | `sanitize-private-key-content` | 从输出中脱敏 PEM 私钥块 | |
157
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` | 在丢弃 stash 前提醒智能体 | |
167
- | `warn-all-files-staged` | 捕获意外的 `git add -A` | |
166
+ | `warn-git-stash-drop` | 在丢弃暂存前提醒智能体 | |
167
+ | `warn-all-files-staged` | 捕获误操作的 `git add -A` | |
168
168
  | `warn-destructive-sql` | 在执行前捕获 DROP/DELETE SQL | |
169
169
  | `warn-schema-alteration` | 在执行前捕获 ALTER TABLE | |
170
170
  | `warn-large-file-write` | 捕获意外的大文件写入 | `thresholdKb` |
171
171
  | `warn-package-publish` | 捕获意外的 `npm publish` | |
172
- | `warn-background-process` | 捕获意外启动的后台进程 | |
172
+ | `warn-background-process` | 捕获意外的后台进程启动 | |
173
173
  | `warn-global-package-install` | 捕获意外的全局包安装 | |
174
174
  | ……以及更多 | | |
175
175
 
176
- 完整策略详情和参数参考:[docs/built-in-policies.mdx](docs/built-in-policies.mdx)
176
+ 完整策略说明及参数参考:[docs/built-in-policies.mdx](docs/built-in-policies.mdx)
177
177
 
178
178
  ---
179
179
 
180
180
  ## 自定义策略
181
181
 
182
- 编写你自己的策略,让智能体保持可靠和专注:
182
+ 编写你自己的策略,让智能体保持可靠并专注于任务:
183
183
 
184
184
  ```js
185
185
  import { customPolicies, allow, deny, instruct } from "failproofai";
@@ -209,43 +209,43 @@ failproofai policies --install --custom ./my-policies.js
209
209
  |------|------|
210
210
  | `allow()` | 允许该操作 |
211
211
  | `allow(message)` | 允许操作,并向 Claude 发送信息性上下文 |
212
- | `deny(message)` | 阻止操作;消息将显示给 Claude |
213
- | `instruct(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
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/` 目录,它们会被自动加载——无需任何参数或配置变更。将该目录提交到 git,团队所有成员即可自动获得相同的质量标准。
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
 
@@ -257,13 +257,13 @@ FAILPROOFAI_TELEMETRY_DISABLED=1 failproofai
257
257
 
258
258
  ## 文档
259
259
 
260
- | 指南 | 说明 |
260
+ | 指南 | 描述 |
261
261
  |------|------|
262
- | [入门指南](docs/getting-started.mdx) | 安装与初步使用 |
262
+ | [快速入门](docs/getting-started.mdx) | 安装与初始步骤 |
263
263
  | [内置策略](docs/built-in-policies.mdx) | 全部 30 条内置策略及参数说明 |
264
264
  | [自定义策略](docs/custom-policies.mdx) | 编写你自己的策略 |
265
265
  | [配置](docs/configuration.mdx) | 配置文件格式与作用域合并规则 |
266
- | [控制台](docs/dashboard.mdx) | 监控会话并查看策略活动 |
266
+ | [控制面板](docs/dashboard.mdx) | 监控会话与审查策略活动 |
267
267
  | [架构](docs/architecture.mdx) | hook 系统的工作原理 |
268
268
  | [测试](docs/testing.mdx) | 运行测试与编写新测试 |
269
269
 
@@ -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
@@ -286,7 +286,7 @@ docker run --rm -p 3000:3000 -v $(pwd)/docs:/app/docs failproofai-docs
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
@@ -304,4 +304,4 @@ failproofai policies --install --scope project
304
304
 
305
305
  ---
306
306
 
307
- 由 **ExosphereHost: 智能体可靠性研究实验室** 构建与维护。我们通过自研智能体、软件和专业知识,帮助企业和初创公司提升 AI 智能体的可靠性。了解更多请访问 [exosphere.host](https://exosphere.host)。
307
+ 由 **ExosphereHost:智能体可靠性研究实验室** 构建与维护。我们通过自主研发的智能体、软件和专业知识,帮助企业和初创公司提升 AI 智能体的可靠性。了解更多请访问 [exosphere.host](https://exosphere.host)。