-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy path.pai-protected.json
More file actions
462 lines (462 loc) · 17 KB
/
.pai-protected.json
File metadata and controls
462 lines (462 loc) · 17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
{
"$schema": "https://json-schema.org/draft-07/schema#",
"description": "PAI Protected Files - Files that must NOT be overwritten with Kai content",
"version": "2.0",
"protected": {
"core_documents": {
"description": "Core PAI documentation that differs from Kai",
"files": [
"README.md",
"INSTALL.md",
"SECURITY.md"
],
"validation": "Must contain 'PAI' or 'Personal AI Infrastructure' in content"
},
"pai_infrastructure": {
"description": "PAI-specific infrastructure code",
"files": [
"Tools/validate-protected.ts",
".pai-protected.json"
],
"validation": "Must not contain references to private Kai data"
},
"sanitized_config": {
"description": "Configuration files that must remain sanitized",
"files": [
".env.example"
],
"validation": "Must not contain API keys, personal emails, or secrets"
},
"forbidden_directories": {
"description": "Directories that should NEVER exist in public PAI",
"patterns": [
"^skills/",
"^Deprecated/",
"^.deprecated/",
"^MEMORY/",
"^History/",
"^context/",
"^progress/"
],
"validation": "These directories contain private Kai data and must not be committed"
},
"protected_patterns": {
"description": "Comprehensive patterns to catch sensitive data from production agent systems",
"categories": {
"api_keys": {
"description": "API keys and tokens from various services",
"patterns": [
"sk-ant-api[a-zA-Z0-9-]{20,}",
"sk-[a-zA-Z0-9]{20,}",
"ANTHROPIC_API_KEY=[^$\\s]{10,}",
"OPENAI_API_KEY=[^$\\s]{10,}",
"PERPLEXITY_API_KEY=pplx-[a-zA-Z0-9]+",
"ELEVENLABS_API_KEY=[a-f0-9]{32}",
"GOOGLE_API_KEY=AIza[a-zA-Z0-9_-]{35}",
"AKIA[0-9A-Z]{16}",
"ABIA[0-9A-Z]{16}",
"ACCA[0-9A-Z]{16}",
"ASIA[0-9A-Z]{16}",
"aws_access_key_id[\"'\\s:=]+[A-Z0-9]{20}",
"aws_secret_access_key[\"'\\s:=]+[A-Za-z0-9/+=]{40}",
"sk_live_[a-zA-Z0-9]{24,}",
"pk_live_[a-zA-Z0-9]{24,}",
"rk_live_[a-zA-Z0-9]{24,}",
"AC[a-f0-9]{32}",
"SK[a-f0-9]{32}",
"SG\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9_-]{43}",
"dd[a-z]_[a-zA-Z0-9]{40}",
"NRAK-[A-Z0-9]{27}",
"sntrys_[a-zA-Z0-9]{64}",
"AAAA[A-Za-z0-9_-]{7}:[A-Za-z0-9_-]{140}",
"sbp_[a-f0-9]{40}",
"eyJ[a-zA-Z0-9_-]*\\.[a-zA-Z0-9_-]*\\.[a-zA-Z0-9_-]*",
"dop_v1_[a-f0-9]{64}",
"do_[a-zA-Z0-9_]{40,}",
"npm_[a-zA-Z0-9]{36}",
"pypi-[a-zA-Z0-9_-]{64,}",
"glpat-[a-zA-Z0-9_-]{20,}",
"glsa_[a-zA-Z0-9_-]{32,}"
]
},
"github_tokens": {
"description": "GitHub authentication tokens",
"patterns": [
"ghp_[a-zA-Z0-9]{36}",
"gho_[a-zA-Z0-9]{36}",
"ghu_[a-zA-Z0-9]{36}",
"ghs_[a-zA-Z0-9]{36}",
"ghr_[a-zA-Z0-9]{36}",
"github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}",
"GITHUB_TOKEN=[^$\\s]{10,}"
]
},
"slack_tokens": {
"description": "Slack API tokens",
"patterns": [
"xoxb-[0-9]+-[0-9]+-[a-zA-Z0-9]+",
"xoxp-[0-9]+-[0-9]+-[a-zA-Z0-9]+",
"xoxa-[0-9]+-[a-zA-Z0-9]+",
"xoxr-[0-9]+-[a-zA-Z0-9]+"
]
},
"webhooks": {
"description": "Webhook URLs that could expose private channels",
"patterns": [
"https://discord\\.com/api/webhooks/[0-9]+/[a-zA-Z0-9_-]+",
"https://discordapp\\.com/api/webhooks/[0-9]+/[a-zA-Z0-9_-]+",
"https://hooks\\.slack\\.com/services/T[A-Z0-9]+/B[A-Z0-9]+/[a-zA-Z0-9]+",
"https://ntfy\\.sh/[a-zA-Z0-9_-]{10,}",
"ntfy\\.sh/kai-[a-zA-Z0-9]+",
"https://hooks\\.zapier\\.com/hooks/catch/[0-9]+/[a-zA-Z0-9]+",
"https://maker\\.ifttt\\.com/trigger/[^/]+/with/key/[a-zA-Z0-9_-]+"
]
},
"database_credentials": {
"description": "Database connection strings and credentials",
"patterns": [
"mongodb(\\+srv)?://[^:]+:[^@]+@[^/]+",
"postgres(ql)?://[^:]+:[^@]+@[^/]+",
"mysql://[^:]+:[^@]+@[^/]+",
"redis://[^:]+:[^@]+@[^/]+",
"DATABASE_URL=[^\\s]+:[^\\s]+@",
"REDIS_URL=[^\\s]+:[^\\s]+@",
"MONGO_URI=[^\\s]+:[^\\s]+@"
]
},
"private_keys": {
"description": "Private keys and certificates",
"patterns": [
"-----BEGIN RSA PRIVATE KEY-----",
"-----BEGIN OPENSSH PRIVATE KEY-----",
"-----BEGIN PGP PRIVATE KEY-----",
"-----BEGIN EC PRIVATE KEY-----",
"-----BEGIN PRIVATE KEY-----",
"-----BEGIN DSA PRIVATE KEY-----",
"-----BEGIN ENCRYPTED PRIVATE KEY-----"
]
},
"pii_ssn_financial": {
"description": "SSN, EIN, and financial identifiers",
"patterns": [
"SSN[:\\s]+[0-9]{3}-[0-9]{2}-[0-9]{4}",
"\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b",
"EIN[:\\s]+[0-9]{2}-[0-9]{7}",
"\\b[0-9]{2}-[0-9]{7}\\b",
"\\b[45][0-9]{3}[- ]?[0-9]{4}[- ]?[0-9]{4}[- ]?[0-9]{4}\\b",
"\\b3[47][0-9]{2}[- ]?[0-9]{6}[- ]?[0-9]{5}\\b",
"routing[_\\s]?number[:\\s]+[0-9]{9}",
"account[_\\s]?number[:\\s]+[0-9]{8,17}"
]
},
"pii_phone": {
"description": "Phone numbers in various formats",
"patterns": [
"\\+1[- ]?\\(?[0-9]{3}\\)?[- ]?[0-9]{3}[- ]?[0-9]{4}",
"\\b\\(?[0-9]{3}\\)?[- ]?[0-9]{3}[- ]?[0-9]{4}\\b",
"phone[:\\s]+[0-9]{3}[-.\\s]?[0-9]{3}[-.\\s]?[0-9]{4}",
"cell[:\\s]+[0-9]{3}[-.\\s]?[0-9]{3}[-.\\s]?[0-9]{4}",
"mobile[:\\s]+[0-9]{3}[-.\\s]?[0-9]{3}[-.\\s]?[0-9]{4}"
]
},
"personal_emails": {
"description": "Personal and business email addresses",
"patterns": [
"[a-z]+@danielmiessler\\.com",
"[a-z]+@unsupervised-learning\\.com",
"daniel@[a-z]+\\.[a-z]+",
"susan@[a-z]+\\.[a-z]+",
"@gmail\\.com(?!.*example)",
"@yahoo\\.com(?!.*example)",
"@hotmail\\.com(?!.*example)",
"@outlook\\.com(?!.*example)",
"@icloud\\.com(?!.*example)"
]
},
"private_paths": {
"description": "Private file system paths",
"patterns": [
"/Users/daniel/(?!Projects/PAI)",
"/Users/[a-z]+/\\.claude/",
"/home/[a-z]+/\\.claude/",
"~/.claude/skills/CORE/USER/",
"~/.claude/MEMORY/",
"~/.claude/History/",
"/Users/daniel/.claude/skills/personal"
]
},
"internal_infrastructure": {
"description": "Internal hostnames, IPs, and URLs",
"patterns": [
"\\b10\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\b",
"\\b172\\.(1[6-9]|2[0-9]|3[0-1])\\.[0-9]{1,3}\\.[0-9]{1,3}\\b",
"\\b192\\.168\\.[0-9]{1,3}\\.[0-9]{1,3}\\b",
"\\.internal\\.",
"\\.local\\.",
"\\.corp\\.",
"\\.private\\.",
"localhost:[0-9]{4,5}(?!/)"
]
},
"customer_data": {
"description": "Customer names and identifiable information",
"patterns": [
"customer[_\\s]?id[:\\s]+[A-Z0-9]{8,}",
"client[_\\s]?name[:\\s]+[A-Z][a-z]+",
"account[_\\s]?name[:\\s]+[A-Z][a-z]+",
"company[_\\s]?name[:\\s]+[A-Z][a-z]+"
]
},
"team_members": {
"description": "Team member and contact names that shouldn't be public",
"patterns": [
"Kaleigh Feher",
"Bryan Brake",
"Angela Gunn",
"Susan Miessler",
"Matt Johansen",
"Dave Kennedy"
]
},
"credentials_inline": {
"description": "Inline credentials and secrets",
"patterns": [
"password[\"'\\s:=]+[^$\\s\"']{8,}(?!.*placeholder|.*example|.*YOUR_)",
"secret[\"'\\s:=]+[^$\\s\"']{8,}(?!.*placeholder|.*example|.*YOUR_)",
"API_KEY=['\"][a-zA-Z0-9_-]{16,}['\"]",
"SECRET_KEY=['\"][a-zA-Z0-9_-]{16,}['\"]",
"Bearer [a-zA-Z0-9_-]{20,}",
"Authorization:[\\s]+Bearer [a-zA-Z0-9_-]+"
]
},
"cloudflare": {
"description": "Cloudflare credentials and identifiers",
"patterns": [
"CLOUDFLARE_API_TOKEN=[a-zA-Z0-9_-]{40}",
"CLOUDFLARE_API_KEY=[a-f0-9]{37}",
"CF_API_TOKEN=[a-zA-Z0-9_-]{40}",
"CLOUDFLARE_ZONE_ID=[a-f0-9]{32}",
"CLOUDFLARE_ACCOUNT_ID=[a-f0-9]{32}"
]
},
"private_repos": {
"description": "Private GitHub repository references that shouldn't be public",
"patterns": [
"danielmiessler/arbol",
"danielmiessler/feed",
"danielmiessler/substrate",
"danielmiessler/telos",
"danielmiessler/ladder"
]
},
"personal_project_urls": {
"description": "Personal project URLs that reveal private infrastructure",
"patterns": [
"thesurface\\.ai"
],
"severity": "high"
},
"da_names": {
"description": "DA (Digital Assistant) name patterns",
"patterns": [
"\\bDevi\\b"
]
},
"imessage_bot": {
"description": "iMessage bot infrastructure references",
"patterns": [
"iMessageBot",
"iMessage[_\\s]?[Bb]ot",
"imessage[_-]bot"
]
},
"misc_sensitive": {
"description": "Miscellaneous sensitive patterns",
"patterns": [
"daemon\\.plist",
"id_rsa",
"id_ed25519",
"id_ecdsa",
"\\.pem$",
"\\.key$",
"\\.p12$",
"\\.pfx$",
"service[_-]account.*\\.json"
]
}
},
"exception_files": [
"SECURITY.md",
".pai-protected.json",
".env.example",
"Tools/validate-protected.ts",
"Tools/CheckPAIState.md",
"README.md",
"INSTALL.md",
"Releases/*/README.md",
"Releases/*/.claude/INSTALL.md",
"Releases/*/.claude/skills/*/SKILL.md",
"Releases/*/.claude/skills/*/SYSTEM/*.md",
"Releases/*/.claude/skills/*/Workflows/*.md",
"Releases/*/.claude/skills/*/Phases/*.md",
"Releases/*/.claude/skills/*/Reference/*.md",
"Releases/*/.claude/skills/*/Tools/*.ts",
"Releases/*/.claude/skills/CORE/USER/*/README.md",
"Releases/*/.claude/skills/CORE/Tools/fabric/Patterns/*/*.md",
"Releases/*/.claude/skills/CORE/Tools/*.ts",
"Releases/*/.claude/skills/PAI/USER/*/README.md",
"Releases/*/.claude/skills/PAI/SYSTEM/PAISECURITYSYSTEM/*.yaml",
"Releases/*/.claude/skills/PAI/Tools/*.ts",
"Releases/*/.claude/MEMORY/README.md",
"Releases/*/.claude/MEMORY/*/README.md",
"Releases/*/.claude/skills/Recon/Data/*.md",
"Releases/*/.claude/skills/Recon/*.md",
"Releases/*/.claude/skills/Recon/Tools/*.ts",
"Releases/*/.claude/skills/Recon/Workflows/*.md",
"Releases/*/.claude/skills/OSINT/*.md",
"Releases/*/.claude/skills/OSINT/Workflows/*.md",
"Releases/*/.claude/skills/PrivateInvestigator/*.md",
"Releases/*/.claude/skills/PrivateInvestigator/Workflows/*.md",
"Releases/*/.claude/skills/Telos/*.md",
"Releases/*/.claude/skills/Telos/Workflows/*.md",
"Releases/*/.claude/skills/Telos/DashboardTemplate/*.md",
"Releases/*/.claude/skills/Telos/ReportTemplate/*/*.ts",
"Releases/*/.claude/skills/Telos/ReportTemplate/*/*.tsx",
"Releases/*/.claude/skills/Research/*.md",
"Releases/*/.claude/skills/Research/Workflows/*.md",
"Releases/*/.claude/skills/System/*.md",
"Releases/*/.claude/skills/System/Workflows/*.md",
"Releases/*/.claude/skills/System/Tools/*.ts",
"Releases/*/.claude/skills/Prompting/*.md",
"Releases/*/.claude/skills/Prompting/Templates/*.md",
"Releases/*/.claude/skills/CreateSkill/Workflows/*.md",
"Releases/*/.claude/skills/PAIUpgrade/*.md",
"Releases/*/.claude/skills/PAIUpgrade/Workflows/*.md",
"Releases/*/.claude/skills/Agents/*.md",
"Releases/*/.claude/PAISECURITYSYSTEM/*.md",
"Releases/*/.claude/PAISECURITYSYSTEM/*.yaml",
"Releases/*/.claude/Observability/*.sh",
"Releases/*/.claude/Observability/scripts/*.sh",
"Releases/*/.claude/Observability/apps/*/src/*/*.ts",
"Releases/*/.claude/VoiceServer/*/*.sh",
"Releases/*/.claude/VoiceServer/macos-service/*/*.sh",
"Releases/*/.claude/hooks/lib/*.ts",
"Releases/*/.claude/skills/CORE/SYSTEM/UPDATES/*.md",
"Releases/*/.claude/skills/CORE/USER/TERMINAL/*.conf",
"Releases/*/.claude/skills/CORE/SYSTEM/PAISECURITYSYSTEM/*.yaml",
"Releases/*/.claude/skills/PAI/SYSTEM/UPDATES/*.md",
"Releases/*/.claude/skills/PAI/USER/TERMINAL/*.conf",
"Releases/*/.claude/skills/Fabric/Patterns/*/*.md",
"Releases/*/.claude/skills/Fabric/Patterns/*/system.md",
"Releases/*/.claude/skills/Fabric/Patterns/*/README.md",
"Releases/*/.claude/skills/WebAssessment/**/*.md",
"Releases/*/.claude/skills/WebAssessment/**/*.py",
"Releases/*/.claude/skills/WebAssessment/Workflows/**/*.md",
"Releases/*/.claude/skills/WebAssessment/OsintTools/*.md",
"Releases/*/.claude/skills/WebAssessment/OsintTools/*.py",
"Releases/*/.claude/skills/WebAssessment/FfufResources/*.md",
"Releases/*/.claude/skills/PromptInjection/*.md",
"Releases/*/.claude/skills/Documents/Pdf/*.md",
"Releases/*/.claude/skills/WebAssessment/*.py",
"Releases/*/.claude/skills/PAI/*.md",
"Releases/*/.claude/skills/PAI/Components/Algorithm/*.md",
"Releases/*/.claude/skills/PAI/USER/PAISECURITYSYSTEM/*.md",
"Releases/*/.claude/skills/PAI/USER/PAISECURITYSYSTEM/*.yaml",
"Releases/*/.claude/skills/PAI/PAISECURITYSYSTEM/*.yaml",
"Releases/*/.claude/skills/Parser/Prompts/*.md",
"Releases/*/.claude/skills/Parser/Utils/*.ts"
],
"exception_contexts": {
"description": "Patterns that are OK when in documentation/example context",
"allowed_prefixes": [
"# Example:",
"// Example:",
"/* Example",
"e.g.,",
"for example",
"placeholder",
"YOUR_",
"EXAMPLE",
"xxx",
"<your-",
"documentation",
"`~/.claude",
"$PAI_HOME",
"$PAI_DIR",
"pattern:",
"regex:",
"matches:",
"// Pattern",
"# Pattern",
"sample",
"template",
"default:",
"fallback",
"config example",
"configuration:",
"localhost example",
"test server",
"development server",
"local dev",
"192.168.x.x",
"10.x.x.x",
"private IP",
"internal IP",
"example IP",
"example phone",
"format:",
"(xxx)",
"xxx-xxx",
"secret detection",
"detect secret",
"find secret",
"scan for",
"pattern match",
"regex match",
"localhost:",
"http://localhost",
"127.0.0.1",
"dashboard at",
"server at",
"running at",
"start server",
"dev server",
"port ",
":3000",
":8080",
":8888",
":4173",
"USER/",
"USER directory",
"USER tier",
"~/.claude/skills",
"~/.claude/hooks",
"$PAI_DIR/skills",
"$PAI_DIR/hooks",
"ANTHROPIC_API_KEY=your",
"your_api_key",
"noreply@anthropic.com",
"Co-Authored-By:",
"git@github.com",
"ssh://",
"github.com/",
"TELOS_DIR"
]
}
}
},
"kai_to_pai_workflow": {
"description": "How to safely sync Kai improvements to PAI",
"steps": [
"1. Make changes in Kai (~/.claude/)",
"2. Test thoroughly in Kai environment",
"3. Identify which changes should go to public PAI",
"4. Copy changes to PAI repo (~/Projects/PAI/)",
"5. SKIP protected files (they stay PAI-specific)",
"6. Sanitize any personal data or API keys",
"7. Run: bun ~/Projects/PAI/Tools/validate-protected.ts",
"8. If validation passes, commit to PAI",
"9. If validation fails, check which protected files changed"
]
}
}