@highflame/policy 2.2.36 → 2.2.38

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 (82) hide show
  1. package/_schemas/agent_ops/context.json +792 -0
  2. package/_schemas/agent_ops/schema.cedarschema +127 -109
  3. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_cross_origin.cedar +6 -4
  4. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_escalation.cedar +5 -4
  5. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_inter_agent_injection.cedar +9 -8
  6. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_claude_block_injection.cedar +2 -2
  7. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_defaults.cedar +3 -3
  8. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_trust.cedar +6 -6
  9. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_chat_assistant.cedar +5 -4
  10. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_defaults.cedar +18 -12
  11. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_semantic.cedar +6 -6
  12. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_toxicity.cedar +4 -4
  13. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_advanced_secrets.cedar +4 -2
  14. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_data_pipeline.cedar +2 -1
  15. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_defaults.cedar +4 -2
  16. package/_schemas/agent_ops/templates/ported/data-protection/privacy_advanced_pii.cedar +42 -21
  17. package/_schemas/agent_ops/templates/ported/data-protection/privacy_defaults.cedar +14 -7
  18. package/_schemas/agent_ops/templates/ported/data-protection/privacy_pii_model.cedar +10 -5
  19. package/_schemas/agent_ops/templates/ported/organization/organization_team_permissions.cedar +3 -2
  20. package/_schemas/agent_ops/templates/ported/threat-detection/security_advanced_block_critical_severity.cedar +3 -3
  21. package/_schemas/agent_ops/templates/ported/threat-detection/security_chat_assistant.cedar +5 -4
  22. package/_schemas/agent_ops/templates/ported/threat-detection/security_data_pipeline_block_injection.cedar +3 -2
  23. package/_schemas/agent_ops/templates/ported/threat-detection/security_injection.cedar +9 -8
  24. package/_schemas/agent_ops/templates/ported/threat-detection/security_patterns.cedar +5 -3
  25. package/_schemas/agent_ops/templates/ported/threat-detection/semantic_defaults.cedar +9 -7
  26. package/_schemas/ai_gateway/context.json +278 -0
  27. package/_schemas/ai_gateway/schema.cedarschema +37 -7
  28. package/_schemas/ai_gateway/templates/defaults/agent_security.cedar +5 -16
  29. package/_schemas/ai_gateway/templates/defaults/pii.cedar +14 -7
  30. package/_schemas/ai_gateway/templates/defaults/pii_advanced.cedar +42 -21
  31. package/_schemas/ai_gateway/templates/defaults/pii_model.cedar +10 -5
  32. package/_schemas/ai_gateway/templates/defaults/semantic.cedar +9 -74
  33. package/_schemas/ai_gateway/templates/defaults/tools.cedar +7 -38
  34. package/_schemas/ai_gateway/templates/secrets.cedar +3 -3
  35. package/_schemas/guardrails/context.json +671 -0
  36. package/_schemas/guardrails/schema.cedarschema +23 -2
  37. package/_schemas/guardrails/templates/defaults/agent_identity.cedar +3 -3
  38. package/_schemas/guardrails/templates/defaults/injection.cedar +9 -8
  39. package/_schemas/guardrails/templates/defaults/pii.cedar +14 -7
  40. package/_schemas/guardrails/templates/defaults/pii_model.cedar +10 -5
  41. package/_schemas/guardrails/templates/defaults/secrets.cedar +4 -2
  42. package/_schemas/guardrails/templates/defaults/security_patterns.cedar +5 -3
  43. package/_schemas/guardrails/templates/defaults/semantic.cedar +6 -6
  44. package/_schemas/guardrails/templates/defaults/toxicity.cedar +6 -6
  45. package/_schemas/guardrails/templates/profiles/a2a_security/cross_origin.cedar +6 -4
  46. package/_schemas/guardrails/templates/profiles/a2a_security/escalation_detection.cedar +5 -4
  47. package/_schemas/guardrails/templates/profiles/a2a_security/inter_agent_injection.cedar +9 -8
  48. package/_schemas/guardrails/templates/profiles/advanced_detection/pii.cedar +42 -21
  49. package/_schemas/guardrails/templates/profiles/advanced_detection/secrets.cedar +4 -2
  50. package/_schemas/guardrails/templates/profiles/chat_assistant/security.cedar +5 -4
  51. package/_schemas/guardrails/templates/profiles/chat_assistant/trust_safety.cedar +5 -4
  52. package/_schemas/guardrails/templates/profiles/data_pipeline/data_protection.cedar +2 -1
  53. package/_schemas/guardrails/templates/profiles/data_pipeline/security.cedar +3 -2
  54. package/_schemas/guardrails/templates/profiles/multi_agent/agent_trust.cedar +6 -6
  55. package/_schemas/guardrails/templates/templates.json +0 -9
  56. package/dist/agent_ops-defaults.gen.js +177 -120
  57. package/dist/agent_ops-entities.gen.js +5 -1
  58. package/dist/ai_gateway-defaults.gen.js +90 -164
  59. package/dist/ai_gateway-entities.gen.js +6 -2
  60. package/dist/engine.d.ts +10 -0
  61. package/dist/engine.js +25 -1
  62. package/dist/guardrails-defaults.gen.js +144 -145
  63. package/dist/guardrails-entities.gen.js +5 -1
  64. package/dist/service-schemas.gen.d.ts +3 -3
  65. package/dist/service-schemas.gen.js +480 -118
  66. package/package.json +1 -1
  67. package/_schemas/guardrails/templates/profiles/advanced_detection/threat_severity.cedar +0 -30
  68. package/_schemas/mcp_gateway/context.json +0 -655
  69. package/_schemas/mcp_gateway/schema.cedarschema +0 -342
  70. package/_schemas/mcp_gateway/templates/defaults/agent_security.cedar +0 -140
  71. package/_schemas/mcp_gateway/templates/defaults/baseline.cedar +0 -23
  72. package/_schemas/mcp_gateway/templates/defaults/semantic.cedar +0 -105
  73. package/_schemas/mcp_gateway/templates/defaults/tools.cedar +0 -92
  74. package/_schemas/mcp_gateway/templates/mcp_server_allowlist.cedar +0 -33
  75. package/_schemas/mcp_gateway/templates/mcp_tool_permissions.cedar +0 -77
  76. package/_schemas/mcp_gateway/templates/templates.json +0 -89
  77. package/dist/mcp_gateway-context.gen.d.ts +0 -51
  78. package/dist/mcp_gateway-context.gen.js +0 -52
  79. package/dist/mcp_gateway-defaults.gen.d.ts +0 -61
  80. package/dist/mcp_gateway-defaults.gen.js +0 -668
  81. package/dist/mcp_gateway-entities.gen.d.ts +0 -11
  82. package/dist/mcp_gateway-entities.gen.js +0 -37
