failproofai 0.0.6-beta.1 → 0.0.6-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.failproofai/policies/review-policies.mjs +4 -3
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- 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/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 +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- 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 +10 -10
- 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 +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- 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/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/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/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/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 +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]__092s1ta._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0~kmh8w._.js → [root-of-the-server]__096k.db._.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]__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]__0rh.18_._.js → [root-of-the-server]__0kyh86x._.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 +2 -2
- 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/middleware-build-manifest.js +3 -3
- 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/{0gbf4cphy8ksq.js → 0-dm_9a6nsc2l.js} +1 -1
- package/.next/standalone/.next/static/chunks/{12~yi9oj8av8p.js → 01pmw1-asbek~.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0v.yd0kg_ld3r.js → 051m32nx~n5yr.js} +1 -1
- package/.next/standalone/.next/static/chunks/{09_k80d~cq2wg.js → 0a-yctdwn368y.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0bvhsa6zva2o..js → 0ksdlt_1hucdm.js} +1 -1
- package/.next/standalone/.next/static/chunks/{01b~z8f1ws0rk.js → 0l-mu4okl-cj1.js} +1 -1
- package/.next/standalone/.next/static/chunks/{08t08igdql9yt.js → 0mazj-p-~2kc6.js} +1 -1
- package/.next/standalone/.next/static/chunks/0qakntsrpc~1j.js +6 -0
- package/.next/standalone/.next/static/chunks/{03rz6ykw-a2xi.js → 156zca6aewyr-.js} +1 -1
- package/.next/standalone/CHANGELOG.md +18 -0
- package/.next/standalone/bin/failproofai.mjs +91 -4
- package/.next/standalone/dist/cli.mjs +1156 -55
- package/.next/standalone/docs/ar/built-in-policies.mdx +140 -103
- package/.next/standalone/docs/ar/custom-policies.mdx +72 -72
- package/.next/standalone/docs/ar/examples.mdx +86 -33
- package/.next/standalone/docs/ar/getting-started.mdx +82 -29
- package/.next/standalone/docs/built-in-policies.mdx +3 -3
- package/.next/standalone/docs/de/built-in-policies.mdx +97 -60
- package/.next/standalone/docs/de/custom-policies.mdx +56 -56
- package/.next/standalone/docs/de/examples.mdx +72 -18
- package/.next/standalone/docs/de/getting-started.mdx +72 -20
- package/.next/standalone/docs/es/built-in-policies.mdx +91 -54
- package/.next/standalone/docs/es/custom-policies.mdx +55 -55
- package/.next/standalone/docs/es/examples.mdx +73 -19
- package/.next/standalone/docs/es/getting-started.mdx +72 -20
- package/.next/standalone/docs/fr/built-in-policies.mdx +99 -62
- package/.next/standalone/docs/fr/custom-policies.mdx +51 -51
- package/.next/standalone/docs/fr/examples.mdx +78 -24
- package/.next/standalone/docs/fr/getting-started.mdx +65 -13
- package/.next/standalone/docs/he/built-in-policies.mdx +139 -99
- package/.next/standalone/docs/he/custom-policies.mdx +75 -75
- package/.next/standalone/docs/he/examples.mdx +87 -33
- package/.next/standalone/docs/he/getting-started.mdx +84 -33
- package/.next/standalone/docs/hi/built-in-policies.mdx +203 -166
- package/.next/standalone/docs/hi/custom-policies.mdx +71 -70
- package/.next/standalone/docs/hi/examples.mdx +90 -36
- package/.next/standalone/docs/hi/getting-started.mdx +80 -27
- package/.next/standalone/docs/i18n/README.ar.md +69 -69
- package/.next/standalone/docs/i18n/README.de.md +46 -46
- package/.next/standalone/docs/i18n/README.es.md +42 -42
- package/.next/standalone/docs/i18n/README.fr.md +39 -39
- package/.next/standalone/docs/i18n/README.he.md +83 -83
- package/.next/standalone/docs/i18n/README.hi.md +69 -69
- package/.next/standalone/docs/i18n/README.it.md +72 -72
- package/.next/standalone/docs/i18n/README.ja.md +71 -71
- package/.next/standalone/docs/i18n/README.ko.md +52 -52
- package/.next/standalone/docs/i18n/README.pt-br.md +44 -44
- package/.next/standalone/docs/i18n/README.ru.md +66 -66
- package/.next/standalone/docs/i18n/README.tr.md +82 -83
- package/.next/standalone/docs/i18n/README.vi.md +70 -71
- package/.next/standalone/docs/i18n/README.zh.md +51 -51
- package/.next/standalone/docs/it/built-in-policies.mdx +115 -78
- package/.next/standalone/docs/it/custom-policies.mdx +69 -69
- package/.next/standalone/docs/it/examples.mdx +93 -39
- package/.next/standalone/docs/it/getting-started.mdx +73 -21
- package/.next/standalone/docs/ja/built-in-policies.mdx +155 -118
- package/.next/standalone/docs/ja/custom-policies.mdx +71 -71
- package/.next/standalone/docs/ja/examples.mdx +76 -22
- package/.next/standalone/docs/ja/getting-started.mdx +65 -13
- package/.next/standalone/docs/ko/built-in-policies.mdx +103 -66
- package/.next/standalone/docs/ko/custom-policies.mdx +67 -67
- package/.next/standalone/docs/ko/examples.mdx +87 -33
- package/.next/standalone/docs/ko/getting-started.mdx +61 -9
- package/.next/standalone/docs/pt-br/built-in-policies.mdx +72 -35
- package/.next/standalone/docs/pt-br/custom-policies.mdx +56 -56
- package/.next/standalone/docs/pt-br/examples.mdx +78 -24
- package/.next/standalone/docs/pt-br/getting-started.mdx +64 -12
- package/.next/standalone/docs/ru/built-in-policies.mdx +135 -98
- package/.next/standalone/docs/ru/custom-policies.mdx +82 -81
- package/.next/standalone/docs/ru/examples.mdx +77 -22
- package/.next/standalone/docs/ru/getting-started.mdx +74 -22
- package/.next/standalone/docs/tr/built-in-policies.mdx +126 -89
- package/.next/standalone/docs/tr/custom-policies.mdx +59 -60
- package/.next/standalone/docs/tr/examples.mdx +97 -42
- package/.next/standalone/docs/tr/getting-started.mdx +75 -23
- package/.next/standalone/docs/vi/built-in-policies.mdx +116 -81
- package/.next/standalone/docs/vi/custom-policies.mdx +68 -68
- package/.next/standalone/docs/vi/examples.mdx +93 -38
- package/.next/standalone/docs/vi/getting-started.mdx +74 -22
- package/.next/standalone/docs/zh/built-in-policies.mdx +117 -82
- package/.next/standalone/docs/zh/custom-policies.mdx +49 -49
- package/.next/standalone/docs/zh/examples.mdx +90 -36
- package/.next/standalone/docs/zh/getting-started.mdx +73 -21
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/src/auth/login.ts +104 -0
- package/.next/standalone/src/auth/logout.ts +50 -0
- package/.next/standalone/src/auth/token-store.ts +64 -0
- package/.next/standalone/src/hooks/builtin-policies.ts +27 -21
- package/.next/standalone/src/hooks/handler.ts +35 -15
- package/.next/standalone/src/relay/daemon.ts +362 -0
- package/.next/standalone/src/relay/pid.ts +76 -0
- package/.next/standalone/src/relay/queue.ts +225 -0
- package/bin/failproofai.mjs +91 -4
- package/dist/cli.mjs +1156 -55
- package/package.json +1 -1
- package/src/auth/login.ts +104 -0
- package/src/auth/logout.ts +50 -0
- package/src/auth/token-store.ts +64 -0
- package/src/hooks/builtin-policies.ts +27 -21
- package/src/hooks/handler.ts +35 -15
- package/src/relay/daemon.ts +362 -0
- package/src/relay/pid.ts +76 -0
- package/src/relay/queue.ts +225 -0
- package/.next/standalone/.next/static/chunks/0wlyoif4_kj_t.js +0 -6
- /package/.next/standalone/.next/static/{CkmOT-ZvDN-sVULinGVKT → r-wX0MuAfCjbhJm3phQc8}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{CkmOT-ZvDN-sVULinGVKT → r-wX0MuAfCjbhJm3phQc8}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{CkmOT-ZvDN-sVULinGVKT → r-wX0MuAfCjbhJm3phQc8}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
---
|
|
2
3
|
title: البدء السريع
|
|
3
4
|
description: "ثبّت failproofai، فعّل السياسات، واترك وكلاءك يعملون بموثوقية"
|
|
4
5
|
icon: rocket
|
|
@@ -30,74 +31,126 @@ bun add -g failproofai
|
|
|
30
31
|
## البدء السريع
|
|
31
32
|
|
|
32
33
|
<Steps>
|
|
33
|
-
<Step title="
|
|
34
|
-
السياسات هي قواعد تعمل قبل وبعد كل استدعاء أداة
|
|
34
|
+
<Step title="فعّل السياسات">
|
|
35
|
+
السياسات هي قواعد تعمل قبل وبعد كل استدعاء أداة للوكيل. تحتفظ بالأوامر التدميرية، تسرب الأسرار، ومشاكل الأعطال الأخرى قبل أن تسبب ضررًا.
|
|
35
36
|
|
|
36
37
|
```bash
|
|
37
38
|
failproofai policies --install
|
|
38
39
|
```
|
|
39
40
|
|
|
40
|
-
يكتب
|
|
41
|
+
هذا يكتب إدخالات hook في `settings.json` الخاص بـ Claude Code. يمكنك أيضًا التثبيت لمشروع واحد أو اختيار سياسات محددة:
|
|
41
42
|
|
|
42
43
|
```bash
|
|
43
44
|
failproofai policies --install --scope project
|
|
44
45
|
failproofai policies --install block-sudo block-rm-rf sanitize-api-keys
|
|
45
46
|
```
|
|
46
47
|
</Step>
|
|
47
|
-
<Step title="
|
|
48
|
+
<Step title="تحقق">
|
|
48
49
|
```bash
|
|
49
50
|
failproofai policies
|
|
50
51
|
```
|
|
51
52
|
|
|
52
|
-
يعرض كل سياسة،
|
|
53
|
+
يعرض كل سياسة، وما إذا كانت مفعلة، وأي معاملات مكونة.
|
|
53
54
|
</Step>
|
|
54
|
-
<Step title="
|
|
55
|
+
<Step title="شغّل لوحة المعلومات">
|
|
55
56
|
```bash
|
|
56
57
|
failproofai
|
|
57
58
|
```
|
|
58
59
|
|
|
59
|
-
يفتح لوحة معلومات محلية
|
|
60
|
+
يفتح لوحة معلومات محلية في `http://localhost:8020` حيث يمكنك استعراض الجلسات، فحص استدعاءات الأدوات، وإدارة السياسات.
|
|
60
61
|
</Step>
|
|
61
|
-
<Step title="
|
|
62
|
-
|
|
62
|
+
<Step title="شغّل وكيلك">
|
|
63
|
+
ابدأ Claude Code كالمعتاد. إذا حاول الوكيل فعل شيء محفوف بالمخاطر، يقطعه failproofai تلقائيًا. اتركه يعمل بلا مراقبة واستعرض ما حدث في لوحة المعلومات.
|
|
63
64
|
</Step>
|
|
64
65
|
</Steps>
|
|
65
66
|
|
|
66
67
|
---
|
|
67
68
|
|
|
68
|
-
##
|
|
69
|
+
## كيف تعمل السياسات
|
|
69
70
|
|
|
70
|
-
في كل مرة يشغل
|
|
71
|
+
في كل مرة يشغل الوكيل أداة، يستدعي Claude Code failproofai كعملية فرعية:
|
|
71
72
|
|
|
72
73
|
```text
|
|
73
|
-
Claude Code → failproofai --hook PreToolUse →
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
Claude Code → failproofai --hook PreToolUse → يقرأ JSON من stdin
|
|
75
|
+
يقيّم السياسات
|
|
76
|
+
يكتب القرار إلى stdout
|
|
76
77
|
```
|
|
77
78
|
|
|
78
|
-
كل سياسة
|
|
79
|
+
تُرجع كل سياسة أحد ثلاثة قرارات:
|
|
79
80
|
|
|
80
|
-
- **allow** -
|
|
81
|
-
- **deny** -
|
|
82
|
-
- **instruct** - يُضاف سياق إضافي إلى
|
|
81
|
+
- **allow** - يمضي الوكيل قدمًا بشكل طبيعي
|
|
82
|
+
- **deny** - تُحجب الإجراء، يُخبر الوكيل لماذا
|
|
83
|
+
- **instruct** - يُضاف سياق إضافي إلى موجه الوكيل
|
|
83
84
|
|
|
84
85
|
<Note>
|
|
85
|
-
تعمل
|
|
86
|
+
السياسات تعمل في عمليتك المحلية. لا يُرسل شيء إلى خدمة بعيدة.
|
|
86
87
|
</Note>
|
|
87
88
|
|
|
88
89
|
---
|
|
89
90
|
|
|
91
|
+
## أعد إعداد سياسات الفريق باستخدام السياسات المستندة إلى الاتفاقية
|
|
92
|
+
|
|
93
|
+
أسرع طريقة لتأسيس معايير الجودة عبر فريقك هي اتفاقية `.failproofai/policies/`. ضع ملفات السياسات في هذا الدليل وسيتم تحميلها تلقائيًا — بلا أعلام، بلا تغييرات في الإعدادات، بلا أوامر تثبيت.
|
|
94
|
+
|
|
95
|
+
<Steps>
|
|
96
|
+
<Step title="أنشئ دليل السياسات">
|
|
97
|
+
```bash
|
|
98
|
+
mkdir -p .failproofai/policies
|
|
99
|
+
```
|
|
100
|
+
</Step>
|
|
101
|
+
<Step title="أضف ملفات السياسات">
|
|
102
|
+
انسخ الأمثلة الأولية أو اكتب ملفك الخاص:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
cp node_modules/failproofai/examples/convention-policies/*.mjs .failproofai/policies/
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
أو أنشئ واحدة جديدة:
|
|
109
|
+
|
|
110
|
+
```js
|
|
111
|
+
// .failproofai/policies/team-policies.mjs
|
|
112
|
+
import { customPolicies, allow, deny, instruct } from "failproofai";
|
|
113
|
+
|
|
114
|
+
customPolicies.add({
|
|
115
|
+
name: "test-before-commit",
|
|
116
|
+
match: { events: ["PreToolUse"] },
|
|
117
|
+
fn: async (ctx) => {
|
|
118
|
+
if (ctx.toolName !== "Bash") return allow();
|
|
119
|
+
if (/git\s+commit/.test(ctx.toolInput?.command ?? "")) {
|
|
120
|
+
return instruct("Run tests before committing.");
|
|
121
|
+
}
|
|
122
|
+
return allow();
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
</Step>
|
|
127
|
+
<Step title="أسقط في git">
|
|
128
|
+
```bash
|
|
129
|
+
git add .failproofai/policies/
|
|
130
|
+
git commit -m "Add team quality policies"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
كل عضو في الفريق لديه failproofai مثبت يلتقط هذه السياسات تلقائيًا. لا حاجة إلى إعداد لكل مطور.
|
|
134
|
+
</Step>
|
|
135
|
+
</Steps>
|
|
136
|
+
|
|
137
|
+
<Tip>
|
|
138
|
+
أسقط `.failproofai/policies/` في مستودع ملفك بحيث يشاركها الفريق بأكمله بنفس المعايير. مع اكتشاف فريقك لأنماط فشل جديدة، أضف السياسات وادفع — يحصل الجميع على التحديث في `git pull` التالي لهم. بمرور الوقت، تصبح هذه السياسات معيار جودة حي يستمر في التحسن.
|
|
139
|
+
</Tip>
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
90
143
|
## تخزين البيانات
|
|
91
144
|
|
|
92
145
|
جميع الإعدادات والسجلات تبقى على جهازك:
|
|
93
146
|
|
|
94
|
-
| المسار | ما
|
|
147
|
+
| المسار | ما يتم تخزينه |
|
|
95
148
|
|------|----------------|
|
|
96
|
-
| `~/.failproofai/policies-config.json` | إعدادات السياسة
|
|
149
|
+
| `~/.failproofai/policies-config.json` | إعدادات السياسة العام |
|
|
97
150
|
| `~/.failproofai/hook-activity.jsonl` | سجل تنفيذ Hook |
|
|
98
|
-
| `~/.failproofai/hook.log` | سجل
|
|
99
|
-
| `.failproofai/policies-config.json` | إعدادات لكل مشروع (
|
|
100
|
-
| `.failproofai/policies-config.local.json` |
|
|
151
|
+
| `~/.failproofai/hook.log` | سجل التصحيح لأخطاء Hook المخصصة |
|
|
152
|
+
| `.failproofai/policies-config.json` | إعدادات لكل مشروع (مسجل) |
|
|
153
|
+
| `.failproofai/policies-config.local.json` | تجاوزات شخصية (مُتجاهل) |
|
|
101
154
|
|
|
102
155
|
---
|
|
103
156
|
|
|
@@ -107,7 +160,7 @@ Claude Code → failproofai --hook PreToolUse → قراءة JSON من stdin
|
|
|
107
160
|
failproofai policies --uninstall
|
|
108
161
|
```
|
|
109
162
|
|
|
110
|
-
يزيل
|
|
163
|
+
يزيل إدخالات hook من `~/.claude/settings.json`. ملفات الإعدادات في `~/.failproofai/` تُحفظ.
|
|
111
164
|
|
|
112
165
|
---
|
|
113
166
|
|
|
@@ -116,19 +169,19 @@ failproofai policies --uninstall
|
|
|
116
169
|
<CardGroup cols={2}>
|
|
117
170
|
|
|
118
171
|
<Card title="الإعدادات" icon="gear" href="/ar/configuration">
|
|
119
|
-
النطاقات
|
|
172
|
+
النطاقات وتنسيق ملف الإعدادات
|
|
120
173
|
</Card>
|
|
121
174
|
|
|
122
175
|
<Card title="السياسات المدمجة" icon="shield" href="/ar/built-in-policies">
|
|
123
|
-
جميع 26
|
|
176
|
+
جميع السياسات الـ 26 مع المعاملات
|
|
124
177
|
</Card>
|
|
125
178
|
|
|
126
179
|
<Card title="السياسات المخصصة" icon="code" href="/ar/custom-policies">
|
|
127
|
-
اكتب سياساتك الخاصة
|
|
180
|
+
اكتب سياساتك الخاصة في JavaScript
|
|
128
181
|
</Card>
|
|
129
182
|
|
|
130
183
|
<Card title="مراقب الوكيل" icon="chart-line" href="/ar/dashboard">
|
|
131
|
-
راقب الجلسات واستعرض نشاط
|
|
184
|
+
راقب الجلسات واستعرض نشاط السياسات
|
|
132
185
|
</Card>
|
|
133
186
|
|
|
134
187
|
</CardGroup>
|
|
@@ -216,13 +216,13 @@ Keep agents working inside project boundaries and away from sensitive files.
|
|
|
216
216
|
### `block-read-outside-cwd`
|
|
217
217
|
|
|
218
218
|
**Event:** PreToolUse (Read, Bash)
|
|
219
|
-
**Default:** Denies reading files outside the current working directory
|
|
219
|
+
**Default:** Denies reading files outside the project root. The boundary is `CLAUDE_PROJECT_DIR` (set once per session by Claude Code), with a fallback to the session's current working directory when that variable is unset. Using the project root rather than the live `cwd` means the boundary stays stable even after Claude `cd`s into a subdirectory.
|
|
220
220
|
|
|
221
221
|
**Parameters:**
|
|
222
222
|
|
|
223
223
|
| Param | Type | Default | Description |
|
|
224
224
|
|-------|------|---------|-------------|
|
|
225
|
-
| `allowPaths` | `string[]` | `[]` | Absolute path prefixes that are permitted even if outside
|
|
225
|
+
| `allowPaths` | `string[]` | `[]` | Absolute path prefixes that are permitted even if outside the project root. |
|
|
226
226
|
|
|
227
227
|
**Example:**
|
|
228
228
|
|
|
@@ -544,7 +544,7 @@ pull requests. If `gh` is not installed or not authenticated, the policy fails o
|
|
|
544
544
|
### `require-ci-green-before-stop`
|
|
545
545
|
|
|
546
546
|
**Event:** Stop
|
|
547
|
-
**Default:** Denies stopping when CI checks are failing or still running on the current branch. Checks both GitHub Actions workflow runs and third-party bot checks (e.g. CodeRabbit, SonarCloud, Codecov). Treats `skipped` conclusions as success. Returns an informational message when all checks pass.
|
|
547
|
+
**Default:** Denies stopping when CI checks are failing or still running on the current branch. Checks both GitHub Actions workflow runs and third-party bot checks (e.g. CodeRabbit, SonarCloud, Codecov). Treats `skipped` and `cancelled` conclusions as success. Returns an informational message when all checks pass.
|
|
548
548
|
|
|
549
549
|
No parameters.
|
|
550
550
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description: "Alle 30
|
|
2
|
+
title: Integrierte Policies
|
|
3
|
+
description: "Alle 30 integrierten Policies, die häufige Fehlerszenarien von Agenten abfangen"
|
|
4
4
|
icon: shield
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
failproofai wird mit 30
|
|
7
|
+
failproofai wird mit 30 integrierten Policies ausgeliefert, die häufige Fehlerszenarien von Agenten abfangen. Jede Policy wird bei einem bestimmten Hook-Ereignistyp und Toolnamen ausgelöst. Neun Policies akzeptieren Parameter, mit denen Sie ihr Verhalten anpassen können, ohne Code zu schreiben. Vier Workflow-Policies erzwingen eine commit → push → PR → CI-Pipeline, bevor Claude stoppt.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
## Übersicht
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Policies sind in Kategorien gruppiert:
|
|
14
14
|
|
|
15
|
-
| Kategorie |
|
|
16
|
-
|
|
15
|
+
| Kategorie | Policies | Hook-Typ |
|
|
16
|
+
|-----------|----------|----------|
|
|
17
17
|
| [Gefährliche Befehle](#dangerous-commands) | block-sudo, block-rm-rf, block-curl-pipe-sh, block-failproofai-commands | PreToolUse |
|
|
18
18
|
| [Secrets (Sanitizer)](#secrets-sanitizers) | sanitize-jwt, sanitize-api-keys, sanitize-connection-strings, sanitize-private-key-content, sanitize-bearer-tokens | PostToolUse |
|
|
19
19
|
| [Umgebung](#environment) | block-env-files, protect-env-vars | PreToolUse |
|
|
@@ -21,17 +21,18 @@ Richtlinien sind in Kategorien gruppiert:
|
|
|
21
21
|
| [Git](#git) | block-push-master, block-work-on-main, block-force-push, warn-git-amend, warn-git-stash-drop, warn-all-files-staged | PreToolUse |
|
|
22
22
|
| [Datenbank](#database) | warn-destructive-sql, warn-schema-alteration | PreToolUse |
|
|
23
23
|
| [Warnungen](#warnings) | warn-large-file-write, warn-package-publish, warn-background-process, warn-global-package-install | PreToolUse |
|
|
24
|
+
| [Paketmanager](#package-managers) | prefer-package-manager | PreToolUse |
|
|
24
25
|
| [Workflow](#workflow) | require-commit-before-stop, require-push-before-stop, require-pr-before-stop, require-ci-green-before-stop | Stop |
|
|
25
26
|
|
|
26
27
|
- **`block-`** — verhindert, dass der Agent fortfährt.
|
|
27
28
|
- **`warn-`** — gibt dem Agenten zusätzlichen Kontext, damit er sich selbst korrigieren kann.
|
|
28
29
|
- **`sanitize-`** — bereinigt sensible Daten aus der Tool-Ausgabe, bevor der Agent sie sieht.
|
|
29
|
-
- **`require-`** — blockiert das Stop-Ereignis, bis Bedingungen erfüllt sind.
|
|
30
|
+
- **`require-`** — blockiert das Stop-Ereignis, bis die Bedingungen erfüllt sind.
|
|
30
31
|
|
|
31
32
|
---
|
|
32
33
|
|
|
33
34
|
<Tip>
|
|
34
|
-
Jede
|
|
35
|
+
Jede Policy unterstützt ein optionales `hint`-Feld in `policyParams`. Der Hinweis wird an die deny- oder instruct-Nachricht angehängt, die Claude sieht, und bietet umsetzbare Hilfestellung, ohne den Policy-Code zu ändern. Funktioniert mit integrierten, benutzerdefinierten und konventionsbasierten Policies. Siehe [Konfiguration → hint](/de/configuration#hint-cross-cutting) für Details.
|
|
35
36
|
</Tip>
|
|
36
37
|
|
|
37
38
|
---
|
|
@@ -45,13 +46,13 @@ Verhindert, dass Agenten Operationen ausführen, die schwer rückgängig zu mach
|
|
|
45
46
|
**Ereignis:** PreToolUse (Bash)
|
|
46
47
|
**Standard:** Verweigert jeden `sudo`-Befehl.
|
|
47
48
|
|
|
48
|
-
Blockiert Aufrufe, die das Schlüsselwort `sudo` enthalten. Der Musterabgleich erfolgt
|
|
49
|
+
Blockiert Aufrufe, die das Schlüsselwort `sudo` enthalten. Der Musterabgleich erfolgt anhand geparster Befehlstoken, nicht anhand des Rohstrings, um Umgehungsversuche über Shell-Operatoren zu verhindern.
|
|
49
50
|
|
|
50
51
|
**Parameter:**
|
|
51
52
|
|
|
52
|
-
|
|
|
53
|
-
|
|
54
|
-
| `allowPatterns` | `string[]` | `[]` | Exakte Befehlspräfixe, die erlaubt sind. Jeder Eintrag wird
|
|
53
|
+
| Parameter | Typ | Standard | Beschreibung |
|
|
54
|
+
|-----------|-----|----------|--------------|
|
|
55
|
+
| `allowPatterns` | `string[]` | `[]` | Exakte Befehlspräfixe, die erlaubt sind. Jeder Eintrag wird mit den geparsten argv-Token abgeglichen. |
|
|
55
56
|
|
|
56
57
|
**Beispiel:**
|
|
57
58
|
|
|
@@ -68,7 +69,7 @@ Blockiert Aufrufe, die das Schlüsselwort `sudo` enthalten. Der Musterabgleich e
|
|
|
68
69
|
Mit dieser Konfiguration ist `sudo systemctl status nginx` erlaubt, aber `sudo rm /etc/hosts` wird verweigert.
|
|
69
70
|
|
|
70
71
|
<Note>
|
|
71
|
-
Muster werden gegen geparste
|
|
72
|
+
Muster werden gegen geparste Token abgeglichen, nicht gegen den Rohbefehlsstring. Dies verhindert Umgehungsversuche über angehängte Shell-Operatoren (z. B. entspricht `sudo systemctl status x; rm -rf /` nicht `sudo systemctl status *`).
|
|
72
73
|
</Note>
|
|
73
74
|
|
|
74
75
|
---
|
|
@@ -80,8 +81,8 @@ Muster werden gegen geparste Tokens abgeglichen, nicht gegen den rohen Befehlsst
|
|
|
80
81
|
|
|
81
82
|
**Parameter:**
|
|
82
83
|
|
|
83
|
-
|
|
|
84
|
-
|
|
84
|
+
| Parameter | Typ | Standard | Beschreibung |
|
|
85
|
+
|-----------|-----|----------|--------------|
|
|
85
86
|
| `allowPaths` | `string[]` | `[]` | Pfade, die sicher rekursiv gelöscht werden dürfen (z. B. `/tmp`). |
|
|
86
87
|
|
|
87
88
|
**Beispiel:**
|
|
@@ -118,12 +119,12 @@ Keine Parameter.
|
|
|
118
119
|
|
|
119
120
|
## Secrets (Sanitizer)
|
|
120
121
|
|
|
121
|
-
Verhindert, dass Agenten
|
|
122
|
+
Verhindert, dass Agenten Zugangsdaten in ihren Kontext oder ihre Ausgabe einschleusen. Sanitizer-Policies werden bei **PostToolUse**-Ereignissen ausgelöst. Wenn Claude einen Bash-Befehl ausführt, eine Datei liest oder ein beliebiges Tool aufruft, prüfen diese Policies die Ausgabe, bevor sie an Claude zurückgegeben wird. Wird ein Secret-Muster erkannt, gibt die Policy eine deny-Entscheidung zurück, die verhindert, dass die Ausgabe weitergeleitet wird.
|
|
122
123
|
|
|
123
124
|
### `sanitize-jwt`
|
|
124
125
|
|
|
125
126
|
**Ereignis:** PostToolUse (alle Tools)
|
|
126
|
-
**Standard:** Schwärzt JWT-
|
|
127
|
+
**Standard:** Schwärzt JWT-Token (drei base64url-Segmente, getrennt durch `.`).
|
|
127
128
|
|
|
128
129
|
Keine Parameter.
|
|
129
130
|
|
|
@@ -132,12 +133,12 @@ Keine Parameter.
|
|
|
132
133
|
### `sanitize-api-keys`
|
|
133
134
|
|
|
134
135
|
**Ereignis:** PostToolUse (alle Tools)
|
|
135
|
-
**Standard:** Schwärzt gängige API-Key-Formate: Anthropic (`sk-ant-`), OpenAI (`sk-`), GitHub PATs (`ghp_`), AWS-Zugriffsschlüssel (`AKIA`), Stripe-Schlüssel (`sk_live_`, `sk_test_`) und Google
|
|
136
|
+
**Standard:** Schwärzt gängige API-Key-Formate: Anthropic (`sk-ant-`), OpenAI (`sk-`), GitHub PATs (`ghp_`), AWS-Zugriffsschlüssel (`AKIA`), Stripe-Schlüssel (`sk_live_`, `sk_test_`) und Google-API-Schlüssel (`AIza`).
|
|
136
137
|
|
|
137
138
|
**Parameter:**
|
|
138
139
|
|
|
139
|
-
|
|
|
140
|
-
|
|
140
|
+
| Parameter | Typ | Standard | Beschreibung |
|
|
141
|
+
|-----------|-----|----------|--------------|
|
|
141
142
|
| `additionalPatterns` | `{ regex: string; label: string }[]` | `[]` | Zusätzliche Regex-Muster, die als Secrets behandelt werden sollen. |
|
|
142
143
|
|
|
143
144
|
**Beispiel:**
|
|
@@ -160,7 +161,7 @@ Keine Parameter.
|
|
|
160
161
|
### `sanitize-connection-strings`
|
|
161
162
|
|
|
162
163
|
**Ereignis:** PostToolUse (alle Tools)
|
|
163
|
-
**Standard:** Schwärzt Datenbankverbindungsstrings, die eingebettete
|
|
164
|
+
**Standard:** Schwärzt Datenbankverbindungsstrings, die eingebettete Zugangsdaten enthalten (z. B. `postgresql://user:password@host/db`).
|
|
164
165
|
|
|
165
166
|
Keine Parameter.
|
|
166
167
|
|
|
@@ -193,7 +194,7 @@ Schützt sensible Umgebungskonfigurationen davor, von Agenten gelesen oder offen
|
|
|
193
194
|
**Ereignis:** PreToolUse (Bash, Read)
|
|
194
195
|
**Standard:** Verweigert das Lesen von `.env`-Dateien über `cat .env`, `Read`-Tool-Aufrufe mit `.env` als Dateipfad usw.
|
|
195
196
|
|
|
196
|
-
Blockiert
|
|
197
|
+
Blockiert keine `.envrc`- oder anderen umgebungsähnlichen Dateien – nur Dateien, die exakt `.env` heißen.
|
|
197
198
|
|
|
198
199
|
Keine Parameter.
|
|
199
200
|
|
|
@@ -210,18 +211,18 @@ Keine Parameter.
|
|
|
210
211
|
|
|
211
212
|
## Dateizugriff
|
|
212
213
|
|
|
213
|
-
Hält Agenten innerhalb der Projektgrenzen und
|
|
214
|
+
Hält Agenten innerhalb der Projektgrenzen und von sensiblen Dateien fern.
|
|
214
215
|
|
|
215
216
|
### `block-read-outside-cwd`
|
|
216
217
|
|
|
217
218
|
**Ereignis:** PreToolUse (Read, Bash)
|
|
218
|
-
**Standard:** Verweigert das Lesen von Dateien außerhalb des aktuellen Arbeitsverzeichnisses (
|
|
219
|
+
**Standard:** Verweigert das Lesen von Dateien außerhalb des aktuellen Arbeitsverzeichnisses (des Projektstamms).
|
|
219
220
|
|
|
220
221
|
**Parameter:**
|
|
221
222
|
|
|
222
|
-
|
|
|
223
|
-
|
|
224
|
-
| `allowPaths` | `string[]` | `[]` | Absolute Pfadpräfixe, die
|
|
223
|
+
| Parameter | Typ | Standard | Beschreibung |
|
|
224
|
+
|-----------|-----|----------|--------------|
|
|
225
|
+
| `allowPaths` | `string[]` | `[]` | Absolute Pfadpräfixe, die auch außerhalb des cwd erlaubt sind. |
|
|
225
226
|
|
|
226
227
|
**Beispiel:**
|
|
227
228
|
|
|
@@ -244,9 +245,9 @@ Hält Agenten innerhalb der Projektgrenzen und fern von sensiblen Dateien.
|
|
|
244
245
|
|
|
245
246
|
**Parameter:**
|
|
246
247
|
|
|
247
|
-
|
|
|
248
|
-
|
|
249
|
-
| `additionalPatterns` | `string[]` | `[]` | Zusätzliche
|
|
248
|
+
| Parameter | Typ | Standard | Beschreibung |
|
|
249
|
+
|-----------|-----|----------|--------------|
|
|
250
|
+
| `additionalPatterns` | `string[]` | `[]` | Zusätzliche Dateinamenmuster (Glob-Stil), die blockiert werden sollen. |
|
|
250
251
|
|
|
251
252
|
**Beispiel:**
|
|
252
253
|
|
|
@@ -273,9 +274,9 @@ Verhindert versehentliche Pushes, Force-Pushes und Branch-Fehler, die schwer rü
|
|
|
273
274
|
|
|
274
275
|
**Parameter:**
|
|
275
276
|
|
|
276
|
-
|
|
|
277
|
-
|
|
278
|
-
| `protectedBranches` | `string[]` | `["main", "master"]` | Branch-Namen,
|
|
277
|
+
| Parameter | Typ | Standard | Beschreibung |
|
|
278
|
+
|-----------|-----|----------|--------------|
|
|
279
|
+
| `protectedBranches` | `string[]` | `["main", "master"]` | Branch-Namen, zu denen nicht direkt gepusht werden darf. |
|
|
279
280
|
|
|
280
281
|
**Beispiel:**
|
|
281
282
|
|
|
@@ -290,7 +291,7 @@ Verhindert versehentliche Pushes, Force-Pushes und Branch-Fehler, die schwer rü
|
|
|
290
291
|
```
|
|
291
292
|
|
|
292
293
|
<Tip>
|
|
293
|
-
Um
|
|
294
|
+
Um das Pushen zu allen Branches zu erlauben (und diese Policy damit effektiv zu deaktivieren, ohne sie aus `enabledPolicies` zu entfernen), setzen Sie `protectedBranches: []`.
|
|
294
295
|
</Tip>
|
|
295
296
|
|
|
296
297
|
---
|
|
@@ -302,8 +303,8 @@ Um Pushes in alle Branches zu erlauben (und diese Richtlinie effektiv zu deaktiv
|
|
|
302
303
|
|
|
303
304
|
**Parameter:**
|
|
304
305
|
|
|
305
|
-
|
|
|
306
|
-
|
|
306
|
+
| Parameter | Typ | Standard | Beschreibung |
|
|
307
|
+
|-----------|-----|----------|--------------|
|
|
307
308
|
| `protectedBranches` | `string[]` | `["main", "master"]` | Branch-Namen, die nicht direkt ausgecheckt werden dürfen. |
|
|
308
309
|
|
|
309
310
|
---
|
|
@@ -313,7 +314,7 @@ Um Pushes in alle Branches zu erlauben (und diese Richtlinie effektiv zu deaktiv
|
|
|
313
314
|
**Ereignis:** PreToolUse (Bash)
|
|
314
315
|
**Standard:** Verweigert `git push --force` und `git push -f`.
|
|
315
316
|
|
|
316
|
-
Keine
|
|
317
|
+
Keine policy-spezifischen Parameter. Verwenden Sie das übergreifende [`hint`](/de/configuration#hint-cross-cutting), um Alternativen vorzuschlagen:
|
|
317
318
|
|
|
318
319
|
```json
|
|
319
320
|
{
|
|
@@ -348,7 +349,7 @@ Keine Parameter.
|
|
|
348
349
|
### `warn-all-files-staged`
|
|
349
350
|
|
|
350
351
|
**Ereignis:** PreToolUse (Bash)
|
|
351
|
-
**Standard:** Weist Claude an, zu
|
|
352
|
+
**Standard:** Weist Claude an, zu prüfen, was es stagt, wenn es `git add -A` oder `git add .` ausführt. Blockiert den Befehl nicht.
|
|
352
353
|
|
|
353
354
|
Keine Parameter.
|
|
354
355
|
|
|
@@ -361,7 +362,7 @@ Fängt destruktive SQL-Operationen ab, bevor sie gegen Ihre Datenbank ausgeführ
|
|
|
361
362
|
### `warn-destructive-sql`
|
|
362
363
|
|
|
363
364
|
**Ereignis:** PreToolUse (Bash)
|
|
364
|
-
**Standard:** Weist Claude an, zu bestätigen, bevor SQL
|
|
365
|
+
**Standard:** Weist Claude an, zu bestätigen, bevor SQL mit `DROP TABLE`, `DROP DATABASE` oder `DELETE` ohne `WHERE`-Klausel ausgeführt wird.
|
|
365
366
|
|
|
366
367
|
Keine Parameter.
|
|
367
368
|
|
|
@@ -383,12 +384,12 @@ Gibt Agenten zusätzlichen Kontext vor potenziell riskanten, aber nicht destrukt
|
|
|
383
384
|
### `warn-large-file-write`
|
|
384
385
|
|
|
385
386
|
**Ereignis:** PreToolUse (Write)
|
|
386
|
-
**Standard:** Weist Claude an, zu bestätigen, bevor Dateien
|
|
387
|
+
**Standard:** Weist Claude an, zu bestätigen, bevor Dateien mit mehr als 1024 KB geschrieben werden.
|
|
387
388
|
|
|
388
389
|
**Parameter:**
|
|
389
390
|
|
|
390
|
-
|
|
|
391
|
-
|
|
391
|
+
| Parameter | Typ | Standard | Beschreibung |
|
|
392
|
+
|-----------|-----|----------|--------------|
|
|
392
393
|
| `thresholdKb` | `number` | `1024` | Dateigrößenschwellenwert in Kilobyte, ab dem eine Warnung ausgegeben wird. |
|
|
393
394
|
|
|
394
395
|
**Beispiel:**
|
|
@@ -404,7 +405,7 @@ Gibt Agenten zusätzlichen Kontext vor potenziell riskanten, aber nicht destrukt
|
|
|
404
405
|
```
|
|
405
406
|
|
|
406
407
|
<Note>
|
|
407
|
-
Der Hook-Handler erzwingt ein stdin-Limit
|
|
408
|
+
Der Hook-Handler erzwingt ein 1-MB-stdin-Limit für Payloads. Um diese Policy mit kleinen Inhalten zu testen, setzen Sie `thresholdKb` auf einen Wert deutlich unter 1024.
|
|
408
409
|
</Note>
|
|
409
410
|
|
|
410
411
|
---
|
|
@@ -436,6 +437,42 @@ Keine Parameter.
|
|
|
436
437
|
|
|
437
438
|
---
|
|
438
439
|
|
|
440
|
+
## Paketmanager
|
|
441
|
+
|
|
442
|
+
Legt fest, welche Paketmanager der Agent verwenden darf.
|
|
443
|
+
|
|
444
|
+
### `prefer-package-manager`
|
|
445
|
+
|
|
446
|
+
**Ereignis:** PreToolUse (Bash)
|
|
447
|
+
**Standard:** Deaktiviert. Wenn aktiviert, blockiert jeden Paketmanager-Befehl, der nicht in der `allowed`-Liste enthalten ist, und weist Claude an, den Befehl mit einem erlaubten Manager umzuschreiben.
|
|
448
|
+
|
|
449
|
+
Erkennt: pip, pip3, python -m pip, npm, npx, yarn, pnpm, pnpx, bun, bunx, uv, poetry, pipenv, conda, cargo.
|
|
450
|
+
|
|
451
|
+
| Parameter | Typ | Standard | Beschreibung |
|
|
452
|
+
|-----------|-----|----------|--------------|
|
|
453
|
+
| `allowed` | string[] | `[]` | Erlaubte Paketmanager-Namen. Jeder erkannte Manager, der nicht in dieser Liste steht, wird blockiert. Wenn leer, ist die Policy wirkungslos. |
|
|
454
|
+
| `blocked` | string[] | `[]` | Zusätzliche Manager-Namen, die über die integrierte Liste hinaus blockiert werden sollen (z. B. `['pdm', 'pipx']`). |
|
|
455
|
+
|
|
456
|
+
Die integrierte Blockliste umfasst: pip, pip3, npm, npx, yarn, pnpm, pnpx, bun, bunx, uv, poetry, pipenv, conda, cargo. Verwenden Sie `blocked`, um Manager hinzuzufügen, die nicht in dieser Liste enthalten sind.
|
|
457
|
+
|
|
458
|
+
**Beispielkonfiguration:**
|
|
459
|
+
|
|
460
|
+
```json
|
|
461
|
+
{
|
|
462
|
+
"enabledPolicies": ["prefer-package-manager"],
|
|
463
|
+
"policyParams": {
|
|
464
|
+
"prefer-package-manager": {
|
|
465
|
+
"allowed": ["uv", "bun"],
|
|
466
|
+
"blocked": ["pdm", "pipx"]
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
Mit dieser Konfiguration werden `pip install flask` und `pdm install flask` beide mit einer Meldung verweigert, die Claude auffordert, stattdessen `uv` oder `bun` zu verwenden. Befehle wie `uv pip install flask` sind erlaubt, da `uv` in der Allowlist steht und zuerst geprüft wird.
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
439
476
|
## KI-Verhalten
|
|
440
477
|
|
|
441
478
|
Erkennt, wenn Agenten feststecken oder sich unerwartet verhalten.
|
|
@@ -443,7 +480,7 @@ Erkennt, wenn Agenten feststecken oder sich unerwartet verhalten.
|
|
|
443
480
|
### `warn-repeated-tool-calls`
|
|
444
481
|
|
|
445
482
|
**Ereignis:** PreToolUse (alle Tools)
|
|
446
|
-
**Standard:** Weist Claude an, zu überdenken, wenn dasselbe Tool 3
|
|
483
|
+
**Standard:** Weist Claude an, zu überdenken, wenn dasselbe Tool 3-mal oder öfter mit identischen Parametern aufgerufen wird – ein häufiges Zeichen dafür, dass der Agent in einer Schleife feststeckt.
|
|
447
484
|
|
|
448
485
|
Keine Parameter.
|
|
449
486
|
|
|
@@ -451,14 +488,14 @@ Keine Parameter.
|
|
|
451
488
|
|
|
452
489
|
## Workflow
|
|
453
490
|
|
|
454
|
-
Erzwingt einen disziplinierten Workflow
|
|
491
|
+
Erzwingt einen disziplinierten Sitzungsabschluss-Workflow. Diese Policies werden beim **Stop**-Ereignis ausgelöst und verhindern, dass Claude stoppt, bis jede Bedingung erfüllt ist. Sie folgen einer natürlichen Abhängigkeitskette: commit → push → PR → CI. Wenn eine Policy verweigert, werden spätere Policies in der Kette übersprungen (deny schließt kurz).
|
|
455
492
|
|
|
456
|
-
Alle Workflow-
|
|
493
|
+
Alle Workflow-Policies sind **fail-open**: Wenn das benötigte Tool nicht verfügbar ist (z. B. `gh` nicht installiert, kein Git-Remote), erlaubt die Policy den Vorgang mit einer informativen Meldung, die erklärt, warum die Prüfung übersprungen wurde.
|
|
457
494
|
|
|
458
495
|
### `require-commit-before-stop`
|
|
459
496
|
|
|
460
497
|
**Ereignis:** Stop
|
|
461
|
-
**Standard:** Verweigert das Stoppen, wenn
|
|
498
|
+
**Standard:** Verweigert das Stoppen, wenn uncommittete Änderungen vorliegen (geänderte, gestagte oder nicht verfolgte Dateien). Gibt eine informative Meldung zurück, wenn das Arbeitsverzeichnis sauber ist.
|
|
462
499
|
|
|
463
500
|
Keine Parameter.
|
|
464
501
|
|
|
@@ -467,13 +504,13 @@ Keine Parameter.
|
|
|
467
504
|
### `require-push-before-stop`
|
|
468
505
|
|
|
469
506
|
**Ereignis:** Stop
|
|
470
|
-
**Standard:** Verweigert das Stoppen, wenn
|
|
507
|
+
**Standard:** Verweigert das Stoppen, wenn nicht gepushte Commits vorhanden sind oder wenn der aktuelle Branch keinen Remote-Tracking-Branch hat. Schlägt `git push -u` vor, um bei Bedarf einen Tracking-Branch zu erstellen. Fail-open, wenn kein Remote konfiguriert ist.
|
|
471
508
|
|
|
472
509
|
**Parameter:**
|
|
473
510
|
|
|
474
|
-
|
|
|
475
|
-
|
|
476
|
-
| `remote` | `string` | `"origin"` | Remote-Name,
|
|
511
|
+
| Parameter | Typ | Standard | Beschreibung |
|
|
512
|
+
|-----------|-----|----------|--------------|
|
|
513
|
+
| `remote` | `string` | `"origin"` | Remote-Name, zu dem gepusht werden soll. |
|
|
477
514
|
|
|
478
515
|
**Beispiel:**
|
|
479
516
|
|
|
@@ -492,14 +529,14 @@ Keine Parameter.
|
|
|
492
529
|
### `require-pr-before-stop`
|
|
493
530
|
|
|
494
531
|
**Ereignis:** Stop
|
|
495
|
-
**Standard:** Verweigert das Stoppen, wenn für den aktuellen Branch
|
|
532
|
+
**Standard:** Verweigert das Stoppen, wenn kein Pull Request für den aktuellen Branch existiert oder wenn der vorhandene PR geschlossen/gemergt ist. Weist Claude an, einen PR mit `gh pr create` zu erstellen.
|
|
496
533
|
|
|
497
534
|
Keine Parameter.
|
|
498
535
|
|
|
499
536
|
<Note>
|
|
500
|
-
Diese
|
|
537
|
+
Diese Policy erfordert, dass [GitHub CLI](https://cli.github.com/) (`gh`) installiert und authentifiziert ist.
|
|
501
538
|
Führen Sie `gh auth login` mit einem Personal Access Token aus, das den `repo`-Scope für Lesezugriff auf
|
|
502
|
-
Pull Requests
|
|
539
|
+
Pull Requests besitzt. Wenn `gh` nicht installiert oder nicht authentifiziert ist, ist die Policy fail-open und meldet den Grund an Claude.
|
|
503
540
|
</Note>
|
|
504
541
|
|
|
505
542
|
---
|
|
@@ -507,23 +544,23 @@ Pull Requests hat. Wenn `gh` nicht installiert oder nicht authentifiziert ist, s
|
|
|
507
544
|
### `require-ci-green-before-stop`
|
|
508
545
|
|
|
509
546
|
**Ereignis:** Stop
|
|
510
|
-
**Standard:** Verweigert das Stoppen, wenn CI-Prüfungen fehlschlagen oder auf dem aktuellen Branch
|
|
547
|
+
**Standard:** Verweigert das Stoppen, wenn CI-Prüfungen fehlschlagen oder noch auf dem aktuellen Branch laufen. Prüft sowohl GitHub Actions-Workflow-Runs als auch Drittanbieter-Bot-Prüfungen (z. B. CodeRabbit, SonarCloud, Codecov). Behandelt `skipped`- und `cancelled`-Abschlüsse als Erfolg. Gibt eine informative Meldung zurück, wenn alle Prüfungen bestanden sind.
|
|
511
548
|
|
|
512
549
|
Keine Parameter.
|
|
513
550
|
|
|
514
551
|
<Note>
|
|
515
|
-
Diese
|
|
552
|
+
Diese Policy erfordert, dass [GitHub CLI](https://cli.github.com/) (`gh`) installiert und authentifiziert ist.
|
|
516
553
|
Führen Sie `gh auth login` mit einem Personal Access Token aus, das den `repo`-Scope für Lesezugriff auf
|
|
517
|
-
Actions
|
|
554
|
+
Actions-Workflow-Runs und die Checks API besitzt. Wenn `gh` nicht installiert oder nicht authentifiziert ist, ist die Policy fail-open und meldet den Grund an Claude.
|
|
518
555
|
</Note>
|
|
519
556
|
|
|
520
557
|
---
|
|
521
558
|
|
|
522
559
|
---
|
|
523
560
|
|
|
524
|
-
## Einzelne
|
|
561
|
+
## Einzelne Policies deaktivieren
|
|
525
562
|
|
|
526
|
-
Entfernen Sie eine bestimmte
|
|
563
|
+
Entfernen Sie eine bestimmte Policy aus `enabledPolicies` in Ihrer Konfiguration, oder deaktivieren Sie sie im Policies-Tab des Dashboards.
|
|
527
564
|
|
|
528
565
|
```json
|
|
529
566
|
{
|
|
@@ -534,4 +571,4 @@ Entfernen Sie eine bestimmte Richtlinie aus `enabledPolicies` in Ihrer Konfigura
|
|
|
534
571
|
}
|
|
535
572
|
```
|
|
536
573
|
|
|
537
|
-
|
|
574
|
+
Policies, die nicht in `enabledPolicies` aufgeführt sind, werden nicht ausgeführt, auch wenn `policyParams`-Einträge für sie vorhanden sind.
|