@highflame/policy 2.0.8 → 2.0.9

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 (126) hide show
  1. package/dist/actions.gen.d.ts +0 -1
  2. package/dist/actions.gen.js +0 -1
  3. package/dist/annotations.d.ts +0 -1
  4. package/dist/annotations.js +0 -1
  5. package/dist/builder.d.ts +0 -1
  6. package/dist/builder.js +0 -1
  7. package/dist/context.gen.d.ts +0 -1
  8. package/dist/context.gen.js +0 -1
  9. package/dist/engine.d.ts +0 -1
  10. package/dist/engine.js +0 -1
  11. package/dist/entities.gen.d.ts +0 -1
  12. package/dist/entities.gen.js +0 -1
  13. package/dist/entity-metadata-types.gen.d.ts +0 -1
  14. package/dist/entity-metadata-types.gen.js +0 -1
  15. package/dist/errors.d.ts +0 -1
  16. package/dist/errors.js +0 -1
  17. package/dist/index.d.ts +0 -1
  18. package/dist/index.js +0 -1
  19. package/dist/overwatch-context.gen.d.ts +0 -1
  20. package/dist/overwatch-context.gen.js +0 -1
  21. package/dist/overwatch-defaults.gen.d.ts +0 -1
  22. package/dist/overwatch-defaults.gen.js +0 -1
  23. package/dist/overwatch-entities.gen.d.ts +0 -1
  24. package/dist/overwatch-entities.gen.js +0 -1
  25. package/dist/palisade-context.gen.d.ts +0 -1
  26. package/dist/palisade-context.gen.js +0 -1
  27. package/dist/palisade-entities.gen.d.ts +0 -1
  28. package/dist/palisade-entities.gen.js +0 -1
  29. package/dist/parser.d.ts +0 -1
  30. package/dist/parser.js +0 -1
  31. package/dist/schema.gen.d.ts +0 -1
  32. package/dist/schema.gen.js +0 -1
  33. package/dist/schemas.d.ts +0 -1
  34. package/dist/schemas.js +0 -1
  35. package/dist/service-schemas.gen.d.ts +0 -1
  36. package/dist/service-schemas.gen.js +0 -1
  37. package/dist/types.d.ts +0 -1
  38. package/dist/types.js +0 -1
  39. package/package.json +1 -2
  40. package/dist/actions.gen.d.ts.map +0 -1
  41. package/dist/actions.gen.js.map +0 -1
  42. package/dist/annotations.d.ts.map +0 -1
  43. package/dist/annotations.js.map +0 -1
  44. package/dist/builder.d.ts.map +0 -1
  45. package/dist/builder.js.map +0 -1
  46. package/dist/context.gen.d.ts.map +0 -1
  47. package/dist/context.gen.js.map +0 -1
  48. package/dist/engine.d.ts.map +0 -1
  49. package/dist/engine.js.map +0 -1
  50. package/dist/engine.test.d.ts +0 -8
  51. package/dist/engine.test.d.ts.map +0 -1
  52. package/dist/engine.test.js +0 -190
  53. package/dist/engine.test.js.map +0 -1
  54. package/dist/entities.gen.d.ts.map +0 -1
  55. package/dist/entities.gen.js.map +0 -1
  56. package/dist/entity-metadata-types.gen.d.ts.map +0 -1
  57. package/dist/entity-metadata-types.gen.js.map +0 -1
  58. package/dist/errors.d.ts.map +0 -1
  59. package/dist/errors.js.map +0 -1
  60. package/dist/index.d.ts.map +0 -1
  61. package/dist/index.js.map +0 -1
  62. package/dist/overwatch-context.gen.d.ts.map +0 -1
  63. package/dist/overwatch-context.gen.js.map +0 -1
  64. package/dist/overwatch-defaults.gen.d.ts.map +0 -1
  65. package/dist/overwatch-defaults.gen.js.map +0 -1
  66. package/dist/overwatch-defaults.test.d.ts +0 -8
  67. package/dist/overwatch-defaults.test.d.ts.map +0 -1
  68. package/dist/overwatch-defaults.test.js +0 -145
  69. package/dist/overwatch-defaults.test.js.map +0 -1
  70. package/dist/overwatch-entities.gen.d.ts.map +0 -1
  71. package/dist/overwatch-entities.gen.js.map +0 -1
  72. package/dist/overwatch-rebac.test.d.ts +0 -25
  73. package/dist/overwatch-rebac.test.d.ts.map +0 -1
  74. package/dist/overwatch-rebac.test.js +0 -301
  75. package/dist/overwatch-rebac.test.js.map +0 -1
  76. package/dist/palisade-context.gen.d.ts.map +0 -1
  77. package/dist/palisade-context.gen.js.map +0 -1
  78. package/dist/palisade-entities.gen.d.ts.map +0 -1
  79. package/dist/palisade-entities.gen.js.map +0 -1
  80. package/dist/parser.d.ts.map +0 -1
  81. package/dist/parser.js.map +0 -1
  82. package/dist/parser.test.d.ts +0 -8
  83. package/dist/parser.test.d.ts.map +0 -1
  84. package/dist/parser.test.js +0 -212
  85. package/dist/parser.test.js.map +0 -1
  86. package/dist/schema.gen.d.ts.map +0 -1
  87. package/dist/schema.gen.js.map +0 -1
  88. package/dist/schemas.d.ts.map +0 -1
  89. package/dist/schemas.js.map +0 -1
  90. package/dist/schemas.test.d.ts +0 -8
  91. package/dist/schemas.test.d.ts.map +0 -1
  92. package/dist/schemas.test.js +0 -407
  93. package/dist/schemas.test.js.map +0 -1
  94. package/dist/service-schemas.gen.d.ts.map +0 -1
  95. package/dist/service-schemas.gen.js.map +0 -1
  96. package/dist/studio-ui.test.d.ts +0 -8
  97. package/dist/studio-ui.test.d.ts.map +0 -1
  98. package/dist/studio-ui.test.js +0 -687
  99. package/dist/studio-ui.test.js.map +0 -1
  100. package/dist/types.d.ts.map +0 -1
  101. package/dist/types.js.map +0 -1
  102. package/src/actions.gen.ts +0 -57
  103. package/src/annotations.ts +0 -243
  104. package/src/builder.ts +0 -799
  105. package/src/context.gen.ts +0 -10
  106. package/src/engine.test.ts +0 -370
  107. package/src/engine.ts +0 -497
  108. package/src/entities.gen.ts +0 -65
  109. package/src/entity-metadata-types.gen.ts +0 -19
  110. package/src/errors.ts +0 -195
  111. package/src/index.ts +0 -62
  112. package/src/overwatch-context.gen.ts +0 -45
  113. package/src/overwatch-defaults.gen.ts +0 -1255
  114. package/src/overwatch-defaults.test.ts +0 -176
  115. package/src/overwatch-entities.gen.ts +0 -41
  116. package/src/overwatch-rebac.test.ts +0 -346
  117. package/src/palisade-context.gen.ts +0 -28
  118. package/src/palisade-entities.gen.ts +0 -49
  119. package/src/parser.test.ts +0 -251
  120. package/src/parser.ts +0 -579
  121. package/src/schema.gen.ts +0 -134
  122. package/src/schemas.test.ts +0 -477
  123. package/src/schemas.ts +0 -91
  124. package/src/service-schemas.gen.ts +0 -608
  125. package/src/studio-ui.test.ts +0 -813
  126. package/src/types.ts +0 -66