@@ -49,7 +49,7 @@ const GUARDRAILS_DATA_PROTECTION_DEFAULTS_CEDAR = `// ==========================
49
49
 
50
50
  @id("data-protection.block-secrets")
51
51
  @name("Block secrets")
52
- @description("Blocks process_prompt, call_tool, read_file, and write_file when secrets_detected is true.")
52
+ @description("Blocks process_prompt, process_response, call_tool, read_file, and write_file when secrets_detected is true.")
53
53
  @severity("critical")
54
54
  @tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
55
55
  @reject_message("Request blocked: secrets or credentials were detected in the content.")
@@ -57,6 +57,7 @@ forbid (
57
57
  principal,
58
58
  action in [
59
59
  Guardrails::Action::"process_prompt",
60
+ Guardrails::Action::"process_response",
60
61
  Guardrails::Action::"call_tool",
61
62
  Guardrails::Action::"read_file",
62
63
  Guardrails::Action::"write_file"
@@ -69,7 +70,7 @@ when {
69
70
 
70
71
  @id("data-protection.block-secrets-bulk")
71
72
  @name("Block secrets (bulk)")
72
- @description("Blocks process_prompt, call_tool, read_file, and write_file when secret_count >= 3.")
73
+ @description("Blocks process_prompt, process_response, call_tool, read_file, and write_file when secret_count >= 3.")
73
74
  @severity("critical")
74
75
  @tags("category:data-protection,threat:secrets,threat:exfiltration,detection:aggregate,owasp:llm06")
75
76
  @reject_message("Request blocked: multiple distinct secrets were detected — possible credential dump.")
@@ -77,6 +78,7 @@ forbid (
77
78
  principal,
78
79
  action in [
79
80
  Guardrails::Action::"process_prompt",
81
+ Guardrails::Action::"process_response",
80
82
  Guardrails::Action::"call_tool",
81
83
  Guardrails::Action::"read_file",
82
84
  Guardrails::Action::"write_file"
@@ -110,13 +112,14 @@ const GUARDRAILS_SECURITY_INJECTION_CEDAR = `// ================================
110
112
 
111
113
  @id("security.block-injection-ml")
112
114
  @name("Block injection (ML)")
113
- @description("Blocks process_prompt and call_tool when injection_score >= 86.")
115
+ @description("Blocks process_prompt, process_response, and call_tool when injection_score >= 86.")
114
116
  @severity("high")
115
117
  @tags("category:security,threat:injection,detection:ml,owasp:llm01,mitre:atlas-t0051")
116
118
  @reject_message("Prompt blocked: the ML classifier detected prompt injection with high confidence.")
