@highflame/policy 2.2.36 → 2.2.37

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 (65) 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/guardrails-defaults.gen.js +144 -145
  61. package/dist/guardrails-entities.gen.js +5 -1
  62. package/dist/service-schemas.gen.d.ts +3 -3
  63. package/dist/service-schemas.gen.js +480 -118
  64. package/package.json +1 -1
  65. package/_schemas/guardrails/templates/profiles/advanced_detection/threat_severity.cedar +0 -30
@@ -7,7 +7,7 @@
7
7
  export const AGENT_OPS_ENTITIES = {
8
8
  principals: ['Agent', 'User'],
9
9
  resources: ['Agent', 'App', 'Session'],
10
- actions: ['call_tool', 'connect_server', 'process_prompt', 'provision_sandbox', 'read_file', 'write_file'],
10
+ actions: ['call_tool', 'connect_server', 'process_prompt', 'process_response', 'provision_sandbox', 'read_file', 'write_file'],
11
11
  };
12
12
  /**
13
13
  * Per-action entity mapping for AgentOps.
@@ -26,6 +26,10 @@ export const AGENT_OPS_ACTION_ENTITIES = {
26
26
  principals: ['Agent', 'User'],
27
27
  resources: ['Agent', 'App', 'Session'],
28
28
  },
29
+ 'process_response': {
30
+ principals: ['Agent', 'User'],
31
+ resources: ['Agent', 'App', 'Session'],
32
+ },
29
33
  'provision_sandbox': {
30
34
  principals: ['Agent', 'User'],
31
35
  resources: ['Agent', 'Session'],
@@ -32,21 +32,20 @@ permit (
32
32
  const AI_GATEWAY_SEMANTIC_DEFAULTS_CEDAR = `// =============================================================================
33
33
  // Semantic Threat Detection (Default)
34
34
  // =============================================================================
35
- // Blocks prompt injection, jailbreak attempts, and high-severity threats in
36
- // MCP tool calls and LLM prompts. Uses both detection-engine rule triggers and
37
- // ML classifier confidence scores.
35
+ // Blocks prompt injection and jailbreak attempts in MCP tool calls and LLM
36
+ // prompts via ML classifier confidence scores.
38
37
  //
39
- // Detection layers:
40
- // - Rule triggers (detected_threats), always available
41
- // - ML classifier scores (injection_score, jailbreak_score), require API token
42
- // - Severity aggregation (highest_severity, threat_count), catch-all rules
38
+ // The detected_threats rule-trigger clauses and the highest_severity /
39
+ // threat_count severity-aggregation clauses this template used to carry were
40
+ // removed: AIGateway does not run threat aggregation, so its projected context
41
+ // never contains those keys and the rules could never fire
42
+ // (highflame-shield#429). The ML-score rules below are the working coverage
43
+ // for the same threats. Restore aggregate rules only if the product gains
44
+ // aggregation.
43
45
  //
44
46
  // Context keys consumed:
45
- // - detected_threats: Set<String>
46
47
  // - injection_score: Long (0-100)
47
48
  // - jailbreak_score: Long (0-100)
48
- // - highest_severity: String
49
- // - threat_count: Long
50
49
  //
51
50
  // Compliance:
52
51
  // - OWASP LLM01, OWASP LLM02
@@ -60,21 +59,6 @@ const AI_GATEWAY_SEMANTIC_DEFAULTS_CEDAR = `// =================================
60
59
  // Section 1: Prompt injection
61
60
  // ---------------------------------------------------------------------------
62
61
 
63
- @id("semantic.block-injection-rule")
64
- @name("Block injection (rule)")
65
- @description("Blocks call_tool when detected_threats contains \\"prompt_injection\\".")
66
- @severity("critical")
67
- @tags("category:semantic,threat:injection,detection:rule,surface:call-tool,owasp:llm01,mitre:atlas-t0051,posture:baseline")
68
- @reject_message("Tool execution blocked: prompt injection patterns detected (OWASP LLM01).")
69
- forbid (
70
- principal,
71
- action == AIGateway::Action::"call_tool",
72
- resource
73
- )
74
- when {
75
- context has detected_threats && context.detected_threats.contains("prompt_injection")
76
- };
77
-
78
62
  @id("semantic.block-injection-ml")
79
63
  @name("Block injection (ML)")
80
64
  @description("Blocks call_tool when injection_score >= 75.")
@@ -94,21 +78,6 @@ when {
94
78
  // Section 2: Jailbreak
95
79
  // ---------------------------------------------------------------------------
96
80
 
97
- @id("semantic.block-jailbreak-rule")
98
- @name("Block jailbreak (rule)")
99
- @description("Blocks call_tool when detected_threats contains \\"jailbreak\\".")
100
- @severity("critical")
101
- @tags("category:semantic,threat:jailbreak,detection:rule,surface:call-tool,owasp:llm02,mitre:atlas-t0054,posture:baseline")
102
- @reject_message("Tool execution blocked: jailbreak patterns detected (OWASP LLM02).")
103
- forbid (
104
- principal,
105
- action == AIGateway::Action::"call_tool",
106
- resource
107
- )
108
- when {
109
- context has detected_threats && context.detected_threats.contains("jailbreak")
110
- };
111
-
112
81
  @id("semantic.block-jailbreak-ml")
113
82
  @name("Block jailbreak (ML)")
114
83
  @description("Blocks call_tool when jailbreak_score >= 75.")
@@ -123,58 +92,19 @@ forbid (
123
92
  when {
124
93
  context has jailbreak_score && context.jailbreak_score >= 75
125
94
  };
126
-
127
- // ---------------------------------------------------------------------------
128
- // Section 3: Severity aggregation
129
- // ---------------------------------------------------------------------------
130
-
131
- @id("semantic.block-critical")
132
- @name("Block critical threats")
133
- @description("Blocks all MCP operations when highest_severity equals \\"critical\\".")
134
- @severity("critical")
135
- @tags("category:semantic,detection:aggregate,posture:catch-all")
136
- @reject_message("MCP operation blocked: a critical-severity threat was detected.")
137
- forbid (
138
- principal,
139
- action,
140
- resource
141
- )
142
- when {
143
- context has highest_severity && context.highest_severity == "critical"
144
- };
145
-
146
- @id("semantic.block-multi-threat")
147
- @name("Block multi-threat tool calls")
148
- @description("Blocks call_tool when threat_count >= 3.")
149
- @severity("high")
150
- @tags("category:semantic,detection:aggregate,surface:call-tool,posture:catch-all")
151
- @reject_message("Tool execution blocked: multiple concurrent security threats were detected.")
152
- forbid (
153
- principal,
154
- action == AIGateway::Action::"call_tool",
155
- resource
156
- )
157
- when {
158
- context has threat_count && context.threat_count >= 3
159
- };
160
95
  `;
161
96
  const AI_GATEWAY_TOOLS_DEFAULTS_CEDAR = `// =============================================================================
162
97
  // Tool Permissioning (Default)
163
98
  // =============================================================================
164
- // Blocks MCP tool calls based on risk scoring, threat detection, and tool
165
- // classification.
99
+ // Blocks MCP tool calls based on risk scoring and tool classification.
166
100
  //
167
101
  // Detection layers:
168
102
  // - Computed risk score (tool_risk_score)
169
103
  // - Detector category labels (tool_category, tool_is_sensitive)
170
- // - Threat aggregation (threat_count, max_threat_severity)
171
104
  //
172
105
  // Context keys consumed:
173
106
  // - tool_risk_score: Long (0-100)
174
107
  // - tool_category: String
175
- // - tool_is_sensitive: Bool
176
- // - threat_count: Long
177
- // - max_threat_severity: Long (0-4)
178
108
  //
179
109
  // Compliance:
180
110
  // - OWASP LLM06, OWASP ASI02
@@ -213,41 +143,15 @@ when {
213
143
  context has tool_category && context.tool_category == "dangerous"
214
144
  };
215
145
 
216
- @id("tools.block-sensitive-with-threats")
217
- @name("Block sensitive tools with threats")
218
- @description("Blocks call_tool when tool_is_sensitive is true and threat_count >= 1.")
219
- @severity("high")
220
- @tags("category:tools,detection:aggregate,surface:call-tool,owasp:llm06")
221
- @reject_message("Tool execution blocked: a sensitive tool was called while threats were detected.")
222
- forbid (
223
- principal,
224
- action == AIGateway::Action::"call_tool",
225
- resource
226
- )
227
- when {
228
- context has tool_is_sensitive && context.tool_is_sensitive == true &&
229
- context has threat_count && context.threat_count >= 1
230
- };
231
-
232
- @id("tools.block-high-severity")
233
- @name("Block high-severity tool calls")
234
- @description("Blocks call_tool when threat_count >= 1 and max_threat_severity >= 3.")
235
- @severity("high")
236
- @tags("category:tools,detection:aggregate,surface:call-tool")
237
- @reject_message("Tool execution blocked: high or critical severity threats were detected.")
238
- forbid (
239
- principal,
240
- action == AIGateway::Action::"call_tool",
241
- resource
242
- )
243
- when {
244
- context has threat_count && context has max_threat_severity &&
245
- context.threat_count >= 1 && context.max_threat_severity >= 3
246
- };
247
-
248
146
  // The command-injection rule was removed while that detector is disabled, so
249
147
  // this template cannot instantiate a rule that can never fire. See
250
148
  // highflame-shield#386; restore it when the detector is re-enabled.
149
+
150
+ // The threat_count / max_threat_severity aggregate rules
151
+ // (tools.block-sensitive-with-threats, tools.block-high-severity) were removed
152
+ // for the same reason: AIGateway does not run threat aggregation, so its
153
+ // projected context never contains those keys and the rules could never fire
154
+ // (highflame-shield#429). Restore them only if the product gains aggregation.
251
155
  `;
252
156
  const AI_GATEWAY_AGENT_SECURITY_DEFAULTS_CEDAR = `// =============================================================================
253
157
  // Agent Security (Default)
@@ -264,7 +168,6 @@ const AI_GATEWAY_AGENT_SECURITY_DEFAULTS_CEDAR = `// ===========================
264
168
  // - mcp_server_verified: Bool
265
169
  // - mcp_config_risk: Bool
266
170
  // - mcp_risk_score: Long (0-100)
267
- // - threat_count: Long
268
171
  //
269
172
  // Compliance:
270
173
  // - OWASP LLM01, OWASP ASI01, OWASP ASI02, OWASP ASI04
@@ -366,21 +269,11 @@ when {
366
269
  // Section 4: MCP supply chain & trust
367
270
  // ---------------------------------------------------------------------------
368
271
 
369
- @id("agent-security.block-unverified-threats")
370
- @name("Block unverified server threats")
371
- @description("Blocks call_tool when mcp_server_verified is false and threat_count >= 1.")
372
- @severity("high")
373
- @tags("category:agent-security,threat:supply-chain,detection:aggregate,surface:call-tool,owasp:asi04")
374
- @reject_message("Tool execution blocked: the MCP server is unverified and security threats were detected.")
375
- forbid (
376
- principal,
377
- action == AIGateway::Action::"call_tool",
378
- resource
379
- )
380
- when {
381
- context has mcp_server_verified && context.mcp_server_verified == false &&
382
- context has threat_count && context.threat_count >= 1
383
- };
272
+ // The agent-security.block-unverified-threats rule (unverified server AND
273
+ // threat_count >= 1) was removed: AIGateway does not run threat aggregation,
274
+ // so threat_count is never in its projected context and the rule could never
275
+ // fire (highflame-shield#429). A working "unverified server + any detection"
276
+ // rule needs a key the product actually projects; restore only with one.
384
277
 
385
278
  @id("agent-security.block-mcp-config-risk")
386
279
  @name("Block risky MCP server configs")
@@ -595,13 +488,13 @@ const AI_GATEWAY_DATA_PROTECTION_SECRETS_CEDAR = `// ===========================
595
488
 
596
489
  @id("data-protection.block-secrets")
597
490
  @name("Block secrets in prompts")
598
- @description("Blocks process_prompt when secrets_detected is true.")
491
+ @description("Blocks process_prompt and process_response when secrets_detected is true.")
599
492
  @severity("critical")
600
- @tags("category:data-protection,threat:secrets,detection:rule,surface:process-prompt,owasp:llm06")
493
+ @tags("category:data-protection,threat:secrets,detection:rule,surface:process-prompt,surface:process-response,owasp:llm06")
601
494
  @reject_message("Prompt blocked: secrets or credentials were detected — remove sensitive data and retry.")
602
495
  forbid (
603
496
  principal,
604
- action == AIGateway::Action::"process_prompt",
497
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"process_response"],
605
498
  resource
606
499
  )
607
500
  when {
@@ -647,7 +540,8 @@ const AI_GATEWAY_PRIVACY_DEFAULTS_CEDAR = `// ==================================
647
540
  @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
648
541
  forbid (
649
542
  principal,
650
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
543
+ action in [AIGateway::Action::"process_prompt",
544
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
651
545
  resource
652
546
  )
653
547
  when {
@@ -668,7 +562,8 @@ when {
668
562
  @reject_message("Content blocked: credit card number patterns detected.")
669
563
  forbid (
670
564
  principal,
671
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
565
+ action in [AIGateway::Action::"process_prompt",
566
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
672
567
  resource
673
568
  )
674
569
  when {
@@ -683,7 +578,8 @@ when {
683
578
  @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
684
579
  forbid (
685
580
  principal,
686
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
581
+ action in [AIGateway::Action::"process_prompt",
582
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
687
583
  resource
688
584
  )
689
585
  when {
@@ -704,7 +600,8 @@ when {
704
600
  @reject_message("Content blocked: medical record identifier patterns detected.")
705
601
  forbid (
706
602
  principal,
707
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
603
+ action in [AIGateway::Action::"process_prompt",
604
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
708
605
  resource
709
606
  )
710
607
  when {
@@ -727,7 +624,8 @@ when {
727
624
  @reject_message("Content blocked: tax identifier (ITIN or EIN) patterns detected.")
728
625
  forbid (
729
626
  principal,
730
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
627
+ action in [AIGateway::Action::"process_prompt",
628
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
731
629
  resource
732
630
  )
733
631
  when {
@@ -747,7 +645,8 @@ when {
747
645
  @reject_message("Content blocked: credential or API key patterns detected.")
748
646
  forbid (
749
647
  principal,
750
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
648
+ action in [AIGateway::Action::"process_prompt",
649
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
751
650
  resource
752
651
  )
753
652
  when {
@@ -777,7 +676,8 @@ when {
777
676
  @reject_message("Content blocked: cryptocurrency wallet address patterns detected.")
778
677
  forbid (
779
678
  principal,
780
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
679
+ action in [AIGateway::Action::"process_prompt",
680
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
781
681
  resource
782
682
  )
783
683
  when {
@@ -812,7 +712,8 @@ const AI_GATEWAY_PRIVACY_PII_MODEL_CEDAR = `// =================================
812
712
  @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
813
713
  forbid (
814
714
  principal,
815
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
715
+ action in [AIGateway::Action::"process_prompt",
716
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
816
717
  resource
817
718
  )
818
719
  when {
@@ -827,7 +728,8 @@ when {
827
728
  @reject_message("Content blocked: credit card number patterns detected.")
828
729
  forbid (
829
730
  principal,
830
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
731
+ action in [AIGateway::Action::"process_prompt",
732
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
831
733
  resource
832
734
  )
833
735
  when {
@@ -842,7 +744,8 @@ when {
842
744
  @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
843
745
  forbid (
844
746
  principal,
845
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
747
+ action in [AIGateway::Action::"process_prompt",
748
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
846
749
  resource
847
750
  )
848
751
  when {
@@ -857,7 +760,8 @@ when {
857
760
  @reject_message("Content blocked: medical record identifier patterns detected.")
858
761
  forbid (
859
762
  principal,
860
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
763
+ action in [AIGateway::Action::"process_prompt",
764
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
861
765
  resource
862
766
  )
863
767
  when {
@@ -872,7 +776,8 @@ when {
872
776
  @reject_message("Content blocked: credential or API key patterns detected.")
873
777
  forbid (
874
778
  principal,
875
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
779
+ action in [AIGateway::Action::"process_prompt",
780
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
876
781
  resource
877
782
  )
878
783
  when {
@@ -903,7 +808,8 @@ const AI_GATEWAY_PRIVACY_ADVANCED_PII_CEDAR = `// ==============================
903
808
  @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
904
809
  forbid (
905
810
  principal,
906
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
811
+ action in [AIGateway::Action::"process_prompt",
812
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
907
813
  resource
908
814
  )
909
815
  when {
@@ -925,7 +831,8 @@ when {
925
831
  @reject_message("Content blocked: credit card number patterns detected.")
926
832
  forbid (
927
833
  principal,
928
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
834
+ action in [AIGateway::Action::"process_prompt",
835
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
929
836
  resource
930
837
  )
931
838
  when {
@@ -944,7 +851,8 @@ when {
944
851
  @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
945
852
  forbid (
946
853
  principal,
947
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
854
+ action in [AIGateway::Action::"process_prompt",
855
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
948
856
  resource
949
857
  )
950
858
  when {
@@ -966,7 +874,8 @@ when {
966
874
  @reject_message("Content blocked: medical record identifier patterns detected.")
967
875
  forbid (
968
876
  principal,
969
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
877
+ action in [AIGateway::Action::"process_prompt",
878
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
970
879
  resource
971
880
  )
972
881
  when {
@@ -990,7 +899,8 @@ when {
990
899
  @reject_message("Content blocked: tax identifier (ITIN or EIN) patterns detected.")
991
900
  forbid (
992
901
  principal,
993
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
902
+ action in [AIGateway::Action::"process_prompt",
903
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
994
904
  resource
995
905
  )
996
906
  when {
@@ -1010,7 +920,8 @@ when {
1010
920
  @reject_message("Content blocked: credential or API key patterns detected.")
1011
921
  forbid (
1012
922
  principal,
1013
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
923
+ action in [AIGateway::Action::"process_prompt",
924
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1014
925
  resource
1015
926
  )
1016
927
  when {
@@ -1041,7 +952,8 @@ when {
1041
952
  @reject_message("Content blocked: cryptocurrency wallet address patterns detected.")
1042
953
  forbid (
1043
954
  principal,
1044
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
955
+ action in [AIGateway::Action::"process_prompt",
956
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1045
957
  resource
1046
958
  )
1047
959
  when {
@@ -1060,7 +972,8 @@ when {
1060
972
  @reject_message("Content blocked: personal name patterns detected.")
1061
973
  forbid (
1062
974
  principal,
1063
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
975
+ action in [AIGateway::Action::"process_prompt",
976
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1064
977
  resource
1065
978
  )
1066
979
  when {
@@ -1079,7 +992,8 @@ when {
1079
992
  @reject_message("Content blocked: email address patterns detected.")
1080
993
  forbid (
1081
994
  principal,
1082
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
995
+ action in [AIGateway::Action::"process_prompt",
996
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1083
997
  resource
1084
998
  )
1085
999
  when {
@@ -1098,7 +1012,8 @@ when {
1098
1012
  @reject_message("Content blocked: phone number patterns detected.")
1099
1013
  forbid (
1100
1014
  principal,
1101
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1015
+ action in [AIGateway::Action::"process_prompt",
1016
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1102
1017
  resource
1103
1018
  )
1104
1019
  when {
@@ -1117,7 +1032,8 @@ when {
1117
1032
  @reject_message("Content blocked: date or time patterns detected.")
1118
1033
  forbid (
1119
1034
  principal,
1120
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1035
+ action in [AIGateway::Action::"process_prompt",
1036
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1121
1037
  resource
1122
1038
  )
1123
1039
  when {
@@ -1139,7 +1055,8 @@ when {
1139
1055
  @reject_message("Content blocked: URL patterns detected.")
1140
1056
  forbid (
1141
1057
  principal,
1142
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1058
+ action in [AIGateway::Action::"process_prompt",
1059
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1143
1060
  resource
1144
1061
  )
1145
1062
  when {
@@ -1158,7 +1075,8 @@ when {
1158
1075
  @reject_message("Content blocked: street address or location patterns detected.")
1159
1076
  forbid (
1160
1077
  principal,
1161
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1078
+ action in [AIGateway::Action::"process_prompt",
1079
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1162
1080
  resource
1163
1081
  )
1164
1082
  when {
@@ -1179,7 +1097,8 @@ when {
1179
1097
  @reject_message("Content blocked: organization name patterns detected.")
1180
1098
  forbid (
1181
1099
  principal,
1182
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1100
+ action in [AIGateway::Action::"process_prompt",
1101
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1183
1102
  resource
1184
1103
  )
1185
1104
  when {
@@ -1198,7 +1117,8 @@ when {
1198
1117
  @reject_message("Content blocked: occupation patterns detected.")
1199
1118
  forbid (
1200
1119
  principal,
1201
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1120
+ action in [AIGateway::Action::"process_prompt",
1121
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1202
1122
  resource
1203
1123
  )
1204
1124
  when {
@@ -1217,7 +1137,8 @@ when {
1217
1137
  @reject_message("Content blocked: username patterns detected.")
1218
1138
  forbid (
1219
1139
  principal,
1220
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1140
+ action in [AIGateway::Action::"process_prompt",
1141
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1221
1142
  resource
1222
1143
  )
1223
1144
  when {
@@ -1236,7 +1157,8 @@ when {
1236
1157
  @reject_message("Content blocked: employee or customer identifier patterns detected.")
1237
1158
  forbid (
1238
1159
  principal,
1239
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1160
+ action in [AIGateway::Action::"process_prompt",
1161
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1240
1162
  resource
1241
1163
  )
1242
1164
  when {
@@ -1257,7 +1179,8 @@ when {
1257
1179
  @reject_message("Content blocked: device or network identifier patterns detected.")
1258
1180
  forbid (
1259
1181
  principal,
1260
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1182
+ action in [AIGateway::Action::"process_prompt",
1183
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1261
1184
  resource
1262
1185
  )
1263
1186
  when {
@@ -1284,7 +1207,8 @@ when {
1284
1207
  @reject_message("Content blocked: vehicle identifier (VIN or plate) patterns detected.")
1285
1208
  forbid (
1286
1209
  principal,
1287
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1210
+ action in [AIGateway::Action::"process_prompt",
1211
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1288
1212
  resource
1289
1213
  )
1290
1214
  when {
@@ -1304,7 +1228,8 @@ when {
1304
1228
  @reject_message("Content blocked: salary or financial amount patterns detected.")
1305
1229
  forbid (
1306
1230
  principal,
1307
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1231
+ action in [AIGateway::Action::"process_prompt",
1232
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1308
1233
  resource
1309
1234
  )
1310
1235
  when {
@@ -1325,7 +1250,8 @@ when {
1325
1250
  @reject_message("Content blocked: sensitive attribute (ethnicity, religion, etc.) patterns detected.")
1326
1251
  forbid (
1327
1252
  principal,
1328
- action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1253
+ action in [AIGateway::Action::"process_prompt",
1254
+ AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1329
1255
  resource
1330
1256
  )
1331
1257
  when {
@@ -6,8 +6,8 @@
6
6
  */
7
7
  export const AI_GATEWAY_ENTITIES = {
8
8
  principals: ['MCP_Client', 'User'],
9
- resources: ['FilePath', 'LlmPrompt', 'Server', 'Tool'],
10
- actions: ['call_tool', 'connect_server', 'process_prompt', 'read_file', 'write_file'],
9
+ resources: ['FilePath', 'LlmPrompt', 'LlmResponse', 'Server', 'Tool'],
10
+ actions: ['call_tool', 'connect_server', 'process_prompt', 'process_response', 'read_file', 'write_file'],
11
11
  };
12
12
  /**
13
13
  * Per-action entity mapping for AiGateway.
@@ -26,6 +26,10 @@ export const AI_GATEWAY_ACTION_ENTITIES = {
26
26
  principals: ['MCP_Client', 'User'],
27
27
  resources: ['LlmPrompt'],
28
28
  },
29
+ 'process_response': {
30
+ principals: ['MCP_Client', 'User'],
31
+ resources: ['LlmResponse'],
32
+ },
29
33
  'read_file': {
30
34
  principals: ['MCP_Client', 'User'],
31
35
  resources: ['FilePath'],