@@ -1,1255 +0,0 @@
1
- // Code generated by highflame-policy-codegen. DO NOT EDIT.
2
- // Source: schemas/overwatch/templates/templates.json
3
- //
4
- // Overwatch default policies and templates.
5
- // Cedar text is embedded at build time. PolicyRule[] can be parsed at runtime
6
- // using parseCedarToRules().
7
-
8
- /**
9
- * Overwatch policy category identifiers.
10
- * Maps to UI tab names in Studio.
11
- */
12
- export type OverwatchCategory = 'secrets' | 'pii' | 'semantic' | 'tools' | 'organization' | 'trust_safety' | 'agent_security';
13
-
14
- /**
15
- * Category metadata for UI display.
16
- */
17
- export interface OverwatchCategoryInfo {
18
- id: OverwatchCategory;
19
- name: string;
20
- description: string;
21
- }
22
-
23
- /**
24
- * A default policy that is auto-created for new projects.
25
- */
26
- export interface OverwatchDefaultPolicy {
27
- /** Template identifier */
28
- id: string;
29
- /** Human-readable name */
30
- name: string;
31
- /** Description for UI display */
32
- description: string;
33
- /** Policy category */
34
- category: OverwatchCategory;
35
- /** Cedar policy text (source of truth) */
36
- cedarText: string;
37
- /** Severity level */
38
- severity: string;
39
- /** Tags for filtering */
40
- tags: string[];
41
- /** Whether this default should be activated immediately */
42
- isActive: boolean;
43
- }
44
-
45
- /**
46
- * A policy template available for users to create from.
47
- */
48
- export interface OverwatchTemplate {
49
- /** Template identifier */
50
- id: string;
51
- /** Human-readable name */
52
- name: string;
53
- /** Description for UI display */
54
- description: string;
55
- /** Policy category */
56
- category: OverwatchCategory;
57
- /** Cedar policy text */
58
- cedarText: string;
59
- /** Severity level */
60
- severity: string;
61
- /** Tags for filtering */
62
- tags: string[];
63
- }
64
-
65
- // =============================================================================
66
- // EMBEDDED CEDAR POLICY TEXT
67
- // =============================================================================
68
-
69
- const OVERWATCH_BASELINE_DEFAULT_CEDAR = `// =============================================================================
70
- // Baseline Permit Policy (Default)
71
- // =============================================================================
72
- // Permits all actions by default. Threat-specific forbid policies override
73
- // this to block when YARA, Javelin, or other scanners detect issues.
74
- //
75
- // Cedar is default-deny: without at least one permit rule, every request
76
- // is denied regardless of forbid rules. This baseline ensures the system
77
- // is "allow unless blocked" rather than "block everything".
78
- //
79
- // Category: organization
80
- // Namespace: Overwatch
81
- // =============================================================================
82
-
83
- @id("baseline-permit-all")
84
- @name("Permit all actions by default")
85
- @description("Baseline permit for all actions — threat-specific forbid policies override this when threats are detected")
86
- @severity("low")
87
- @tags("baseline,permit-default,organization")
88
- permit (
89
- principal,
90
- action,
91
- resource
92
- );
93
- `;
94
-
95
- const OVERWATCH_SECRETS_DEFAULT_CEDAR = `// =============================================================================
96
- // Secrets Detection Policy (Default)
97
- // =============================================================================
98
- // Detects and blocks credential leakage across prompts, tool calls, file
99
- // operations, and AI response content. Combines YARA-based threat detection
100
- // with pattern matching for known credential formats.
101
- //
102
- // Defense layers:
103
- // 1. YARA scanner detection (contains_secrets, yara_threats)
104
- // 2. Sensitive file path blocking (.env files)
105
- // 3. Response content pattern matching (AWS, GitHub, SSH keys)
106
- //
107
- // Compliance: NIST 800-53 SC-28, IA-5 | OWASP A02 | MITRE T1552, T1555
108
- // Category: secrets
109
- // Namespace: Overwatch
110
- // =============================================================================
111
-
112
- // ---------------------------------------------------------------------------
113
- // Section 1: YARA-Based Secret Detection
114
- // ---------------------------------------------------------------------------
115
-
116
- // Block prompts containing detected secrets
117
- @id("secrets-block-prompts")
118
- @name("Block prompts with secrets")
119
- @description("Block prompts when YARA scanners detect API keys, tokens, or credential patterns")
120
- @severity("critical")
121
- @tags("secrets,credentials,prompts,nist-sc-28,nist-ia-5")
122
- forbid (
123
- principal,
124
- action == Overwatch::Action::"process_prompt",
125
- resource
126
- )
127
- when {
128
- context has contains_secrets && context.contains_secrets == true
129
- };
130
-
131
- // Block file reads and tool calls when secrets are detected
132
- @id("secrets-block-reads-and-tools")
133
- @name("Block file reads and tool calls with secrets")
134
- @description("Prevent file reads and tool execution when secrets or credentials are detected in content")
135
- @severity("high")
136
- @tags("secrets,file-access,tools,credentials,nist-sc-28")
137
- forbid (
138
- principal,
139
- action in [Overwatch::Action::"read_file", Overwatch::Action::"call_tool"],
140
- resource
141
- )
142
- when {
143
- context has contains_secrets && context.contains_secrets == true
144
- };
145
-
146
- // ---------------------------------------------------------------------------
147
- // Section 2: Sensitive File Path Protection
148
- // ---------------------------------------------------------------------------
149
-
150
- // Block .env file access across all operations
151
- @id("secrets-block-env-files")
152
- @name("Block .env file access")
153
- @description("Block access to .env files that commonly contain secrets, API keys, and database credentials")
154
- @severity("high")
155
- @tags("secrets,env-files,config,nist-sc-28,mitre-t1552")
156
- forbid (
157
- principal,
158
- action in [Overwatch::Action::"read_file", Overwatch::Action::"write_file", Overwatch::Action::"call_tool"],
159
- resource
160
- )
161
- when {
162
- context has path && context.path like "*.env*"
163
- };
164
-
165
- // ---------------------------------------------------------------------------
166
- // Section 3: Response Content Pattern Matching
167
- // Scans AI responses for known credential formats as defense-in-depth.
168
- // ---------------------------------------------------------------------------
169
-
170
- // Block responses containing AWS access keys (AKIA prefix)
171
- @id("secrets-block-aws-keys")
172
- @name("Block AWS access keys in responses")
173
- @description("Detect and block AWS access key IDs (AKIA prefix) in AI responses to prevent credential exfiltration")
174
- @severity("critical")
175
- @tags("secrets,aws,credentials,response-scan,nist-ia-5,mitre-t1552")
176
- forbid (
177
- principal,
178
- action,
179
- resource
180
- )
181
- when {
182
- context has response_content &&
183
- context.response_content like "*AKIA*"
184
- };
185
-
186
- // Block responses containing AWS secret keys
187
- @id("secrets-block-aws-secrets")
188
- @name("Block AWS secret keys in responses")
189
- @description("Detect and block AWS secret access keys in AI responses")
190
- @severity("critical")
191
- @tags("secrets,aws,credentials,response-scan,nist-ia-5")
192
- forbid (
193
- principal,
194
- action,
195
- resource
196
- )
197
- when {
198
- context has response_content &&
199
- (context.response_content like "*AWS_SECRET_ACCESS_KEY*" ||
200
- context.response_content like "*aws_secret_access_key*")
201
- };
202
-
203
- // Block responses containing GitHub tokens
204
- @id("secrets-block-github-tokens")
205
- @name("Block GitHub tokens in responses")
206
- @description("Detect and block GitHub personal access tokens (ghp_), fine-grained tokens (github_pat_), and app tokens (ghs_)")
207
- @severity("critical")
208
- @tags("secrets,github,tokens,response-scan,mitre-t1552")
209
- forbid (
210
- principal,
211
- action,
212
- resource
213
- )
214
- when {
215
- context has response_content &&
216
- (context.response_content like "*ghp_*" ||
217
- context.response_content like "*github_pat_*" ||
218
- context.response_content like "*ghs_*")
219
- };
220
-
221
- // Block responses containing SSH/RSA private keys
222
- @id("secrets-block-private-keys")
223
- @name("Block private keys in responses")
224
- @description("Detect and block SSH, RSA, and OpenSSH private keys in AI responses")
225
- @severity("critical")
226
- @tags("secrets,ssh,private-keys,response-scan,nist-sc-28,mitre-t1552")
227
- forbid (
228
- principal,
229
- action,
230
- resource
231
- )
232
- when {
233
- context has response_content &&
234
- (context.response_content like "*-----BEGIN PRIVATE KEY-----*" ||
235
- context.response_content like "*-----BEGIN RSA PRIVATE KEY-----*" ||
236
- context.response_content like "*-----BEGIN OPENSSH PRIVATE KEY-----*")
237
- };
238
-
239
- // ---------------------------------------------------------------------------
240
- // Section 4: YARA Credential Pattern Detection
241
- // Catches credential types identified by YARA rule scanning.
242
- // ---------------------------------------------------------------------------
243
-
244
- // Block YARA-detected credential and token patterns
245
- @id("secrets-block-yara-credentials")
246
- @name("Block YARA-detected credential patterns")
247
- @description("Block content flagged by YARA rules for credential exposure, API key leaks, JWT tokens, and bearer tokens")
248
- @severity("critical")
249
- @tags("secrets,yara,credentials,jwt,bearer,nist-ia-5")
250
- forbid (
251
- principal,
252
- action,
253
- resource
254
- )
255
- when {
256
- context has yara_threats &&
257
- (context.yara_threats.contains("secret_exposure") ||
258
- context.yara_threats.contains("credential_leak") ||
259
- context.yara_threats.contains("api_key_exposure") ||
260
- context.yara_threats.contains("jwt_token_exposure") ||
261
- context.yara_threats.contains("bearer_token_leak"))
262
- };
263
- `;
264
-
265
- const OVERWATCH_PII_DEFAULT_CEDAR = `// =============================================================================
266
- // PII Detection Policy (Default)
267
- // =============================================================================
268
- // Detects and blocks personally identifiable information including credit card
269
- // numbers, Social Security Numbers, and other PII patterns across prompts
270
- // and tool calls.
271
- //
272
- // Compliance: PCI DSS 3.4, 4.1 | NIST 800-53 SI-4 | GDPR Art. 32
273
- // Category: pii
274
- // Namespace: Overwatch
275
- // =============================================================================
276
-
277
- // Block prompts containing credit card patterns
278
- @id("pii-block-credit-cards")
279
- @name("Block credit card numbers")
280
- @description("Detect and block content containing credit card number patterns (PCI DSS compliance)")
281
- @severity("critical")
282
- @tags("pci,credit-card,payment,compliance,pci-dss-3.4")
283
- forbid (
284
- principal,
285
- action == Overwatch::Action::"process_prompt",
286
- resource
287
- )
288
- when {
289
- context has yara_threats && context.yara_threats.contains("credit_card")
290
- };
291
-
292
- // Block prompts containing SSN patterns
293
- @id("pii-block-ssn")
294
- @name("Block Social Security Numbers")
295
- @description("Detect and block content containing SSN patterns (XXX-XX-XXXX format)")
296
- @severity("critical")
297
- @tags("ssn,identity,privacy,compliance")
298
- forbid (
299
- principal,
300
- action == Overwatch::Action::"process_prompt",
301
- resource
302
- )
303
- when {
304
- context has yara_threats && context.yara_threats.contains("ssn")
305
- };
306
-
307
- // Block prompts with generic PII threats detected
308
- @id("pii-block-generic")
309
- @name("Block detected PII content")
310
- @description("Block content when PII-related threat categories are detected by YARA or Javelin scanners")
311
- @severity("high")
312
- @tags("pii,privacy,data-protection,gdpr")
313
- forbid (
314
- principal,
315
- action == Overwatch::Action::"process_prompt",
316
- resource
317
- )
318
- when {
319
- context has threat_categories && context.threat_categories.contains("pii")
320
- };
321
-
322
- // Block prompts with high PII confidence score
323
- @id("pii-block-high-confidence")
324
- @name("Block high-confidence PII")
325
- @description("Block content when PII classifier confidence exceeds threshold (80/100)")
326
- @severity("critical")
327
- @tags("pii,confidence,privacy,compliance")
328
- @reject_message("Your content was blocked because personally identifiable information was detected with high confidence.")
329
- forbid (
330
- principal,
331
- action == Overwatch::Action::"process_prompt",
332
- resource
333
- )
334
- when {
335
- context has pii_confidence && context.pii_confidence >= 80
336
- };
337
-
338
- // Block PII leakage via tool calls
339
- @id("pii-block-tool-calls")
340
- @name("Block tool calls with PII")
341
- @description("Prevent tool execution when PII patterns are detected in content")
342
- @severity("high")
343
- @tags("pii,tools,data-protection")
344
- forbid (
345
- principal,
346
- action == Overwatch::Action::"call_tool",
347
- resource
348
- )
349
- when {
350
- context has threat_categories && context.threat_categories.contains("pii")
351
- };
352
- `;
353
-
354
- const OVERWATCH_SEMANTIC_DEFAULT_CEDAR = `// =============================================================================
355
- // Semantic Threat Detection Policy (Default)
356
- // =============================================================================
357
- // Detects and blocks prompt injection, jailbreak attempts, and high-severity
358
- // AI security threats using YARA and Javelin scanner results. Provides
359
- // defense-in-depth across both prompts and tool calls.
360
- //
361
- // Compliance: NIST 800-53 SI-3, SI-4 | OWASP LLM Top 10: LLM01, LLM02
362
- // MITRE ATLAS: AML.T0051 (LLM Prompt Injection)
363
- // Category: semantic
364
- // Namespace: Overwatch
365
- // =============================================================================
366
-
367
- // Block prompts with prompt injection detected by YARA
368
- @id("semantic-block-injection")
369
- @name("Block prompt injection")
370
- @description("Detect and block prompt injection patterns in user input via YARA scanning (OWASP LLM01)")
371
- @severity("critical")
372
- @tags("injection,security,llm,owasp-llm01,baseline")
373
- forbid (
374
- principal,
375
- action == Overwatch::Action::"process_prompt",
376
- resource
377
- )
378
- when {
379
- context has yara_threats && context.yara_threats.contains("prompt_injection")
380
- };
381
-
382
- // Block prompts with high injection confidence score
383
- @id("semantic-block-injection-score")
384
- @name("Block high-confidence injection")
385
- @description("Block content when injection classifier confidence exceeds threshold (75/100)")
386
- @severity("critical")
387
- @tags("injection,confidence,security,owasp-llm01")
388
- @reject_message("Your prompt was blocked because a high-confidence prompt injection pattern was detected.")
389
- forbid (
390
- principal,
391
- action in [Overwatch::Action::"process_prompt", Overwatch::Action::"call_tool"],
392
- resource
393
- )
394
- when {
395
- context has injection_confidence && context.injection_confidence >= 75
396
- };
397
-
398
- // Block prompts with jailbreak attempts
399
- @id("semantic-block-jailbreak")
400
- @name("Block jailbreak attempts")
401
- @description("Detect and block jailbreak and bypass attempts against AI agents (OWASP LLM02)")
402
- @severity("critical")
403
- @tags("jailbreak,bypass,security,owasp-llm02,baseline")
404
- forbid (
405
- principal,
406
- action == Overwatch::Action::"process_prompt",
407
- resource
408
- )
409
- when {
410
- context has yara_threats && context.yara_threats.contains("jailbreak")
411
- };
412
-
413
- // Block prompts with high jailbreak confidence score
414
- @id("semantic-block-jailbreak-score")
415
- @name("Block high-confidence jailbreak")
416
- @description("Block content when jailbreak classifier confidence exceeds threshold (75/100)")
417
- @severity("critical")
418
- @tags("jailbreak,confidence,security,owasp-llm02")
419
- @reject_message("Your prompt was blocked because a high-confidence jailbreak attempt was detected.")
420
- forbid (
421
- principal,
422
- action in [Overwatch::Action::"process_prompt", Overwatch::Action::"call_tool"],
423
- resource
424
- )
425
- when {
426
- context has jailbreak_confidence && context.jailbreak_confidence >= 75
427
- };
428
-
429
- // Block prompts with high severity semantic threats
430
- @id("semantic-block-high-severity")
431
- @name("Block high severity threats")
432
- @description("Block prompts when semantic threat scanners detect high severity issues (severity >= 3)")
433
- @severity("high")
434
- @tags("semantic,severity,security")
435
- forbid (
436
- principal,
437
- action == Overwatch::Action::"process_prompt",
438
- resource
439
- )
440
- when {
441
- context has threat_categories && context has max_threat_severity &&
442
- context.threat_categories.contains("semantic") &&
443
- context.max_threat_severity >= 3
444
- };
445
-
446
- // Block prompts with critical threat level
447
- @id("semantic-block-critical")
448
- @name("Block critical threats")
449
- @description("Block all content when any scanner detects critical severity threats")
450
- @severity("critical")
451
- @tags("critical,baseline,security")
452
- forbid (
453
- principal,
454
- action == Overwatch::Action::"process_prompt",
455
- resource
456
- )
457
- when {
458
- context has highest_severity && context.highest_severity == "critical"
459
- };
460
-
461
- // Block tool calls with prompt injection detected
462
- @id("semantic-block-tool-injection")
463
- @name("Block tool calls with injection")
464
- @description("Prevent tool execution when prompt injection patterns are detected in content")
465
- @severity("critical")
466
- @tags("injection,tools,security,owasp-llm01")
467
- forbid (
468
- principal,
469
- action == Overwatch::Action::"call_tool",
470
- resource
471
- )
472
- when {
473
- context has yara_threats && context.yara_threats.contains("prompt_injection")
474
- };
475
- `;
476
-
477
- const OVERWATCH_TOOLS_DEFAULT_CEDAR = `// =============================================================================
478
- // Tool Permissioning Policy (Default)
479
- // =============================================================================
480
- // Controls access to IDE tools, shell execution, file system paths, and MCP
481
- // operations. Blocks dangerous command execution tools and restricts access
482
- // to sensitive system directories and credential files.
483
- //
484
- // Compliance: NIST 800-53 AC-3, AC-6, CM-7 | OWASP A01, A03
485
- // MITRE ATT&CK T1059 (Command/Scripting Interpreter)
486
- // MITRE ATT&CK T1005 (Data from Local System)
487
- // Category: tools
488
- // Namespace: Overwatch
489
- // =============================================================================
490
-
491
- // ---------------------------------------------------------------------------
492
- // Section 1: Dangerous Tool Blocking
493
- // ---------------------------------------------------------------------------
494
-
495
- // Block shell and command execution tools
496
- @id("tools-block-shell-execution")
497
- @name("Block shell and command execution")
498
- @description("Block direct shell, bash, and command execution tools to prevent command injection (MITRE T1059)")
499
- @severity("critical")
500
- @tags("shell,command-injection,execution,nist-cm-7,mitre-t1059,baseline")
501
- forbid (
502
- principal,
503
- action == Overwatch::Action::"call_tool",
504
- resource
505
- )
506
- when {
507
- context has tool_name &&
508
- (context.tool_name == "shell" ||
509
- context.tool_name == "bash" ||
510
- context.tool_name == "sh" ||
511
- context.tool_name == "terminal" ||
512
- context.tool_name == "system.exec" ||
513
- context.tool_name == "process.spawn")
514
- };
515
-
516
- // Block destructive file operations
517
- @id("tools-block-destructive-ops")
518
- @name("Block destructive file operations")
519
- @description("Block file deletion and other destructive tool operations to prevent data loss")
520
- @severity("high")
521
- @tags("file,delete,destructive,nist-ac-3")
522
- forbid (
523
- principal,
524
- action == Overwatch::Action::"call_tool",
525
- resource
526
- )
527
- when {
528
- context has tool_name &&
529
- (context.tool_name == "fs.delete" ||
530
- context.tool_name == "fs.rmdir" ||
531
- context.tool_name == "fs.unlink")
532
- };
533
-
534
- // ---------------------------------------------------------------------------
535
- // Section 2: Sensitive Path Blocking
536
- // ---------------------------------------------------------------------------
537
-
538
- // Block access to sensitive system paths and credential files
539
- @id("tools-block-sensitive-paths")
540
- @name("Block access to sensitive system paths")
541
- @description("Prevent access to system directories, credential files, SSH keys, and cloud config (MITRE T1005, T1552.001)")
542
- @severity("high")
543
- @tags("file,path,system,security,nist-ac-6,mitre-t1005")
544
- forbid (
545
- principal,
546
- action in [Overwatch::Action::"read_file", Overwatch::Action::"write_file", Overwatch::Action::"call_tool"],
547
- resource
548
- )
549
- when {
550
- context has path &&
551
- (context.path like "/etc/*" ||
552
- context.path like "/var/*" ||
553
- context.path like "/proc/*" ||
554
- context.path like "/sys/*" ||
555
- context.path like "/root/*" ||
556
- context.path like "*/.ssh/*" ||
557
- context.path like "*/.aws/*" ||
558
- context.path like "*/.gnupg/*" ||
559
- context.path like "*.pem" ||
560
- context.path like "*/id_rsa*" ||
561
- context.path like "*/id_ed25519*")
562
- };
563
-
564
- // ---------------------------------------------------------------------------
565
- // Section 3: Threat-Based Tool Blocking
566
- // ---------------------------------------------------------------------------
567
-
568
- // Block tool calls with high severity threats detected
569
- @id("tools-block-high-severity-threats")
570
- @name("Block tool calls with high severity threats")
571
- @description("Prevent tool execution when high or critical severity threats are detected in content")
572
- @severity("high")
573
- @tags("tools,threats,severity,security")
574
- forbid (
575
- principal,
576
- action == Overwatch::Action::"call_tool",
577
- resource
578
- )
579
- when {
580
- context has threat_count && context has max_threat_severity &&
581
- context.threat_count > 0 && context.max_threat_severity >= 3
582
- };
583
- `;
584
-
585
- const OVERWATCH_TRUST_SAFETY_DEFAULT_CEDAR = `// =============================================================================
586
- // Content Safety Policy (Default)
587
- // =============================================================================
588
- // Detects and blocks violent, harmful, hateful, sexual, and profane content
589
- // using trust/safety classification scores from Javelin/Lakera/LlamaGuard.
590
- //
591
- // Compliance: NIST 800-53 SI-4 | EU AI Act Art. 52
592
- // Category: trust_safety
593
- // Namespace: Overwatch
594
- // =============================================================================
595
-
596
- // Block prompts with high violence score
597
- @id("ts-block-violence")
598
- @name("Block violent content")
599
- @description("Block content when violence detection score exceeds threshold (80/100)")
600
- @severity("critical")
601
- @tags("violence,content-safety,trust-safety,nist-si-4")
602
- @reject_message("Your prompt was blocked because it contains violent content. Please rephrase without violence-related language.")
603
- forbid (
604
- principal,
605
- action in [Overwatch::Action::"process_prompt", Overwatch::Action::"call_tool"],
606
- resource
607
- )
608
- when {
609
- context has violence_score && context.violence_score >= 80
610
- };
611
-
612
- // Block prompts with weapons content
613
- @id("ts-block-weapons")
614
- @name("Block weapons content")
615
- @description("Block content when weapons detection score exceeds threshold (80/100)")
616
- @severity("critical")
617
- @tags("weapons,content-safety,trust-safety,nist-si-4")
618
- @reject_message("Your prompt was blocked because it contains weapons-related content. Please rephrase without weapons references.")
619
- forbid (
620
- principal,
621
- action in [Overwatch::Action::"process_prompt", Overwatch::Action::"call_tool"],
622
- resource
623
- )
624
- when {
625
- context has weapons_score && context.weapons_score >= 80
626
- };
627
-
628
- // Block prompts with hate speech
629
- @id("ts-block-hate-speech")
630
- @name("Block hate speech")
631
- @description("Block content when hate speech detection score exceeds threshold (75/100)")
632
- @severity("critical")
633
- @tags("hate-speech,content-safety,trust-safety,nist-si-4")
634
- @reject_message("Your prompt was blocked because it contains hate speech. Please rephrase without hateful or discriminatory language.")
635
- forbid (
636
- principal,
637
- action in [Overwatch::Action::"process_prompt", Overwatch::Action::"call_tool"],
638
- resource
639
- )
640
- when {
641
- context has hate_speech_score && context.hate_speech_score >= 75
642
- };
643
-
644
- // Block prompts with criminal content
645
- @id("ts-block-crime")
646
- @name("Block criminal content")
647
- @description("Block content when criminal activity detection score exceeds threshold (80/100)")
648
- @severity("high")
649
- @tags("crime,content-safety,trust-safety,nist-si-4")
650
- @reject_message("Your prompt was blocked because it contains content related to criminal activity.")
651
- forbid (
652
- principal,
653
- action in [Overwatch::Action::"process_prompt", Overwatch::Action::"call_tool"],
654
- resource
655
- )
656
- when {
657
- context has crime_score && context.crime_score >= 80
658
- };
659
-
660
- // Block prompts with sexual content
661
- @id("ts-block-sexual")
662
- @name("Block sexual content")
663
- @description("Block content when sexual content detection score exceeds threshold (80/100)")
664
- @severity("high")
665
- @tags("sexual,content-safety,trust-safety,eu-ai-act")
666
- @reject_message("Your prompt was blocked because it contains sexual content.")
667
- forbid (
668
- principal,
669
- action in [Overwatch::Action::"process_prompt", Overwatch::Action::"call_tool"],
670
- resource
671
- )
672
- when {
673
- context has sexual_score && context.sexual_score >= 80
674
- };
675
-
676
- // Block prompts with excessive profanity
677
- @id("ts-block-profanity")
678
- @name("Block profanity")
679
- @description("Block content when profanity detection score exceeds threshold (90/100)")
680
- @severity("medium")
681
- @tags("profanity,content-safety,trust-safety")
682
- @reject_message("Your prompt was blocked due to excessive profanity. Please rephrase in a professional manner.")
683
- forbid (
684
- principal,
685
- action in [Overwatch::Action::"process_prompt", Overwatch::Action::"call_tool"],
686
- resource
687
- )
688
- when {
689
- context has profanity_score && context.profanity_score >= 90
690
- };
691
- `;
692
-
693
- const OVERWATCH_AGENT_SECURITY_DEFAULT_CEDAR = `// =============================================================================
694
- // Agent Security Policy (Default)
695
- // =============================================================================
696
- // Detects and blocks tool poisoning, rug pull attacks, and indirect prompt
697
- // injection targeting AI coding agents. These are agentic AI-specific attack
698
- // vectors where tool descriptions or server responses manipulate agent behavior.
699
- //
700
- // Compliance: OWASP LLM09 (Improper Output Handling) | MITRE ATLAS AML.T0054
701
- // Category: agent_security
702
- // Namespace: Overwatch
703
- // =============================================================================
704
-
705
- // Block tool calls with high tool poisoning risk
706
- @id("as-block-tool-poisoning")
707
- @name("Block tool poisoning")
708
- @description("Block tool execution when tool description contains manipulation patterns (score >= 70/100)")
709
- @severity("critical")
710
- @tags("tool-poisoning,agent-security,owasp-llm09")
711
- @reject_message("Tool execution was blocked because the tool description contains manipulation patterns that could compromise agent behavior.")
712
- forbid (
713
- principal,
714
- action == Overwatch::Action::"call_tool",
715
- resource
716
- )
717
- when {
718
- context has tool_poisoning_score && context.tool_poisoning_score >= 70
719
- };
720
-
721
- // Block tool calls with rug pull detection
722
- @id("as-block-rug-pull")
723
- @name("Block rug pull attacks")
724
- @description("Block tool execution when tool behavior diverges from advertised capabilities (score >= 70/100)")
725
- @severity("critical")
726
- @tags("rug-pull,agent-security,mcp-security")
727
- @reject_message("Tool execution was blocked because the tool's actual behavior diverges from its advertised capabilities.")
728
- forbid (
729
- principal,
730
- action in [Overwatch::Action::"call_tool", Overwatch::Action::"connect_server"],
731
- resource
732
- )
733
- when {
734
- context has rug_pull_score && context.rug_pull_score >= 70
735
- };
736
-
737
- // Block MCP server connections with high poisoning risk
738
- @id("as-block-server-poisoning")
739
- @name("Block poisoned MCP servers")
740
- @description("Block connections to MCP servers when tool poisoning patterns are detected (score >= 60/100)")
741
- @severity("critical")
742
- @tags("tool-poisoning,mcp-security,agent-security")
743
- @reject_message("Connection to this MCP server was blocked because tool poisoning patterns were detected in its tool descriptions.")
744
- forbid (
745
- principal,
746
- action == Overwatch::Action::"connect_server",
747
- resource
748
- )
749
- when {
750
- context has tool_poisoning_score && context.tool_poisoning_score >= 60
751
- };
752
-
753
- // Block prompts with indirect injection patterns
754
- @id("as-block-indirect-injection")
755
- @name("Block indirect prompt injection")
756
- @description("Block content when indirect prompt injection is detected in tool outputs or retrieved documents (score >= 70/100)")
757
- @severity("critical")
758
- @tags("indirect-injection,agent-security,owasp-llm01")
759
- @reject_message("This content was blocked because indirect prompt injection patterns were detected in tool outputs or retrieved documents.")
760
- forbid (
761
- principal,
762
- action in [Overwatch::Action::"process_prompt", Overwatch::Action::"call_tool", Overwatch::Action::"connect_server"],
763
- resource
764
- )
765
- when {
766
- context has indirect_injection_score && context.indirect_injection_score >= 70
767
- };
768
-
769
- // Block unverified MCP server tool calls with any detected threats
770
- @id("as-block-unverified-threats")
771
- @name("Block unverified server threats")
772
- @description("Block tool calls from unverified MCP servers when any threat is detected")
773
- @severity("high")
774
- @tags("mcp-trust,agent-security,unverified")
775
- @reject_message("Tool execution was blocked because the MCP server is unverified and threats were detected in the content.")
776
- forbid (
777
- principal,
778
- action == Overwatch::Action::"call_tool",
779
- resource
780
- )
781
- when {
782
- context has mcp_server_verified && context.mcp_server_verified == false &&
783
- context has threat_count && context.threat_count > 0
784
- };
785
- `;
786
-
787
- const OVERWATCH_TOOLS_MCP_ALLOWLIST_CEDAR = `// MCP Server Allowlist Template
788
- // Only allow specific MCP servers to be used
789
- // Category: tools
790
- //
791
- // NOTE: Users should customize the mcp_server values in the permit rule
792
- // to match their allowed servers before deploying this template.
793
-
794
- @id("mcp-allowlist-permit")
795
- @name("Allow specific MCP servers")
796
- @description("Only allow connections to pre-approved MCP servers (customize the list)")
797
- @severity("medium")
798
- @tags("mcp,allowlist,server,governance")
799
- permit (
800
- principal,
801
- action == Overwatch::Action::"connect_server",
802
- resource
803
- )
804
- when {
805
- context.mcp_server == "filesystem" ||
806
- context.mcp_server == "playwright"
807
- };
808
-
809
- @id("mcp-allowlist-deny")
810
- @name("Deny unallowed MCP servers")
811
- @description("Block all MCP server connections not in the allowlist")
812
- @severity("medium")
813
- @tags("mcp,deny-default,server")
814
- forbid (
815
- principal,
816
- action == Overwatch::Action::"connect_server",
817
- resource
818
- );
819
- `;
820
-
821
- const OVERWATCH_ORG_DEFAULT_DENY_CEDAR = `// Default Deny All Template
822
- // Organization-wide baseline: deny all unless explicitly permitted
823
- // Category: organization
824
-
825
- @id("org-deny-all")
826
- @name("Deny all actions by default")
827
- @description("Block all actions unless explicitly permitted by other policies - use as organization baseline")
828
- @severity("high")
829
- @tags("baseline,security,deny-by-default,organization")
830
- forbid (
831
- principal,
832
- action,
833
- resource
834
- );
835
- `;
836
-
837
- const OVERWATCH_ORG_AUDIT_ALL_CEDAR = `// Audit All Actions Template
838
- // Log all agent actions for compliance and monitoring
839
- // Category: organization
840
-
841
- @id("org-audit-all")
842
- @name("Audit all actions")
843
- @description("Permit and log all agent actions for compliance auditing and monitoring")
844
- @severity("low")
845
- @tags("audit,compliance,logging,organization")
846
- permit (
847
- principal,
848
- action,
849
- resource
850
- );
851
- `;
852
-
853
- const OVERWATCH_ORG_TEAM_PERMISSIONS_CEDAR = `// Team-Based Permissions (ReBAC)
854
- // Grant IDE access based on team membership using entity hierarchy
855
- // Category: organization
856
- // Namespace: Overwatch
857
- //
858
- // Entity hierarchy required:
859
- // Organization::"acme-corp"
860
- // └── Team::"dev-team" (in Organization)
861
- // │ └── Agent::"claude" (in Team)
862
- // └── Team::"support-team" (in Organization)
863
- // └── Agent::"claude-support" (in Team)
864
-
865
- // Dev Team: Full IDE access - all actions permitted
866
- @id("team-dev-full-access")
867
- @name("Dev team full IDE access")
868
- @description("Grant development team agents full IDE access including tools, prompts, file operations, and server connections")
869
- @severity("medium")
870
- @tags("rebac,team,dev,permissions,organization")
871
- permit (
872
- principal in Overwatch::Team::"dev-team",
873
- action,
874
- resource
875
- );
876
-
877
- // Support Team: Read-only access - process prompts and read files only
878
- @id("team-support-read-only")
879
- @name("Support team read-only access")
880
- @description("Grant support team agents read-only access limited to prompt processing and file reading")
881
- @severity("medium")
882
- @tags("rebac,team,support,read-only,organization")
883
- permit (
884
- principal in Overwatch::Team::"support-team",
885
- action in [Overwatch::Action::"process_prompt", Overwatch::Action::"read_file"],
886
- resource
887
- );
888
- `;
889
-
890
- const OVERWATCH_ORG_AGENT_GUARDRAILS_CEDAR = `// Agent-Specific Guardrails
891
- // Apply per-agent security policies based on agent identity
892
- // Category: organization
893
- // Namespace: Overwatch
894
- //
895
- // Different agents have different risk profiles:
896
- // Claude Code → prompt injection detection
897
- // Cursor → PII leakage detection
898
-
899
- // Claude Code: Block prompt injection attempts
900
- @id("agent-claude-block-injection")
901
- @name("Claude Code injection guardrail")
902
- @description("Block prompt injection attempts specifically for Claude Code agent")
903
- @severity("critical")
904
- @tags("rebac,agent,claude,injection,guardrail,organization")
905
- forbid (
906
- principal == Overwatch::Agent::"claude",
907
- action == Overwatch::Action::"process_prompt",
908
- resource
909
- )
910
- when {
911
- context.yara_threats.contains("prompt_injection")
912
- };
913
-
914
- // Cursor: Block PII leakage
915
- @id("agent-cursor-block-pii")
916
- @name("Cursor PII guardrail")
917
- @description("Block PII content in Cursor agent prompts to prevent data leakage")
918
- @severity("critical")
919
- @tags("rebac,agent,cursor,pii,guardrail,organization")
920
- forbid (
921
- principal == Overwatch::Agent::"cursor",
922
- action == Overwatch::Action::"process_prompt",
923
- resource
924
- )
925
- when {
926
- context.threat_categories.contains("pii")
927
- };
928
- `;
929
-
930
- // =============================================================================
931
- // CATEGORIES
932
- // =============================================================================
933
-
934
- export const OVERWATCH_CATEGORIES: OverwatchCategoryInfo[] = [
935
- { id: 'secrets', name: 'Secrets Detection', description: 'Detect and block credentials, tokens, API keys, and sensitive key patterns in prompts, tool calls, and AI responses' },
936
- { id: 'pii', name: 'PII Detection', description: 'Detect and block personally identifiable information (PII) such as credit card numbers, SSNs, and other sensitive data' },
937
- { id: 'semantic', name: 'Semantic Threat Detection', description: 'Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats' },
938
- { id: 'tools', name: 'Tool Permissioning', description: 'Control access to shell execution, file operations, MCP servers, and sensitive system paths' },
939
- { id: 'organization', name: 'Organization Rules', description: 'Apply organization-wide policy baselines, team permissions, and agent-specific guardrails' },
940
- { id: 'trust_safety', name: 'Content Safety', description: 'Detect and control violent, harmful, hateful, sexual, and profane content using trust/safety classification scores' },
941
- { id: 'agent_security', name: 'Agent Security', description: 'Detect tool poisoning, rug pull attacks, and indirect prompt injection targeting AI agents' },
942
- ];
943
-
944
- // =============================================================================
945
- // DEFAULT POLICIES
946
- // =============================================================================
947
-
948
- export const OVERWATCH_DEFAULTS: OverwatchDefaultPolicy[] = [
949
- {
950
- id: 'baseline-default',
951
- name: 'Baseline Permit',
952
- description: 'Permits all actions by default — threat-specific forbid policies override this when threats are detected',
953
- category: 'organization',
954
- cedarText: OVERWATCH_BASELINE_DEFAULT_CEDAR,
955
- severity: 'low',
956
- tags: ['baseline', 'permit-default', 'organization'],
957
- isActive: true,
958
- },
959
- {
960
- id: 'secrets-default',
961
- name: 'Secrets Detection',
962
- description: 'Detect and block credential leakage across prompts, tool calls, file operations, and AI response content',
963
- category: 'secrets',
964
- cedarText: OVERWATCH_SECRETS_DEFAULT_CEDAR,
965
- severity: 'critical',
966
- tags: ['api-keys', 'tokens', 'credentials', 'aws', 'github', 'ssh', 'baseline'],
967
- isActive: true,
968
- },
969
- {
970
- id: 'pii-default',
971
- name: 'PII Detection',
972
- description: 'Detect and block credit card numbers, SSN, and other sensitive personal information in prompts and tool calls',
973
- category: 'pii',
974
- cedarText: OVERWATCH_PII_DEFAULT_CEDAR,
975
- severity: 'critical',
976
- tags: ['pii', 'privacy', 'compliance', 'pci-dss', 'gdpr', 'baseline'],
977
- isActive: true,
978
- },
979
- {
980
- id: 'semantic-default',
981
- name: 'Semantic Threat Detection',
982
- description: 'Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats',
983
- category: 'semantic',
984
- cedarText: OVERWATCH_SEMANTIC_DEFAULT_CEDAR,
985
- severity: 'critical',
986
- tags: ['prompt-injection', 'jailbreak', 'owasp-llm01', 'security', 'baseline'],
987
- isActive: true,
988
- },
989
- {
990
- id: 'tools-default',
991
- name: 'Tool Permissioning',
992
- description: 'Block dangerous shell execution, restrict sensitive file paths, and enforce threat-based tool access controls',
993
- category: 'tools',
994
- cedarText: OVERWATCH_TOOLS_DEFAULT_CEDAR,
995
- severity: 'critical',
996
- tags: ['shell', 'command-injection', 'file-access', 'mitre-t1059', 'baseline'],
997
- isActive: false,
998
- },
999
- {
1000
- id: 'trust-safety-default',
1001
- name: 'Content Safety',
1002
- description: 'Detect and block violent, harmful, hateful, sexual, and profane content using classification scores',
1003
- category: 'trust_safety',
1004
- cedarText: OVERWATCH_TRUST_SAFETY_DEFAULT_CEDAR,
1005
- severity: 'critical',
1006
- tags: ['violence', 'weapons', 'hate-speech', 'crime', 'sexual', 'profanity', 'content-safety', 'baseline'],
1007
- isActive: true,
1008
- },
1009
- {
1010
- id: 'agent-security-default',
1011
- name: 'Agent Security',
1012
- description: 'Detect and block tool poisoning, rug pull attacks, and indirect prompt injection targeting AI agents',
1013
- category: 'agent_security',
1014
- cedarText: OVERWATCH_AGENT_SECURITY_DEFAULT_CEDAR,
1015
- severity: 'critical',
1016
- tags: ['tool-poisoning', 'rug-pull', 'indirect-injection', 'mcp-security', 'agent-security', 'baseline'],
1017
- isActive: true,
1018
- },
1019
- ];
1020
-
1021
- // =============================================================================
1022
- // ALL TEMPLATES
1023
- // =============================================================================
1024
-
1025
- export const OVERWATCH_TEMPLATES: OverwatchTemplate[] = [
1026
- {
1027
- id: 'tools-mcp-allowlist',
1028
- name: 'MCP Server Allowlist',
1029
- description: 'Only allow specific MCP servers to be used',
1030
- category: 'tools',
1031
- cedarText: OVERWATCH_TOOLS_MCP_ALLOWLIST_CEDAR,
1032
- severity: 'medium',
1033
- tags: ['mcp', 'allowlist', 'whitelist'],
1034
- },
1035
- {
1036
- id: 'org-default-deny',
1037
- name: 'Default Deny All',
1038
- description: 'Organization-wide baseline: deny all unless explicitly permitted',
1039
- category: 'organization',
1040
- cedarText: OVERWATCH_ORG_DEFAULT_DENY_CEDAR,
1041
- severity: 'high',
1042
- tags: ['baseline', 'security', 'deny-by-default'],
1043
- },
1044
- {
1045
- id: 'org-audit-all',
1046
- name: 'Audit All Actions',
1047
- description: 'Log all agent actions for compliance and monitoring',
1048
- category: 'organization',
1049
- cedarText: OVERWATCH_ORG_AUDIT_ALL_CEDAR,
1050
- severity: 'low',
1051
- tags: ['audit', 'compliance', 'logging'],
1052
- },
1053
- {
1054
- id: 'org-team-permissions',
1055
- name: 'Team-Based Permissions (ReBAC)',
1056
- description: 'Grant IDE access based on team membership using entity hierarchy - supports dev team full access and support team read-only',
1057
- category: 'organization',
1058
- cedarText: OVERWATCH_ORG_TEAM_PERMISSIONS_CEDAR,
1059
- severity: 'medium',
1060
- tags: ['rebac', 'team', 'permissions', 'hierarchy'],
1061
- },
1062
- {
1063
- id: 'org-agent-guardrails',
1064
- name: 'Agent-Specific Guardrails',
1065
- description: 'Apply per-agent security guardrails - injection blocking for Claude, PII blocking for Cursor',
1066
- category: 'organization',
1067
- cedarText: OVERWATCH_ORG_AGENT_GUARDRAILS_CEDAR,
1068
- severity: 'critical',
1069
- tags: ['rebac', 'agent', 'guardrails', 'per-agent'],
1070
- },
1071
- ];
1072
-
1073
- // =============================================================================
1074
- // TEMPLATES METADATA
1075
- // =============================================================================
1076
-
1077
- /** Raw templates.json metadata for the Overwatch service. */
1078
- export const OVERWATCH_TEMPLATES_JSON: string = `{
1079
- "service": "overwatch",
1080
- "version": "3.0.0",
1081
- "description": "Overwatch policy templates for IDE security",
1082
- "categories": [
1083
- {
1084
- "id": "secrets",
1085
- "name": "Secrets Detection",
1086
- "description": "Detect and block credentials, tokens, API keys, and sensitive key patterns in prompts, tool calls, and AI responses"
1087
- },
1088
- {
1089
- "id": "pii",
1090
- "name": "PII Detection",
1091
- "description": "Detect and block personally identifiable information (PII) such as credit card numbers, SSNs, and other sensitive data"
1092
- },
1093
- {
1094
- "id": "semantic",
1095
- "name": "Semantic Threat Detection",
1096
- "description": "Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats"
1097
- },
1098
- {
1099
- "id": "tools",
1100
- "name": "Tool Permissioning",
1101
- "description": "Control access to shell execution, file operations, MCP servers, and sensitive system paths"
1102
- },
1103
- {
1104
- "id": "organization",
1105
- "name": "Organization Rules",
1106
- "description": "Apply organization-wide policy baselines, team permissions, and agent-specific guardrails"
1107
- },
1108
- {
1109
- "id": "trust_safety",
1110
- "name": "Content Safety",
1111
- "description": "Detect and control violent, harmful, hateful, sexual, and profane content using trust/safety classification scores"
1112
- },
1113
- {
1114
- "id": "agent_security",
1115
- "name": "Agent Security",
1116
- "description": "Detect tool poisoning, rug pull attacks, and indirect prompt injection targeting AI agents"
1117
- }
1118
- ],
1119
- "defaults": [
1120
- {
1121
- "id": "baseline-default",
1122
- "name": "Baseline Permit",
1123
- "description": "Permits all actions by default — threat-specific forbid policies override this when threats are detected",
1124
- "category": "organization",
1125
- "file": "defaults/baseline.cedar",
1126
- "severity": "low",
1127
- "tags": ["baseline", "permit-default", "organization"],
1128
- "is_active": true
1129
- },
1130
- {
1131
- "id": "secrets-default",
1132
- "name": "Secrets Detection",
1133
- "description": "Detect and block credential leakage across prompts, tool calls, file operations, and AI response content",
1134
- "category": "secrets",
1135
- "file": "defaults/secrets.cedar",
1136
- "severity": "critical",
1137
- "tags": ["api-keys", "tokens", "credentials", "aws", "github", "ssh", "baseline"],
1138
- "is_active": true
1139
- },
1140
- {
1141
- "id": "pii-default",
1142
- "name": "PII Detection",
1143
- "description": "Detect and block credit card numbers, SSN, and other sensitive personal information in prompts and tool calls",
1144
- "category": "pii",
1145
- "file": "defaults/pii.cedar",
1146
- "severity": "critical",
1147
- "tags": ["pii", "privacy", "compliance", "pci-dss", "gdpr", "baseline"],
1148
- "is_active": true
1149
- },
1150
- {
1151
- "id": "semantic-default",
1152
- "name": "Semantic Threat Detection",
1153
- "description": "Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats",
1154
- "category": "semantic",
1155
- "file": "defaults/semantic.cedar",
1156
- "severity": "critical",
1157
- "tags": ["prompt-injection", "jailbreak", "owasp-llm01", "security", "baseline"],
1158
- "is_active": true
1159
- },
1160
- {
1161
- "id": "tools-default",
1162
- "name": "Tool Permissioning",
1163
- "description": "Block dangerous shell execution, restrict sensitive file paths, and enforce threat-based tool access controls",
1164
- "category": "tools",
1165
- "file": "defaults/tools.cedar",
1166
- "severity": "critical",
1167
- "tags": ["shell", "command-injection", "file-access", "mitre-t1059", "baseline"],
1168
- "is_active": false
1169
- },
1170
- {
1171
- "id": "trust-safety-default",
1172
- "name": "Content Safety",
1173
- "description": "Detect and block violent, harmful, hateful, sexual, and profane content using classification scores",
1174
- "category": "trust_safety",
1175
- "file": "defaults/trust_safety.cedar",
1176
- "severity": "critical",
1177
- "tags": ["violence", "weapons", "hate-speech", "crime", "sexual", "profanity", "content-safety", "baseline"],
1178
- "is_active": true
1179
- },
1180
- {
1181
- "id": "agent-security-default",
1182
- "name": "Agent Security",
1183
- "description": "Detect and block tool poisoning, rug pull attacks, and indirect prompt injection targeting AI agents",
1184
- "category": "agent_security",
1185
- "file": "defaults/agent_security.cedar",
1186
- "severity": "critical",
1187
- "tags": ["tool-poisoning", "rug-pull", "indirect-injection", "mcp-security", "agent-security", "baseline"],
1188
- "is_active": true
1189
- }
1190
- ],
1191
- "templates": [
1192
- {
1193
- "id": "tools-mcp-allowlist",
1194
- "name": "MCP Server Allowlist",
1195
- "description": "Only allow specific MCP servers to be used",
1196
- "category": "tools",
1197
- "file": "mcp_server_allowlist.cedar",
1198
- "severity": "medium",
1199
- "tags": ["mcp", "allowlist", "whitelist"]
1200
- },
1201
- {
1202
- "id": "org-default-deny",
1203
- "name": "Default Deny All",
1204
- "description": "Organization-wide baseline: deny all unless explicitly permitted",
1205
- "category": "organization",
1206
- "file": "default_deny_all.cedar",
1207
- "severity": "high",
1208
- "tags": ["baseline", "security", "deny-by-default"]
1209
- },
1210
- {
1211
- "id": "org-audit-all",
1212
- "name": "Audit All Actions",
1213
- "description": "Log all agent actions for compliance and monitoring",
1214
- "category": "organization",
1215
- "file": "audit_all_actions.cedar",
1216
- "severity": "low",
1217
- "tags": ["audit", "compliance", "logging"]
1218
- },
1219
- {
1220
- "id": "org-team-permissions",
1221
- "name": "Team-Based Permissions (ReBAC)",
1222
- "description": "Grant IDE access based on team membership using entity hierarchy - supports dev team full access and support team read-only",
1223
- "category": "organization",
1224
- "file": "team_permissions.cedar",
1225
- "severity": "medium",
1226
- "tags": ["rebac", "team", "permissions", "hierarchy"]
1227
- },
1228
- {
1229
- "id": "org-agent-guardrails",
1230
- "name": "Agent-Specific Guardrails",
1231
- "description": "Apply per-agent security guardrails - injection blocking for Claude, PII blocking for Cursor",
1232
- "category": "organization",
1233
- "file": "agent_guardrails.cedar",
1234
- "severity": "critical",
1235
- "tags": ["rebac", "agent", "guardrails", "per-agent"]
1236
- }
1237
- ]
1238
- }
1239
- `;
1240
-
1241
- // =============================================================================
1242
- // HELPER FUNCTIONS
1243
- // =============================================================================
1244
-
1245
- export function getOverwatchDefaultsByCategory(category: OverwatchCategory): OverwatchDefaultPolicy[] {
1246
- return OVERWATCH_DEFAULTS.filter(d => d.category === category);
1247
- }
1248
-
1249
- export function getOverwatchTemplatesByCategory(category: OverwatchCategory): OverwatchTemplate[] {
1250
- return OVERWATCH_TEMPLATES.filter(t => t.category === category);
1251
- }
1252
-
1253
- export function getOverwatchTemplateById(id: string): OverwatchTemplate | undefined {
1254
- return OVERWATCH_TEMPLATES.find(t => t.id === id);
1255
- }