117
119
  forbid (
118
120
  principal,
119
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
121
+ action in [Guardrails::Action::"process_prompt",
122
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool"],
120
123
  resource
121
124
  )
122
125
  when {
@@ -125,13 +128,13 @@ when {
125
128
 
126
129
  @id("security.block-jailbreak-ml")
127
130
  @name("Block jailbreak (ML)")
128
- @description("Blocks process_prompt when jailbreak_score >= 81.")
131
+ @description("Blocks process_prompt and process_response when jailbreak_score >= 81.")
129
132
  @severity("high")
130
133
  @tags("category:security,threat:jailbreak,detection:ml,owasp:llm02,mitre:atlas-t0054")
131
134
  @reject_message("Prompt blocked: the ML classifier detected a jailbreak attempt with high confidence.")
132
135
  forbid (
133
136
  principal,
134
- action == Guardrails::Action::"process_prompt",
137
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
135
138
  resource
136
139
  )
137
140
  when {
@@ -140,13 +143,13 @@ when {
140
143
 
141
144
  @id("security.block-injection-combined")
142
145
  @name("Block injection + jailbreak (combined)")
143
- @description("Blocks process_prompt when injection_score >= 61 and jailbreak_score >= 61.")
146
+ @description("Blocks process_prompt and process_response when injection_score >= 61 and jailbreak_score >= 61.")
144
147
  @severity("high")
145
148
  @tags("category:security,threat:injection,threat:jailbreak,detection:ml")
146
149
  @reject_message("Prompt blocked: moderate injection and jailbreak signals were detected together.")
147
150
  forbid (
148
151
  principal,
149
- action == Guardrails::Action::"process_prompt",
152
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
150
153
  resource
151
154
  )
152
155
  when {
@@ -156,13 +159,13 @@ when {
156
159
 
157
160
  @id("security.block-invisible-chars")
158
161
  @name("Block invisible-character injection")
159
- @description("Blocks process_prompt when invisible_chars_detected is true and invisible_chars_score >= 51.")
162
+ @description("Blocks process_prompt and process_response when invisible_chars_detected is true and invisible_chars_score >= 51.")
160
163
  @severity("high")
161
164
  @tags("category:security,threat:invisible-chars,threat:injection,detection:pattern")
162
165
  @reject_message("Prompt blocked: invisible Unicode characters often used for injection were detected.")
163
166
  forbid (
164
167
  principal,
165
- action == Guardrails::Action::"process_prompt",
168
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
166
169
  resource
167
170
  )
168
171
  when {
@@ -194,7 +197,8 @@ const GUARDRAILS_PRIVACY_DEFAULTS_CEDAR = `// ==================================
194
197
  @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
195
198
  forbid (
196
199
  principal,
197
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
200
+ action in [Guardrails::Action::"process_prompt",
201
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
198
202
  resource
199
203
  )
200
204
  when {
@@ -215,7 +219,8 @@ when {
215
219
  @reject_message("Content blocked: credit card number patterns detected.")
216
220
  forbid (
217
221
  principal,
218
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
222
+ action in [Guardrails::Action::"process_prompt",
223
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
219
224
  resource
220
225
  )
221
226
  when {
@@ -230,7 +235,8 @@ when {
230
235
  @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
231
236
  forbid (
232
237
  principal,
233
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
238
+ action in [Guardrails::Action::"process_prompt",
239
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
234
240
  resource
235
241
  )
236
242
  when {
@@ -251,7 +257,8 @@ when {
251
257
  @reject_message("Content blocked: medical record identifier patterns detected.")
252
258
  forbid (
253
259
  principal,
254
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
260
+ action in [Guardrails::Action::"process_prompt",
261
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
255
262
  resource
256
263
  )
257
264
  when {
@@ -274,7 +281,8 @@ when {
274
281
  @reject_message("Content blocked: tax identifier (ITIN or EIN) patterns detected.")
275
282
  forbid (
276
283
  principal,
277
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
284
+ action in [Guardrails::Action::"process_prompt",
285
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
278
286
  resource
279
287
  )
280
288
  when {
@@ -294,7 +302,8 @@ when {
294
302
  @reject_message("Content blocked: credential or API key patterns detected.")
295
303
  forbid (
296
304
  principal,
297
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
305
+ action in [Guardrails::Action::"process_prompt",
306
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
298
307
  resource
299
308
  )
300
309
  when {
@@ -324,7 +333,8 @@ when {
324
333
  @reject_message("Content blocked: cryptocurrency wallet address patterns detected.")
325
334
  forbid (
326
335
  principal,
327
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
336
+ action in [Guardrails::Action::"process_prompt",
337
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
328
338
  resource
329
339
  )
330
340
  when {
@@ -359,7 +369,8 @@ const GUARDRAILS_PRIVACY_PII_MODEL_CEDAR = `// =================================
359
369
  @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
360
370
  forbid (
361
371
  principal,
362
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
372
+ action in [Guardrails::Action::"process_prompt",
373
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
363
374
  resource
364
375
  )
365
376
  when {
@@ -374,7 +385,8 @@ when {
374
385
  @reject_message("Content blocked: credit card number patterns detected.")
375
386
  forbid (
376
387
  principal,
377
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
388
+ action in [Guardrails::Action::"process_prompt",
389
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
378
390
  resource
379
391
  )
380
392
  when {
@@ -389,7 +401,8 @@ when {
389
401
  @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
390
402
  forbid (
391
403
  principal,
392
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
404
+ action in [Guardrails::Action::"process_prompt",
405
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
393
406
  resource
394
407
  )
395
408
  when {
@@ -404,7 +417,8 @@ when {
404
417
  @reject_message("Content blocked: medical record identifier patterns detected.")
405
418
  forbid (
406
419
  principal,
407
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
420
+ action in [Guardrails::Action::"process_prompt",
421
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
408
422
  resource
409
423
  )
410
424
  when {
@@ -419,7 +433,8 @@ when {
419
433
  @reject_message("Content blocked: credential or API key patterns detected.")
420
434
  forbid (
421
435
  principal,
422
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
436
+ action in [Guardrails::Action::"process_prompt",
437
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
423
438
  resource
424
439
  )
425
440
  when {
@@ -451,13 +466,13 @@ const GUARDRAILS_TRUST_SAFETY_TOXICITY_CEDAR = `// =============================
451
466
 
452
467
  @id("trust-safety.block-toxicity-critical")
453
468
  @name("Block critical toxicity")
454
- @description("Blocks process_prompt when any toxicity score is >= 91.")
469
+ @description("Blocks process_prompt and process_response when any toxicity score is >= 91.")
455
470
  @severity("critical")
456
471
  @tags("category:trust-safety,threat:harmful,detection:ml,compliance:eu-ai-act,compliance:iso-42001")
457
472
  @reject_message("Prompt blocked: critical-severity toxic content detected.")
458
473
  forbid (
459
474
  principal,
460
- action == Guardrails::Action::"process_prompt",
475
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
461
476
  resource
462
477
  )
463
478
  when {
@@ -471,13 +486,13 @@ when {
471
486
 
472
487
  @id("trust-safety.block-hate-speech")
473
488
  @name("Block hate speech")
474
- @description("Blocks process_prompt when hate_speech_score >= 76.")
489
+ @description("Blocks process_prompt and process_response when hate_speech_score >= 76.")
475
490
  @severity("high")
476
491
  @tags("category:trust-safety,threat:hate-speech,detection:ml,compliance:eu-ai-act")
477
492
  @reject_message("Prompt blocked: hate speech detected.")
478
493
  forbid (
479
494
  principal,
480
- action == Guardrails::Action::"process_prompt",
495
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
481
496
  resource
482
497
  )
483
498
  when {
@@ -486,13 +501,13 @@ when {
486
501
 
487
502
  @id("trust-safety.block-toxicity-combined")
488
503
  @name("Block combined toxicity")
489
- @description("Blocks process_prompt when any two toxicity scores are >= 61.")
504
+ @description("Blocks process_prompt and process_response when any two toxicity scores are >= 61.")
490
505
  @severity("high")
491
506
  @tags("category:trust-safety,threat:harmful,detection:aggregate")
492
507
  @reject_message("Prompt blocked: multiple moderate toxicity signals were detected together.")
493
508
  forbid (
494
509
  principal,
495
- action == Guardrails::Action::"process_prompt",
510
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
496
511
  resource
497
512
  )
498
513
  when {
@@ -830,7 +845,7 @@ const GUARDRAILS_SECURITY_PATTERNS_CEDAR = `// =================================
830
845
 
831
846
  @id("security.block-path-traversal")
832
847
  @name("Block path traversal")
833
- @description("Blocks process_prompt, call_tool, read_file, and write_file when path_traversal_detected is true and severity is high or critical.")
848
+ @description("Blocks process_prompt, process_response, call_tool, read_file, and write_file when path_traversal_detected is true and severity is high or critical.")
834
849
  @severity("high")
835
850
  @tags("category:security,threat:path-traversal,detection:pattern,mitre:t1005")
836
851
  @reject_message("Request blocked: path traversal pattern detected — sensitive system files or deep directory traversal.")
@@ -838,6 +853,7 @@ forbid (
838
853
  principal,
839
854
  action in [
840
855
  Guardrails::Action::"process_prompt",
856
+ Guardrails::Action::"process_response",
841
857
  Guardrails::Action::"call_tool",
842
858
  Guardrails::Action::"read_file",
843
859
  Guardrails::Action::"write_file"
@@ -852,13 +868,14 @@ when {
852
868
 
853
869
  @id("security.block-sql-injection")
854
870
  @name("Block SQL injection")
855
- @description("Blocks process_prompt and call_tool when sql_injection_detected is true and sql_injection_score >= 75.")
871
+ @description("Blocks process_prompt, process_response, and call_tool when sql_injection_detected is true and sql_injection_score >= 75.")
856
872
  @severity("high")
857
873
  @tags("category:security,threat:sql-injection,detection:pattern")
858
874
  @reject_message("Request blocked: SQL injection pattern detected — tautology, UNION attack, or destructive query.")
859
875
  forbid (
860
876
  principal,
861
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
877
+ action in [Guardrails::Action::"process_prompt",
878
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool"],
862
879
  resource
863
880
  )
864
881
  when {
@@ -886,13 +903,13 @@ const GUARDRAILS_TRUST_SAFETY_SEMANTIC_CEDAR = `// =============================
886
903
 
887
904
  @id("trust-safety.block-dangerous-topics")
888
905
  @name("Block dangerous topics")
889
- @description("Blocks process_prompt when content_topics contains weapons or explosives categories.")
906
+ @description("Blocks process_prompt and process_response when content_topics contains weapons or explosives categories.")
890
907
  @severity("critical")
891
908
  @tags("category:trust-safety,threat:harmful,detection:ml,compliance:eu-ai-act")
892
909
  @reject_message("Prompt blocked: content classified under a dangerous topic (weapons, explosives, illegal synthesis).")
893
910
  forbid (
894
911
  principal,
895
- action == Guardrails::Action::"process_prompt",
912
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
896
913
  resource
897
914
  )
898
915
  when {
@@ -906,13 +923,13 @@ when {
906
923
 
907
924
  @id("trust-safety.block-controlled-substances")
908
925
  @name("Block controlled substances")
909
- @description("Blocks process_prompt when content_topics contains controlled substances or precursor chemicals.")
926
+ @description("Blocks process_prompt and process_response when content_topics contains controlled substances or precursor chemicals.")
910
927
  @severity("high")
911
928
  @tags("category:trust-safety,threat:harmful,detection:ml,compliance:eu-ai-act")
912
929
  @reject_message("Prompt blocked: content discusses controlled substances or precursor chemicals.")
913
930
  forbid (
914
931
  principal,
915
- action == Guardrails::Action::"process_prompt",
932
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
916
933
  resource
917
934
  )
918
935
  when {
@@ -926,13 +943,13 @@ when {
926
943
 
927
944
  @id("trust-safety.block-restricted-topics")
928
945
  @name("Block high-confidence restricted topics")
929
- @description("Blocks process_prompt when topic_confidence >= 81 and content_topics contains a restricted category.")
946
+ @description("Blocks process_prompt and process_response when topic_confidence >= 81 and content_topics contains a restricted category.")
930
947
  @severity("high")
931
948
  @tags("category:trust-safety,threat:harmful,detection:ml")
932
949
  @reject_message("Prompt blocked: content high-confidence classified into a restricted topic (illegal activity, fraud, social engineering).")
933
950
  forbid (
934
951
  principal,
935
- action == Guardrails::Action::"process_prompt",
952
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
936
953
  resource
937
954
  )
938
955
  when {
@@ -1034,13 +1051,13 @@ when {
1034
1051
 
1035
1052
  @id("agent-identity.block-autonomous-injection")
1036
1053
  @name("Block injection on autonomous agents")
1037
- @description("Blocks process_prompt when agent_type is \\"autonomous\\" and injection_score >= 51.")
1054
+ @description("Blocks process_prompt and process_response when agent_type is \\"autonomous\\" and injection_score >= 51.")
1038
1055
  @severity("high")
1039
- @tags("category:agent-identity,threat:injection,detection:ml,surface:process-prompt,owasp:llm01")
1056
+ @tags("category:agent-identity,threat:injection,detection:ml,surface:process-prompt,surface:process-response,owasp:llm01")
1040
1057
  @reject_message("Prompt blocked: lower injection threshold applies to autonomous agents and was exceeded.")
1041
1058
  forbid (
1042
1059
  principal is Guardrails::Agent,
1043
- action == Guardrails::Action::"process_prompt",
1060
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
1044
1061
  resource
1045
1062
  )
1046
1063
  when {
@@ -1234,13 +1251,14 @@ const GUARDRAILS_SECURITY_CHAT_ASSISTANT_CEDAR = `// ===========================
1234
1251
 
1235
1252
  @id("security.chat-block-injection")
1236
1253
  @name("Block injection (chat profile)")
1237
- @description("Blocks process_prompt and call_tool when injection_score >= 71 (lower threshold for public chat).")
1254
+ @description("Blocks process_prompt, process_response, and call_tool when injection_score >= 71 (lower threshold for public chat).")
1238
1255
  @severity("high")
1239
1256
  @tags("category:security,threat:injection,detection:ml,owasp:llm01")
1240
1257
  @reject_message("Prompt blocked: prompt injection detected with high confidence (chat profile).")
1241
1258
  forbid (
1242
1259
  principal,
1243
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
1260
+ action in [Guardrails::Action::"process_prompt",
1261
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool"],
1244
1262
  resource
1245
1263
  )
1246
1264
  when {
@@ -1249,13 +1267,13 @@ when {
1249
1267
 
1250
1268
  @id("security.chat-block-jailbreak")
1251
1269
  @name("Block jailbreak (chat profile)")
1252
- @description("Blocks process_prompt when jailbreak_score >= 66 (lower threshold for public chat).")
1270
+ @description("Blocks process_prompt and process_response when jailbreak_score >= 66 (lower threshold for public chat).")
1253
1271
  @severity("high")
1254
1272
  @tags("category:security,threat:jailbreak,detection:ml,owasp:llm02")
1255
1273
  @reject_message("Prompt blocked: jailbreak attempt detected with high confidence (chat profile).")
1256
1274
  forbid (
1257
1275
  principal,
1258
- action == Guardrails::Action::"process_prompt",
1276
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
1259
1277
  resource
1260
1278
  )
1261
1279
  when {
@@ -1283,13 +1301,13 @@ const GUARDRAILS_TRUST_SAFETY_CHAT_ASSISTANT_CEDAR = `// =======================
1283
1301
 
1284
1302
  @id("trust-safety.chat-block-toxicity")
1285
1303
  @name("Block toxicity (chat profile)")
1286
- @description("Blocks process_prompt when any toxicity score is >= 71 (lower threshold for public chat).")
1304
+ @description("Blocks process_prompt and process_response when any toxicity score is >= 71 (lower threshold for public chat).")
1287
1305
  @severity("critical")
1288
1306
  @tags("category:trust-safety,threat:harmful,threat:hate-speech,detection:ml,compliance:eu-ai-act")
1289
1307
  @reject_message("Prompt blocked: toxic content detected at the chat-profile threshold.")
1290
1308
  forbid (
1291
1309
  principal,
1292
- action == Guardrails::Action::"process_prompt",
1310
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
1293
1311
  resource
1294
1312
  )
1295
1313
  when {
@@ -1301,13 +1319,14 @@ when {
1301
1319
 
1302
1320
  @id("trust-safety.chat-block-restricted-topics")
1303
1321
  @name("Block restricted topics (chat profile)")
1304
- @description("Blocks process_prompt and call_tool when topic_confidence >= 71 and content_topics contains a restricted category.")
1322
+ @description("Blocks process_prompt, process_response, and call_tool when topic_confidence >= 71 and content_topics contains a restricted category.")
1305
1323
  @severity("high")
1306
1324
  @tags("category:trust-safety,threat:harmful,detection:ml,compliance:eu-ai-act")
1307
1325
  @reject_message("Prompt blocked: content discusses a topic restricted for chat assistants.")
1308
1326
  forbid (
1309
1327
  principal,
1310
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
1328
+ action in [Guardrails::Action::"process_prompt",
1329
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool"],
1311
1330
  resource
1312
1331
  )
1313
1332
  when {
@@ -1817,7 +1836,7 @@ const GUARDRAILS_DATA_PROTECTION_DATA_PIPELINE_CEDAR = `// =====================
1817
1836
 
1818
1837
  @id("data-protection.data-pipeline-block-secrets")
1819
1838
  @name("Block secrets in data pipeline")
1820
- @description("Blocks process_prompt, call_tool, read_file, and write_file when secrets_detected is true.")
1839
+ @description("Blocks process_prompt, process_response, call_tool, read_file, and write_file when secrets_detected is true.")
1821
1840
  @severity("critical")
1822
1841
  @tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
1823
1842
  @reject_message("Request blocked: secrets detected in a data pipeline — any credential exposure is unacceptable here.")
@@ -1825,6 +1844,7 @@ forbid (
1825
1844
  principal,
1826
1845
  action in [
1827
1846
  Guardrails::Action::"process_prompt",
1847
+ Guardrails::Action::"process_response",
1828
1848
  Guardrails::Action::"call_tool",
1829
1849
  Guardrails::Action::"read_file",
1830
1850
  Guardrails::Action::"write_file"
@@ -1870,13 +1890,14 @@ const GUARDRAILS_SECURITY_DATA_PIPELINE_BLOCK_INJECTION_CEDAR = `// ============
1870
1890
 
1871
1891
  @id("security.data-pipeline-block-injection")
1872
1892
  @name("Block pipeline injection (data-pipeline profile)")
1873
- @description("Blocks process_prompt and call_tool when injection_score >= 66 (lower threshold for data pipelines).")
1893
+ @description("Blocks process_prompt, process_response, and call_tool when injection_score >= 66 (lower threshold for data pipelines).")
1874
1894
  @severity("high")
1875
1895
  @tags("category:security,threat:injection,detection:ml,owasp:llm01")
1876
1896
  @reject_message("Request blocked: prompt injection detected at the data-pipeline threshold — RAG inputs are high-risk for indirect injection.")
1877
1897
  forbid (
1878
1898
  principal,
1879
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
1899
+ action in [Guardrails::Action::"process_prompt",
1900
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool"],
1880
1901
  resource
1881
1902
  )
1882
1903
  when {
@@ -2024,13 +2045,13 @@ when {
2024
2045
 
2025
2046
  @id("agent-identity.multi-agent-autonomous-injection")
2026
2047
  @name("Block injection on autonomous agents (stricter)")
2027
- @description("Blocks process_prompt when agent_type is \\"autonomous\\" and injection_score >= 51.")
2048
+ @description("Blocks process_prompt and process_response when agent_type is \\"autonomous\\" and injection_score >= 51.")
2028
2049
  @severity("high")
2029
- @tags("category:agent-identity,threat:injection,detection:ml,surface:process-prompt,owasp:llm01")
2050
+ @tags("category:agent-identity,threat:injection,detection:ml,surface:process-prompt,surface:process-response,owasp:llm01")
2030
2051
  @reject_message("Prompt blocked: lower injection threshold applies to autonomous agents and was exceeded.")
2031
2052
  forbid (
2032
2053
  principal is Guardrails::Agent,
2033
- action == Guardrails::Action::"process_prompt",
2054
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
2034
2055
  resource
2035
2056
  )
2036
2057
  when {
@@ -2040,13 +2061,13 @@ when {
2040
2061
 
2041
2062
  @id("agent-identity.multi-agent-autonomous-jailbreak")
2042
2063
  @name("Block jailbreak on autonomous agents (stricter)")
2043
- @description("Blocks process_prompt when agent_type is \\"autonomous\\" and jailbreak_score >= 51.")
2064
+ @description("Blocks process_prompt and process_response when agent_type is \\"autonomous\\" and jailbreak_score >= 51.")
2044
2065
  @severity("high")
2045
- @tags("category:agent-identity,threat:jailbreak,detection:ml,surface:process-prompt,owasp:llm02")
2066
+ @tags("category:agent-identity,threat:jailbreak,detection:ml,surface:process-prompt,surface:process-response,owasp:llm02")
2046
2067
  @reject_message("Prompt blocked: lower jailbreak threshold applies to autonomous agents and was exceeded.")
2047
2068
  forbid (
2048
2069
  principal is Guardrails::Agent,
2049
- action == Guardrails::Action::"process_prompt",
2070
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
2050
2071
  resource
2051
2072
  )
2052
2073
  when {
@@ -2250,13 +2271,14 @@ const GUARDRAILS_AGENT_IDENTITY_A2A_CROSS_ORIGIN_CEDAR = `// ===================
2250
2271
 
2251
2272
  @id("agent-identity.a2a-block-cross-origin-critical")
2252
2273
  @name("Block critical cross-origin from any agent")
2253
- @description("Blocks process_prompt and call_tool when cross_origin_detected is true and cross_origin_score >= 80.")
2274
+ @description("Blocks process_prompt, process_response, and call_tool when cross_origin_detected is true and cross_origin_score >= 80.")
2254
2275
  @severity("critical")
2255
2276
  @tags("category:agent-identity,threat:supply-chain,detection:ml,owasp:llm08")
2256
2277
  @reject_message("Request blocked: high-confidence cross-origin trust-boundary violation detected — confused-deputy attack.")
2257
2278
  forbid (
2258
2279
  principal is Guardrails::Agent,
2259
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
2280
+ action in [Guardrails::Action::"process_prompt",
2281
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool"],
2260
2282
  resource
2261
2283
  )
2262
2284
  when {
@@ -2267,13 +2289,14 @@ when {
2267
2289
 
2268
2290
  @id("agent-identity.a2a-block-cross-origin-unverified")
2269
2291
  @name("Block cross-origin from unverified agents")
2270
- @description("Blocks process_prompt and call_tool when agent_trust_level is \\"unverified\\", cross_origin_detected is true, and cross_origin_score >= 60.")
2292
+ @description("Blocks process_prompt, process_response, and call_tool when agent_trust_level is \\"unverified\\", cross_origin_detected is true, and cross_origin_score >= 60.")
2271
2293
  @severity("high")
2272
2294
  @tags("category:agent-identity,threat:supply-chain,scope:per-agent,detection:ml,owasp:asi03")
2273
2295
  @reject_message("Request blocked: unverified agent attempted cross-origin activity — no trust attestation across trust domains.")
2274
2296
  forbid (
2275
2297
  principal is Guardrails::Agent,
2276
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
2298
+ action in [Guardrails::Action::"process_prompt",
2299
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool"],
2277
2300
  resource
2278
2301
  )
2279
2302
  when {
@@ -2385,13 +2408,13 @@ when {
2385
2408
 
2386
2409
  @id("agent-identity.a2a-block-deep-context-injection")
2387
2410
  @name("Block multi-turn progressive injection")
2388
- @description("Blocks process_prompt when agent_trust_level is not \\"first_party\\", multi_turn_detection is true, and injection_deep_context_score >= 60.")
2411
+ @description("Blocks process_prompt and process_response when agent_trust_level is not \\"first_party\\", multi_turn_detection is true, and injection_deep_context_score >= 60.")
2389
2412
  @severity("high")
2390
- @tags("category:agent-identity,threat:injection,detection:ml,surface:process-prompt,owasp:llm01")
2413
+ @tags("category:agent-identity,threat:injection,detection:ml,surface:process-prompt,surface:process-response,owasp:llm01")
2391
2414
  @reject_message("Prompt blocked: multi-turn progressive injection detected by the deep-context model across conversation history.")
2392
2415
  forbid (
2393
2416
  principal is Guardrails::Agent,
2394
- action == Guardrails::Action::"process_prompt",
2417
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
2395
2418
  resource
2396
2419
  )
2397
2420
  when {
@@ -2402,13 +2425,13 @@ when {
2402
2425
 
2403
2426
  @id("agent-identity.a2a-block-deep-context-jailbreak")
2404
2427
  @name("Block multi-turn progressive jailbreak")
2405
- @description("Blocks process_prompt when agent_trust_level is not \\"first_party\\", multi_turn_detection is true, and jailbreak_deep_context_score >= 60.")
2428
+ @description("Blocks process_prompt and process_response when agent_trust_level is not \\"first_party\\", multi_turn_detection is true, and jailbreak_deep_context_score >= 60.")
2406
2429
  @severity("high")
2407
- @tags("category:agent-identity,threat:jailbreak,detection:ml,surface:process-prompt,owasp:llm02")
2430
+ @tags("category:agent-identity,threat:jailbreak,detection:ml,surface:process-prompt,surface:process-response,owasp:llm02")
2408
2431
  @reject_message("Prompt blocked: multi-turn progressive jailbreak detected by the deep-context model across conversation history.")
2409
2432
  forbid (
2410
2433
  principal is Guardrails::Agent,
2411
- action == Guardrails::Action::"process_prompt",
2434
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
2412
2435
  resource
2413
2436
  )
2414
2437
  when {
@@ -2423,13 +2446,14 @@ when {
2423
2446
 
2424
2447
  @id("agent-identity.a2a-block-encoded-injection")
2425
2448
  @name("Block encoded payload delivery between agents")
2426
- @description("Blocks process_prompt and call_tool when agent_id is non-empty, encoded_content_detected is true, and encoded_score >= 60.")
2449
+ @description("Blocks process_prompt, process_response, and call_tool when agent_id is non-empty, encoded_content_detected is true, and encoded_score >= 60.")
2427
2450
  @severity("high")
2428
2451
  @tags("category:agent-identity,threat:encoded-payload,detection:pattern,owasp:llm01")
2429
2452
  @reject_message("Request blocked: encoded payload detected in agent communication — agents should exchange plaintext, not encoded content.")
2430
2453
  forbid (
2431
2454
  principal is Guardrails::Agent,
2432
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
2455
+ action in [Guardrails::Action::"process_prompt",
2456
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool"],
2433
2457
  resource
2434
2458
  )
2435
2459
  when {
@@ -2671,13 +2695,14 @@ const GUARDRAILS_AGENT_IDENTITY_A2A_ESCALATION_CEDAR = `// =====================
2671
2695
 
2672
2696
  @id("agent-identity.a2a-block-session-injection-peak")
2673
2697
  @name("Block agents at high session injection peak")
2674
- @description("Blocks call_tool and process_prompt when agent_trust_level is not \\"first_party\\" and session_max_injection_score >= 70.")
2698
+ @description("Blocks call_tool and process_prompt and process_response when agent_trust_level is not \\"first_party\\" and session_max_injection_score >= 70.")
2675
2699
  @severity("critical")
2676
2700
  @tags("category:agent-identity,threat:injection,scope:per-agent,detection:aggregate,owasp:llm01")
2677
2701
  @reject_message("Request blocked: this session previously crossed the injection peak threshold; non-first-party agents are restricted.")
2678
2702
  forbid (
2679
2703
  principal is Guardrails::Agent,
2680
- action in [Guardrails::Action::"call_tool", Guardrails::Action::"process_prompt"],
2704
+ action in [Guardrails::Action::"call_tool", Guardrails::Action::"process_prompt",
2705
+ Guardrails::Action::"process_response"],
2681
2706
  resource
2682
2707
  )
2683
2708
  when {
@@ -2687,13 +2712,13 @@ when {
2687
2712
 
2688
2713
  @id("agent-identity.a2a-block-session-jailbreak-peak")
2689
2714
  @name("Block agents at high session jailbreak peak")
2690
- @description("Blocks process_prompt when agent_trust_level is not \\"first_party\\" and session_max_jailbreak_score >= 70.")
2715
+ @description("Blocks process_prompt and process_response when agent_trust_level is not \\"first_party\\" and session_max_jailbreak_score >= 70.")
2691
2716
  @severity("critical")
2692
2717
  @tags("category:agent-identity,threat:jailbreak,scope:per-agent,detection:aggregate,owasp:llm02")
2693
2718
  @reject_message("Request blocked: this session previously crossed the jailbreak peak threshold; non-first-party agents are restricted.")
2694
2719
  forbid (
2695
2720
  principal is Guardrails::Agent,
2696
- action == Guardrails::Action::"process_prompt",
2721
+ action in [Guardrails::Action::"process_prompt", Guardrails::Action::"process_response"],
2697
2722
  resource
2698
2723
  )
2699
2724
  when {
@@ -2762,7 +2787,7 @@ const GUARDRAILS_DATA_PROTECTION_ADVANCED_SECRETS_CEDAR = `// ==================
2762
2787
 
2763
2788
  @id("data-protection.advanced-block-high-risk-secrets")
2764
2789
  @name("Block high-risk credential types")
2765
- @description("Blocks process_prompt, call_tool, read_file, and write_file when secret_types contains a cloud, GitHub, SSH, or database credential.")
2790
+ @description("Blocks process_prompt, process_response, call_tool, read_file, and write_file when secret_types contains a cloud, GitHub, SSH, or database credential.")
2766
2791
  @severity("critical")
2767
2792
  @tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
2768
2793
  @reject_message("Content blocked: high-risk credentials detected (cloud keys, GitHub tokens, SSH keys, or database URLs).")
@@ -2770,6 +2795,7 @@ forbid (
2770
2795
  principal,
2771
2796
  action in [
2772
2797
  Guardrails::Action::"process_prompt",
2798
+ Guardrails::Action::"process_response",
2773
2799
  Guardrails::Action::"call_tool",
2774
2800
  Guardrails::Action::"read_file",
2775
2801
  Guardrails::Action::"write_file"
@@ -2792,7 +2818,7 @@ when {
2792
2818
 
2793
2819
  @id("data-protection.advanced-block-api-tokens")
2794
2820
  @name("Block API keys and bearer tokens")
2795
- @description("Blocks process_prompt, call_tool, read_file, and write_file when secret_types contains api_key, bearer_token, jwt_token, or OAuth credentials.")
2821
+ @description("Blocks process_prompt, process_response, call_tool, read_file, and write_file when secret_types contains api_key, bearer_token, jwt_token, or OAuth credentials.")
2796
2822
  @severity("high")
2797
2823
  @tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
2798
2824
  @reject_message("Content blocked: API keys, bearer tokens, or OAuth credentials detected.")
@@ -2800,6 +2826,7 @@ forbid (
2800
2826
  principal,
2801
2827
  action in [
2802
2828
  Guardrails::Action::"process_prompt",
2829
+ Guardrails::Action::"process_response",
2803
2830
  Guardrails::Action::"call_tool",
2804
2831
  Guardrails::Action::"read_file",
2805
2832
  Guardrails::Action::"write_file"
@@ -2841,7 +2868,8 @@ const GUARDRAILS_PRIVACY_ADVANCED_PII_CEDAR = `// ==============================
2841
2868
  @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
2842
2869
  forbid (
2843
2870
  principal,
2844
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2871
+ action in [Guardrails::Action::"process_prompt",
2872
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2845
2873
  resource
2846
2874
  )
2847
2875
  when {
@@ -2863,7 +2891,8 @@ when {
2863
2891
  @reject_message("Content blocked: credit card number patterns detected.")
2864
2892
  forbid (
2865
2893
  principal,
2866
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2894
+ action in [Guardrails::Action::"process_prompt",
2895
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2867
2896
  resource
2868
2897
  )
2869
2898
  when {
@@ -2882,7 +2911,8 @@ when {
2882
2911
  @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
2883
2912
  forbid (
2884
2913
  principal,
2885
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2914
+ action in [Guardrails::Action::"process_prompt",
2915
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2886
2916
  resource
2887
2917
  )
2888
2918
  when {
@@ -2904,7 +2934,8 @@ when {
2904
2934
  @reject_message("Content blocked: medical record identifier patterns detected.")
2905
2935
  forbid (
2906
2936
  principal,
2907
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2937
+ action in [Guardrails::Action::"process_prompt",
2938
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2908
2939
  resource
2909
2940
  )
2910
2941
  when {
@@ -2928,7 +2959,8 @@ when {
2928
2959
  @reject_message("Content blocked: tax identifier (ITIN or EIN) patterns detected.")
2929
2960
  forbid (
2930
2961
  principal,
2931
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2962
+ action in [Guardrails::Action::"process_prompt",
2963
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2932
2964
  resource
2933
2965
  )
2934
2966
  when {
@@ -2948,7 +2980,8 @@ when {
2948
2980
  @reject_message("Content blocked: credential or API key patterns detected.")
2949
2981
  forbid (
2950
2982
  principal,
2951
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2983
+ action in [Guardrails::Action::"process_prompt",
2984
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2952
2985
  resource
2953
2986
  )
2954
2987
  when {
@@ -2979,7 +3012,8 @@ when {
2979
3012
  @reject_message("Content blocked: cryptocurrency wallet address patterns detected.")
2980
3013
  forbid (
2981
3014
  principal,
2982
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3015
+ action in [Guardrails::Action::"process_prompt",
3016
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
2983
3017
  resource
2984
3018
  )
2985
3019
  when {
@@ -2998,7 +3032,8 @@ when {
2998
3032
  @reject_message("Content blocked: personal name patterns detected.")
2999
3033
  forbid (
3000
3034
  principal,
3001
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3035
+ action in [Guardrails::Action::"process_prompt",
3036
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3002
3037
  resource
3003
3038
  )
3004
3039
  when {
@@ -3017,7 +3052,8 @@ when {
3017
3052
  @reject_message("Content blocked: email address patterns detected.")
3018
3053
  forbid (
3019
3054
  principal,
3020
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3055
+ action in [Guardrails::Action::"process_prompt",
3056
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3021
3057
  resource
3022
3058
  )
3023
3059
  when {
@@ -3036,7 +3072,8 @@ when {
3036
3072
  @reject_message("Content blocked: phone number patterns detected.")
3037
3073
  forbid (
3038
3074
  principal,
3039
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3075
+ action in [Guardrails::Action::"process_prompt",
3076
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3040
3077
  resource
3041
3078
  )
3042
3079
  when {
@@ -3055,7 +3092,8 @@ when {
3055
3092
  @reject_message("Content blocked: date or time patterns detected.")
3056
3093
  forbid (
3057
3094
  principal,
3058
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3095
+ action in [Guardrails::Action::"process_prompt",
3096
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3059
3097
  resource
3060
3098
  )
3061
3099
  when {
@@ -3077,7 +3115,8 @@ when {
3077
3115
  @reject_message("Content blocked: URL patterns detected.")
3078
3116
  forbid (
3079
3117
  principal,
3080
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3118
+ action in [Guardrails::Action::"process_prompt",
3119
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3081
3120
  resource
3082
3121
  )
3083
3122
  when {
@@ -3096,7 +3135,8 @@ when {
3096
3135
  @reject_message("Content blocked: street address or location patterns detected.")
3097
3136
  forbid (
3098
3137
  principal,
3099
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3138
+ action in [Guardrails::Action::"process_prompt",
3139
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3100
3140
  resource
3101
3141
  )
3102
3142
  when {
@@ -3117,7 +3157,8 @@ when {
3117
3157
  @reject_message("Content blocked: organization name patterns detected.")
3118
3158
  forbid (
3119
3159
  principal,
3120
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3160
+ action in [Guardrails::Action::"process_prompt",
3161
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3121
3162
  resource
3122
3163
  )
3123
3164
  when {
@@ -3136,7 +3177,8 @@ when {
3136
3177
  @reject_message("Content blocked: occupation patterns detected.")
3137
3178
  forbid (
3138
3179
  principal,
3139
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3180
+ action in [Guardrails::Action::"process_prompt",
3181
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3140
3182
  resource
3141
3183
  )
3142
3184
  when {
@@ -3155,7 +3197,8 @@ when {
3155
3197
  @reject_message("Content blocked: username patterns detected.")
3156
3198
  forbid (
3157
3199
  principal,
3158
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3200
+ action in [Guardrails::Action::"process_prompt",
3201
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3159
3202
  resource
3160
3203
  )
3161
3204
  when {
@@ -3174,7 +3217,8 @@ when {
3174
3217
  @reject_message("Content blocked: employee or customer identifier patterns detected.")
3175
3218
  forbid (
3176
3219
  principal,
3177
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3220
+ action in [Guardrails::Action::"process_prompt",
3221
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3178
3222
  resource
3179
3223
  )
3180
3224
  when {
@@ -3195,7 +3239,8 @@ when {
3195
3239
  @reject_message("Content blocked: device or network identifier patterns detected.")
3196
3240
  forbid (
3197
3241
  principal,
3198
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3242
+ action in [Guardrails::Action::"process_prompt",
3243
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3199
3244
  resource
3200
3245
  )
3201
3246
  when {
@@ -3222,7 +3267,8 @@ when {
3222
3267
  @reject_message("Content blocked: vehicle identifier (VIN or plate) patterns detected.")
3223
3268
  forbid (
3224
3269
  principal,
3225
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3270
+ action in [Guardrails::Action::"process_prompt",
3271
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3226
3272
  resource
3227
3273
  )
3228
3274
  when {
@@ -3242,7 +3288,8 @@ when {
3242
3288
  @reject_message("Content blocked: salary or financial amount patterns detected.")
3243
3289
  forbid (
3244
3290
  principal,
3245
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3291
+ action in [Guardrails::Action::"process_prompt",
3292
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3246
3293
  resource
3247
3294
  )
3248
3295
  when {
@@ -3263,7 +3310,8 @@ when {
3263
3310
  @reject_message("Content blocked: sensitive attribute (ethnicity, religion, etc.) patterns detected.")
3264
3311
  forbid (
3265
3312
  principal,
3266
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3313
+ action in [Guardrails::Action::"process_prompt",
3314
+ Guardrails::Action::"process_response", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
3267
3315
  resource
3268
3316
  )
3269
3317
  when {
@@ -3283,37 +3331,6 @@ when {
3283
3331
  )
3284
3332
  };
3285
3333
  `;
3286
- const GUARDRAILS_SECURITY_ADVANCED_BLOCK_CRITICAL_SEVERITY_CEDAR = `// =============================================================================
3287
- // Advanced Detection — Threat Severity
3288
- // =============================================================================
3289
- // Catch-all that blocks any content flagged as critical severity by any
3290
- // detector. Acts as a safety net behind all other policies.
3291
- //
3292
- // Context keys consumed:
3293
- // - highest_severity: String
3294
- //
3295
- // Compliance:
3296
- // - NIST 800-53 SI-3, SI-4
3297
- //
3298
- // Category: security
3299
- // Namespace: Guardrails
3300
- // =============================================================================
3301
-
3302
- @id("security.advanced-block-critical-severity")
3303
- @name("Block critical-severity threats")
3304
- @description("Blocks process_prompt when highest_severity equals \\"critical\\".")
3305
- @severity("critical")
3306
- @tags("category:security,detection:aggregate,surface:process-prompt,posture:catch-all,compliance:nist-si-3")
3307
- @reject_message("Prompt blocked: a critical-severity threat was reported by at least one detector.")
3308
- forbid (
3309
- principal,
3310
- action == Guardrails::Action::"process_prompt",
3311
- resource
3312
- )
3313
- when {
3314
- context has highest_severity && context.highest_severity == "critical"
3315
- };
3316
- `;
3317
3334
  const GUARDRAILS_AGENT_SECURITY_PARAM_VALIDATION_CEDAR = `// =============================================================================
3318
3335
  // Action Parameter Validation (AARM R3 / CAP-ENF-007)
3319
3336
  // =============================================================================
@@ -3764,15 +3781,6 @@ export const GUARDRAILS_TEMPLATES = [
3764
3781
  severity: 'critical',
3765
3782
  tags: ['category:privacy', 'threat:pii', 'detection:pattern', 'compliance:pci-dss', 'compliance:hipaa'],
3766
3783
  },
3767
- {
3768
- id: 'security.advanced-block-critical-severity',
3769
- name: 'Advanced Detection — Threat Severity',
3770
- description: 'Catch-all that blocks any content flagged as critical severity by any detector.',
3771
- category: 'security',
3772
- cedarText: GUARDRAILS_SECURITY_ADVANCED_BLOCK_CRITICAL_SEVERITY_CEDAR,
3773
- severity: 'critical',
3774
- tags: ['category:security', 'detection:aggregate', 'posture:catch-all'],
3775
- },
3776
3784
  {
3777
3785
  id: 'agent-security.param-validation',
3778
3786
  name: 'Action Parameter Validation',
@@ -4271,15 +4279,6 @@ export const GUARDRAILS_TEMPLATES_JSON = `{
4271
4279
  "compliance:hipaa"
4272
4280
  ]
4273
4281
  },
4274
- {
4275
- "id": "security.advanced-block-critical-severity",
4276
- "name": "Advanced Detection — Threat Severity",
4277
- "description": "Catch-all that blocks any content flagged as critical severity by any detector.",
4278
- "category": "security",
4279
- "file": "profiles/advanced_detection/threat_severity.cedar",
4280
- "severity": "critical",
4281
- "tags": ["category:security", "detection:aggregate", "posture:catch-all"]
4282
- },
4283
4282
  {
4284
4283
  "id": "agent-security.param-validation",
4285
4284
  "name": "Action Parameter Validation",