@highflame/policy 2.1.35 → 2.1.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 (81) hide show
  1. package/_schemas/ai_gateway/context.json +431 -11
  2. package/_schemas/ai_gateway/schema.cedarschema +91 -11
  3. package/_schemas/ai_gateway/templates/defaults/agent_security.cedar +66 -43
  4. package/_schemas/ai_gateway/templates/defaults/baseline.cedar +9 -11
  5. package/_schemas/ai_gateway/templates/defaults/semantic.cedar +63 -40
  6. package/_schemas/ai_gateway/templates/defaults/tools.cedar +48 -36
  7. package/_schemas/ai_gateway/templates/llm_default_allow.cedar +9 -10
  8. package/_schemas/ai_gateway/templates/mcp_server_allowlist.cedar +22 -14
  9. package/_schemas/ai_gateway/templates/mcp_tool_permissions.cedar +29 -27
  10. package/_schemas/ai_gateway/templates/pii_redaction.cedar +38 -33
  11. package/_schemas/ai_gateway/templates/templates.json +52 -50
  12. package/_schemas/guardrails/context.json +12 -12
  13. package/_schemas/guardrails/schema.cedarschema +12 -12
  14. package/_schemas/guardrails/templates/defaults/agent_identity.cedar +60 -56
  15. package/_schemas/guardrails/templates/defaults/agentic_safety.cedar +83 -58
  16. package/_schemas/guardrails/templates/defaults/baseline.cedar +9 -12
  17. package/_schemas/guardrails/templates/defaults/injection.cedar +48 -36
  18. package/_schemas/guardrails/templates/defaults/pii.cedar +27 -20
  19. package/_schemas/guardrails/templates/defaults/secrets.cedar +39 -22
  20. package/_schemas/guardrails/templates/defaults/security_patterns.cedar +38 -25
  21. package/_schemas/guardrails/templates/defaults/semantic.cedar +47 -31
  22. package/_schemas/guardrails/templates/defaults/tool_risk.cedar +34 -26
  23. package/_schemas/guardrails/templates/defaults/toxicity.cedar +57 -47
  24. package/_schemas/guardrails/templates/mcp_tool_permissions.cedar +60 -43
  25. package/_schemas/guardrails/templates/profiles/a2a_security/cross_origin.cedar +29 -42
  26. package/_schemas/guardrails/templates/profiles/a2a_security/escalation_detection.cedar +43 -57
  27. package/_schemas/guardrails/templates/profiles/a2a_security/identity_enforcement.cedar +40 -57
  28. package/_schemas/guardrails/templates/profiles/a2a_security/inter_agent_injection.cedar +48 -62
  29. package/_schemas/guardrails/templates/profiles/a2a_security/supply_chain.cedar +40 -56
  30. package/_schemas/guardrails/templates/profiles/advanced_detection/pii.cedar +24 -34
  31. package/_schemas/guardrails/templates/profiles/advanced_detection/secrets.cedar +45 -37
  32. package/_schemas/guardrails/templates/profiles/advanced_detection/threat_severity.cedar +11 -16
  33. package/_schemas/guardrails/templates/profiles/chat_assistant/privacy.cedar +22 -9
  34. package/_schemas/guardrails/templates/profiles/chat_assistant/security.cedar +27 -15
  35. package/_schemas/guardrails/templates/profiles/chat_assistant/trust_safety.cedar +37 -22
  36. package/_schemas/guardrails/templates/profiles/code_agent/agentic_security.cedar +68 -47
  37. package/_schemas/guardrails/templates/profiles/code_agent/encoding.cedar +17 -21
  38. package/_schemas/guardrails/templates/profiles/code_agent/path_security.cedar +74 -73
  39. package/_schemas/guardrails/templates/profiles/code_agent/security.cedar +13 -9
  40. package/_schemas/guardrails/templates/profiles/code_agent/supply_chain.cedar +36 -58
  41. package/_schemas/guardrails/templates/profiles/data_pipeline/agentic_security.cedar +22 -15
  42. package/_schemas/guardrails/templates/profiles/data_pipeline/data_protection.cedar +52 -0
  43. package/_schemas/guardrails/templates/profiles/data_pipeline/privacy.cedar +41 -18
  44. package/_schemas/guardrails/templates/profiles/data_pipeline/security.cedar +18 -36
  45. package/_schemas/guardrails/templates/profiles/multi_agent/agent_safety.cedar +86 -79
  46. package/_schemas/guardrails/templates/profiles/multi_agent/agent_trust.cedar +73 -70
  47. package/_schemas/guardrails/templates/templates.json +198 -217
  48. package/_schemas/overwatch/context.json +14 -14
  49. package/_schemas/overwatch/schema.cedarschema +12 -12
  50. package/_schemas/sentry/context.json +11 -11
  51. package/_schemas/sentry/schema.cedarschema +11 -11
  52. package/_schemas/sentry/templates/defaults/baseline.cedar +8 -12
  53. package/_schemas/sentry/templates/defaults/clipboard.cedar +43 -42
  54. package/_schemas/sentry/templates/defaults/content_safety.cedar +38 -68
  55. package/_schemas/sentry/templates/defaults/file_safety.cedar +18 -26
  56. package/_schemas/sentry/templates/defaults/organization.cedar +10 -17
  57. package/_schemas/sentry/templates/defaults/pii.cedar +52 -73
  58. package/_schemas/sentry/templates/defaults/secrets.cedar +65 -58
  59. package/_schemas/sentry/templates/defaults/semantic.cedar +40 -59
  60. package/_schemas/sentry/templates/templates.json +53 -43
  61. package/dist/ai_gateway-context.gen.d.ts +18 -4
  62. package/dist/ai_gateway-context.gen.js +18 -4
  63. package/dist/ai_gateway-defaults.gen.d.ts +4 -1
  64. package/dist/ai_gateway-defaults.gen.js +398 -320
  65. package/dist/builder.d.ts +2 -1
  66. package/dist/builder.js +5 -2
  67. package/dist/guardrails-context.gen.d.ts +5 -5
  68. package/dist/guardrails-context.gen.js +5 -5
  69. package/dist/guardrails-defaults.gen.d.ts +4 -1
  70. package/dist/guardrails-defaults.gen.js +2130 -1903
  71. package/dist/overwatch-context.gen.d.ts +5 -5
  72. package/dist/overwatch-context.gen.js +5 -5
  73. package/dist/overwatch-defaults.gen.d.ts +4 -1
  74. package/dist/overwatch-defaults.gen.js +560 -566
  75. package/dist/sentry-context.gen.d.ts +3 -3
  76. package/dist/sentry-context.gen.js +3 -3
  77. package/dist/sentry-defaults.gen.d.ts +4 -1
  78. package/dist/sentry-defaults.gen.js +392 -453
  79. package/dist/service-schemas.gen.d.ts +4 -4
  80. package/dist/service-schemas.gen.js +249 -99
  81. package/package.json +1 -1
@@ -1,20 +1,37 @@
1
1
  // =============================================================================
2
- // Tool Permissioning Policy (Default)
2
+ // Tool Permissioning (Default)
3
3
  // =============================================================================
4
- // Controls access to MCP tools based on risk scoring, threat detection,
5
- // and tool classification.
4
+ // Blocks MCP tool calls based on risk scoring, threat detection, and tool
5
+ // classification.
6
6
  //
7
- // Category: tools
7
+ // Detection layers:
8
+ // - Computed risk score (tool_risk_score)
9
+ // - Detector category labels (tool_category, tool_is_sensitive)
10
+ // - Threat aggregation (threat_count, max_threat_severity)
11
+ // - Detection rule triggers (detected_threats)
12
+ //
13
+ // Context keys consumed:
14
+ // - tool_risk_score: Long (0-100)
15
+ // - tool_category: String
16
+ // - tool_is_sensitive: Bool
17
+ // - threat_count: Long
18
+ // - max_threat_severity: Long (0-4)
19
+ // - detected_threats: Set<String>
20
+ //
21
+ // Compliance:
22
+ // - OWASP LLM06, OWASP ASI02
23
+ // - MITRE T1059
24
+ //
25
+ // Category: tools
8
26
  // Namespace: AIGateway
9
27
  // =============================================================================
10
28
 
11
- // Block tools with very high computed risk
12
- @id("tools-block-high-risk-score")
13
- @name("Block high-risk tool operations")
14
- @description("Block tool operations when the computed risk score exceeds 90/100")
29
+ @id("tools.block-high-risk-score")
30
+ @name("Block high-risk tools")
31
+ @description("Blocks call_tool when tool_risk_score >= 90.")
15
32
  @severity("critical")
16
- @tags("tool-risk,security,owasp-llm06,owasp-asi02")
17
- @reject_message("Tool execution blocked: this operation scored 90+ on the risk assessment.")
33
+ @tags("category:tools,detection:aggregate,surface:call-tool,owasp:llm06,owasp:asi02")
34
+ @reject_message("Tool execution blocked: tool risk score is at or above 90/100.")
18
35
  forbid (
19
36
  principal,
20
37
  action == AIGateway::Action::"call_tool",
@@ -24,13 +41,12 @@ when {
24
41
  context has tool_risk_score && context.tool_risk_score >= 90
25
42
  };
26
43
 
27
- // Block tools classified as dangerous
28
- @id("tools-block-dangerous-category")
44
+ @id("tools.block-dangerous-category")
29
45
  @name("Block dangerous tool category")
30
- @description("Block all tools classified as dangerous by the detection engine")
46
+ @description("Blocks call_tool when tool_category equals \"dangerous\".")
31
47
  @severity("critical")
32
- @tags("tool-category,dangerous,security,owasp-llm06")
33
- @reject_message("Tool execution blocked: this tool is classified as dangerous.")
48
+ @tags("category:tools,detection:rule,surface:call-tool,owasp:llm06")
49
+ @reject_message("Tool execution blocked: tool is classified as dangerous.")
34
50
  forbid (
35
51
  principal,
36
52
  action == AIGateway::Action::"call_tool",
@@ -40,30 +56,28 @@ when {
40
56
  context has tool_category && context.tool_category == "dangerous"
41
57
  };
42
58
 
43
- // Block sensitive tools when threats are detected
44
- @id("tools-block-sensitive-with-threats")
59
+ @id("tools.block-sensitive-with-threats")
45
60
  @name("Block sensitive tools with threats")
46
- @description("Block sensitive tools when any threats are detected concurrently")
61
+ @description("Blocks call_tool when tool_is_sensitive is true and threat_count >= 1.")
47
62
  @severity("high")
48
- @tags("tool-category,sensitive,security,defense-in-depth")
49
- @reject_message("Sensitive tool execution blocked: threats were detected alongside a sensitive tool operation.")
63
+ @tags("category:tools,detection:aggregate,surface:call-tool,owasp:llm06")
64
+ @reject_message("Tool execution blocked: a sensitive tool was called while threats were detected.")
50
65
  forbid (
51
66
  principal,
52
67
  action == AIGateway::Action::"call_tool",
53
68
  resource
54
69
  )
55
70
  when {
56
- context has tool_is_sensitive && context.tool_is_sensitive &&
57
- context has threat_count && context.threat_count > 0
71
+ context has tool_is_sensitive && context.tool_is_sensitive == true &&
72
+ context has threat_count && context.threat_count >= 1
58
73
  };
59
74
 
60
- // Block tool calls with high severity threats
61
- @id("tools-block-high-severity-threats")
62
- @name("Block tool calls with high severity threats")
63
- @description("Prevent tool execution when high or critical severity threats are detected")
75
+ @id("tools.block-high-severity")
76
+ @name("Block high-severity tool calls")
77
+ @description("Blocks call_tool when threat_count >= 1 and max_threat_severity >= 3.")
64
78
  @severity("high")
65
- @tags("tools,threats,severity,security")
66
- @reject_message("Tool execution was blocked because high or critical severity threats were detected.")
79
+ @tags("category:tools,detection:aggregate,surface:call-tool")
80
+ @reject_message("Tool execution blocked: high or critical severity threats were detected.")
67
81
  forbid (
68
82
  principal,
69
83
  action == AIGateway::Action::"call_tool",
@@ -71,15 +85,14 @@ forbid (
71
85
  )
72
86
  when {
73
87
  context has threat_count && context has max_threat_severity &&
74
- context.threat_count > 0 && context.max_threat_severity >= 3
88
+ context.threat_count >= 1 && context.max_threat_severity >= 3
75
89
  };
76
90
 
77
- // Block detected command injection patterns
78
- @id("tools-block-command-injection")
79
- @name("Block command injection in tool calls")
80
- @description("Block tool calls when command injection patterns are detected in arguments")
91
+ @id("tools.block-command-injection")
92
+ @name("Block command injection")
93
+ @description("Blocks call_tool when detected_threats contains \"command_injection\".")
81
94
  @severity("critical")
82
- @tags("command-injection,security,mitre-t1059,owasp-asi02")
95
+ @tags("category:tools,threat:command-injection,detection:rule,surface:call-tool,mitre:t1059,owasp:asi02")
83
96
  @reject_message("Tool execution blocked: command injection pattern detected in tool arguments.")
84
97
  forbid (
85
98
  principal,
@@ -87,6 +100,5 @@ forbid (
87
100
  resource
88
101
  )
89
102
  when {
90
- context has detected_threats &&
91
- context.detected_threats.contains("command_injection")
103
+ context has detected_threats && context.detected_threats.contains("command_injection")
92
104
  };
@@ -1,20 +1,19 @@
1
1
  // =============================================================================
2
- // Default Allow LLM Proxy Calls
2
+ // LLM Default Allow
3
3
  // =============================================================================
4
- // Permits all LLM prompt processing by default. Deploy this alongside
5
- // threat-specific forbid policies to create a "default allow, block on threat"
6
- // posture for LLM chat completions.
4
+ // Permits all LLM prompt processing by default. Deploy alongside threat-specific
5
+ // forbid policies to create a "default allow, block on threat" posture for LLM
6
+ // chat completions.
7
7
  //
8
- // Category: organization
8
+ // Category: organization
9
9
  // Namespace: AIGateway
10
10
  // =============================================================================
11
11
 
12
- // Allow all LLM prompt processing by default
13
- @id("llm-permit-all-prompts")
14
- @name("Allow all LLM proxy calls")
15
- @description("Permits all LLM chat completion requests by default -- threat-specific forbid policies override this when threats are detected")
12
+ @id("organization.permit-llm-default")
13
+ @name("Permit LLM proxy calls")
14
+ @description("Permits all process_prompt actions for the LLM proxy.")
16
15
  @severity("low")
17
- @tags("llm,permit-default,organization,proxy")
16
+ @tags("category:organization,surface:process-prompt,posture:permit-default")
18
17
  permit (
19
18
  principal,
20
19
  action == AIGateway::Action::"process_prompt",
@@ -1,15 +1,22 @@
1
- // MCP Server Allowlist Template
2
- // Only allow specific MCP servers to be used
3
- // Category: tools
1
+ // =============================================================================
2
+ // MCP Server Allowlist
3
+ // =============================================================================
4
+ // Restricts MCP server connections to a pre-approved list. Customize the
5
+ // `context.mcp_server` values in the permit rule to match the allowed
6
+ // servers for your environment.
4
7
  //
5
- // NOTE: Users should customize the mcp_server values in the permit rule
6
- // to match their allowed servers before deploying this template.
8
+ // Context keys consumed:
9
+ // - mcp_server: String
10
+ //
11
+ // Category: tools
12
+ // Namespace: AIGateway
13
+ // =============================================================================
7
14
 
8
- @id("mcp-allowlist-permit")
9
- @name("Allow specific MCP servers")
10
- @description("Only allow connections to pre-approved MCP servers (customize the list)")
15
+ @id("tools.allow-mcp-allowlist")
16
+ @name("Allow allowlisted MCP servers")
17
+ @description("Permits connect_server when mcp_server is in the allowlist.")
11
18
  @severity("medium")
12
- @tags("mcp,allowlist,server,governance")
19
+ @tags("category:tools,surface:connect-server,scope:org-wide,posture:deny-default")
13
20
  permit (
14
21
  principal,
15
22
  action == AIGateway::Action::"connect_server",
@@ -18,14 +25,15 @@ permit (
18
25
  when {
19
26
  context has mcp_server &&
20
27
  (context.mcp_server == "filesystem" ||
21
- context.mcp_server == "playwright")
28
+ context.mcp_server == "playwright")
22
29
  };
23
30
 
24
- @id("mcp-allowlist-deny")
25
- @name("Deny unallowed MCP servers")
26
- @description("Block all MCP server connections not in the allowlist")
31
+ @id("tools.deny-non-allowlisted-mcp")
32
+ @name("Block non-allowlisted MCP servers")
33
+ @description("Blocks connect_server unconditionally so only the allowlist permit applies.")
27
34
  @severity("medium")
28
- @tags("mcp,deny-default,server")
35
+ @tags("category:tools,surface:connect-server,scope:org-wide,posture:deny-default")
36
+ @reject_message("MCP server connection blocked: server is not on the allowlist.")
29
37
  forbid (
30
38
  principal,
31
39
  action == AIGateway::Action::"connect_server",
@@ -1,58 +1,60 @@
1
1
  // =============================================================================
2
- // MCP Tool Permissions Template (AIGateway)
2
+ // MCP Tool Permissions
3
3
  // =============================================================================
4
- // Per-tool access control for MCP servers.
5
- // Complements the MCP Server Allowlist (connect_server action)
6
- // with fine-grained per-tool control on call_tool action.
4
+ // Per-tool access control for MCP servers. Complements MCP Server Allowlist
5
+ // (which gates connect_server) with fine-grained control on call_tool.
7
6
  //
8
- // Defaults to permit-all. Customize per-tool gating by adding forbid rules
9
- // scoped to specific mcp_server / tool_name combinations.
7
+ // Ships permit-all by default plus two opt-in safety rails (exclude
8
+ // untrusted/deprecated servers, block unverified servers). Add additional
9
+ // forbid rules to gate specific servers or tools.
10
10
  //
11
- // Category: tools
11
+ // Context keys consumed:
12
+ // - mcp_server: String
13
+ // - mcp_server_verified: Bool
14
+ //
15
+ // Category: tools
12
16
  // Namespace: AIGateway
13
17
  // =============================================================================
14
18
 
15
- // -- Permit all MCP tool calls (opt-in default) -----------------------------
16
-
17
- @id("mcp-tool-allow-all")
18
- @name("Allow all MCP tool calls")
19
- @description("Permit every call_tool action. Add forbid rules below for per-tool gating.")
19
+ @id("tools.allow-mcp-tools-baseline")
20
+ @name("Permit MCP tool calls")
21
+ @description("Permits all call_tool actions; combine with forbid rules for gating.")
20
22
  @severity("low")
21
- @tags("mcp,permit-default")
23
+ @tags("category:tools,surface:call-tool,posture:permit-default")
22
24
  permit (
23
25
  principal,
24
26
  action == AIGateway::Action::"call_tool",
25
27
  resource
26
28
  );
27
29
 
28
- // -- Organization-wide MCP server exclusions --------------------------------
29
-
30
- @id("mcp-tool-exclude-server")
31
- @name("Exclude specific MCP servers")
32
- @description("Block all tool calls from excluded MCP servers (org-wide exclusion list)")
30
+ @id("tools.exclude-mcp-servers")
31
+ @name("Block excluded MCP servers")
32
+ @description("Blocks call_tool when mcp_server is in the org-wide exclusion list.")
33
33
  @severity("critical")
34
- @tags("mcp,exclusion,org-wide,block")
34
+ @tags("category:tools,surface:call-tool,scope:org-wide,posture:deny-default")
35
+ @reject_message("Tool execution blocked: MCP server is on the org-wide exclusion list.")
35
36
  forbid (
36
37
  principal,
37
38
  action == AIGateway::Action::"call_tool",
38
39
  resource
39
- ) when {
40
+ )
41
+ when {
40
42
  context has mcp_server &&
41
43
  (context.mcp_server == "untrusted-server" ||
42
44
  context.mcp_server == "deprecated-server")
43
45
  };
44
46
 
45
- // -- Block unverified MCP servers -------------------------------------------
46
-
47
- @id("mcp-tool-block-unverified")
48
- @name("Block tools from unverified MCP servers")
49
- @description("Deny tool calls from MCP servers not in the verified registry")
47
+ @id("tools.block-unverified-mcp-tools")
48
+ @name("Block unverified MCP server tools")
49
+ @description("Blocks call_tool when mcp_server_verified is false.")
50
50
  @severity("high")
51
- @tags("mcp,trust,verification")
51
+ @tags("category:tools,threat:supply-chain,detection:rule,surface:call-tool")
52
+ @reject_message("Tool execution blocked: MCP server is not from a verified registry.")
52
53
  forbid (
53
54
  principal,
54
55
  action == AIGateway::Action::"call_tool",
55
56
  resource
56
- ) when {
57
+ )
58
+ when {
57
59
  context has mcp_server_verified && context.mcp_server_verified == false
58
60
  };
@@ -1,20 +1,29 @@
1
1
  // =============================================================================
2
- // PII Redaction Policy
2
+ // PII & Secrets Redaction
3
3
  // =============================================================================
4
- // Block or redact requests containing personally identifiable information.
5
- // Covers all AI Gateway actions (MCP tool calls, LLM prompts, file ops).
4
+ // Blocks AI Gateway operations when personally identifiable information or
5
+ // secrets are detected in the content. Covers both LLM prompt processing
6
+ // and MCP tool calls, plus a bulk-exposure catch-all.
6
7
  //
7
- // Category: data_protection
8
+ // Context keys consumed:
9
+ // - pii_detected: Bool
10
+ // - secrets_detected: Bool
11
+ // - pii_count: Long
12
+ //
13
+ // Compliance:
14
+ // - OWASP LLM06
15
+ // - GDPR, HIPAA (depending on data classification)
16
+ //
17
+ // Category: data-protection
8
18
  // Namespace: AIGateway
9
19
  // =============================================================================
10
20
 
11
- // Block requests with PII detected
12
- @id("data-block-pii")
13
- @name("Block PII in requests")
14
- @description("Block any AI Gateway operation when PII is detected in the content")
21
+ @id("data-protection.block-pii")
22
+ @name("Block PII in prompts")
23
+ @description("Blocks process_prompt when pii_detected is true.")
15
24
  @severity("high")
16
- @tags("pii,data-protection,owasp-llm06,dlp")
17
- @reject_message("Request was blocked because personally identifiable information (PII) was detected. Remove sensitive data before retrying.")
25
+ @tags("category:data-protection,threat:pii,detection:rule,surface:process-prompt,owasp:llm06")
26
+ @reject_message("Prompt blocked: personally identifiable information was detected remove sensitive data and retry.")
18
27
  forbid (
19
28
  principal,
20
29
  action == AIGateway::Action::"process_prompt",
@@ -24,29 +33,27 @@ when {
24
33
  context has pii_detected && context.pii_detected == true
25
34
  };
26
35
 
27
- // Block requests with secrets/credentials
28
- @id("data-block-secrets")
29
- @name("Block secrets in requests")
30
- @description("Block any AI Gateway operation when secrets or credentials are detected")
36
+ @id("data-protection.block-secrets")
37
+ @name("Block secrets in prompts")
38
+ @description("Blocks process_prompt when secrets_detected is true.")
31
39
  @severity("critical")
32
- @tags("secrets,data-protection,credentials,dlp")
33
- @reject_message("Request was blocked because secrets or credentials were detected in the content. Remove sensitive credentials before retrying.")
40
+ @tags("category:data-protection,threat:secrets,detection:rule,surface:process-prompt")
41
+ @reject_message("Prompt blocked: secrets or credentials were detected remove sensitive data and retry.")
34
42
  forbid (
35
43
  principal,
36
44
  action == AIGateway::Action::"process_prompt",
37
45
  resource
38
46
  )
39
47
  when {
40
- context has contains_secrets && context.contains_secrets == true
48
+ context has secrets_detected && context.secrets_detected == true
41
49
  };
42
50
 
43
- // Block MCP tool calls with PII
44
- @id("data-block-pii-tools")
51
+ @id("data-protection.block-pii-tools")
45
52
  @name("Block PII in tool calls")
46
- @description("Block MCP tool execution when PII is detected in tool arguments")
53
+ @description("Blocks call_tool when pii_detected is true.")
47
54
  @severity("high")
48
- @tags("pii,tools,data-protection,dlp")
49
- @reject_message("Tool call was blocked because PII was detected in the arguments.")
55
+ @tags("category:data-protection,threat:pii,detection:rule,surface:call-tool,owasp:llm06")
56
+ @reject_message("Tool execution blocked: personally identifiable information was detected in tool arguments.")
50
57
  forbid (
51
58
  principal,
52
59
  action == AIGateway::Action::"call_tool",
@@ -56,29 +63,27 @@ when {
56
63
  context has pii_detected && context.pii_detected == true
57
64
  };
58
65
 
59
- // Block MCP tool calls with secrets
60
- @id("data-block-secrets-tools")
66
+ @id("data-protection.block-secrets-tools")
61
67
  @name("Block secrets in tool calls")
62
- @description("Block MCP tool execution when secrets or credentials are detected")
68
+ @description("Blocks call_tool when secrets_detected is true.")
63
69
  @severity("critical")
64
- @tags("secrets,tools,data-protection,dlp")
65
- @reject_message("Tool call was blocked because secrets were detected in the arguments.")
70
+ @tags("category:data-protection,threat:secrets,detection:rule,surface:call-tool")
71
+ @reject_message("Tool execution blocked: secrets or credentials were detected in tool arguments.")
66
72
  forbid (
67
73
  principal,
68
74
  action == AIGateway::Action::"call_tool",
69
75
  resource
70
76
  )
71
77
  when {
72
- context has contains_secrets && context.contains_secrets == true
78
+ context has secrets_detected && context.secrets_detected == true
73
79
  };
74
80
 
75
- // Block bulk PII exposure (3+ PII matches)
76
- @id("data-block-bulk-pii")
81
+ @id("data-protection.block-pii-bulk")
77
82
  @name("Block bulk PII exposure")
78
- @description("Block operations with 3 or more PII matches -- indicates data dump or exfiltration attempt")
83
+ @description("Blocks any action when pii_count >= 3.")
79
84
  @severity("critical")
80
- @tags("pii,bulk,data-protection,exfiltration")
81
- @reject_message("Request was blocked because multiple PII matches were detected, indicating potential data exfiltration.")
85
+ @tags("category:data-protection,threat:exfiltration,detection:aggregate,posture:catch-all")
86
+ @reject_message("Request blocked: multiple PII matches were detected possible data exfiltration.")
82
87
  forbid (
83
88
  principal,
84
89
  action,
@@ -1,117 +1,119 @@
1
1
  {
2
2
  "service": "ai_gateway",
3
- "version": "2.0.0",
4
- "description": "AIGateway policy templates for MCP + LLM gateway security",
3
+ "version": "2.1.0",
4
+ "description": "AI Gateway policy templates for MCP + LLM gateway security",
5
5
  "categories": [
6
6
  {
7
7
  "id": "semantic",
8
8
  "name": "Semantic Threat Detection",
9
- "description": "Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats"
9
+ "description": "Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats."
10
10
  },
11
11
  {
12
12
  "id": "tools",
13
13
  "name": "Tool Permissioning",
14
- "description": "Control access to MCP tools, enforce risk scoring, and manage per-tool permissions"
14
+ "description": "Control access to MCP tools, enforce risk scoring, and manage per-tool permissions."
15
15
  },
16
16
  {
17
- "id": "agent_security",
17
+ "id": "agent-security",
18
18
  "name": "Agent Security",
19
- "description": "Detect and block tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats"
19
+ "description": "Detect tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats."
20
20
  },
21
21
  {
22
- "id": "data_protection",
22
+ "id": "data-protection",
23
23
  "name": "Data Protection",
24
- "description": "Prevent secrets and PII leakage in LLM chat completions and MCP operations"
25
- },
26
- {
27
- "id": "content_safety",
28
- "name": "Content Safety",
29
- "description": "Enforce content moderation score thresholds on LLM prompts and MCP content"
24
+ "description": "Prevent secrets and PII leakage in LLM chat completions and MCP operations."
30
25
  },
31
26
  {
32
27
  "id": "organization",
33
- "name": "Organization Rules",
34
- "description": "Apply organization-wide policy baselines for AI gateway operations"
28
+ "name": "Organization",
29
+ "description": "Organization-wide baselines and default permit policies."
35
30
  }
36
31
  ],
37
32
  "defaults": [
38
33
  {
39
- "id": "baseline-default",
34
+ "id": "organization.permit-baseline",
40
35
  "name": "Baseline Permit",
41
- "description": "Permits all actions by default -- threat-specific forbid policies override this when threats are detected",
36
+ "description": "Permits all actions by default; threat-specific forbid policies override this when detectors fire.",
42
37
  "category": "organization",
43
38
  "file": "defaults/baseline.cedar",
44
39
  "severity": "low",
45
- "tags": ["baseline", "permit-default", "organization"],
40
+ "tags": ["category:organization", "posture:permit-default"],
46
41
  "is_active": true
42
+ }
43
+ ],
44
+ "templates": [
45
+ {
46
+ "id": "organization.permit-baseline",
47
+ "name": "Baseline Permit",
48
+ "description": "Permits all actions by default; threat-specific forbid policies override this when detectors fire.",
49
+ "category": "organization",
50
+ "file": "defaults/baseline.cedar",
51
+ "severity": "low",
52
+ "tags": ["category:organization", "posture:permit-default"],
53
+ "auto_deploy": true
47
54
  },
48
55
  {
49
- "id": "semantic-default",
56
+ "id": "semantic.defaults",
50
57
  "name": "Semantic Threat Detection",
51
- "description": "Detect and block prompt injection, jailbreak attempts, and high-severity threats in MCP tool calls and LLM prompts",
58
+ "description": "Block prompt injection, jailbreak attempts, and high-severity threats in MCP tool calls and LLM prompts.",
52
59
  "category": "semantic",
53
60
  "file": "defaults/semantic.cedar",
54
61
  "severity": "critical",
55
- "tags": ["prompt-injection", "jailbreak", "owasp-llm01", "owasp-llm02", "security", "baseline"],
56
- "is_active": true
62
+ "tags": ["category:semantic", "threat:injection", "threat:jailbreak", "owasp:llm01", "owasp:llm02"]
57
63
  },
58
64
  {
59
- "id": "tools-default",
65
+ "id": "tools.defaults",
60
66
  "name": "Tool Permissioning",
61
- "description": "Enforce tool risk scoring, block dangerous tools, and detect command injection in MCP tool arguments",
67
+ "description": "Enforce tool risk scoring, block dangerous tools, and detect command injection in MCP tool arguments.",
62
68
  "category": "tools",
63
69
  "file": "defaults/tools.cedar",
64
70
  "severity": "critical",
65
- "tags": ["tool-risk", "command-injection", "owasp-llm06", "owasp-asi02", "baseline"],
66
- "is_active": true
71
+ "tags": ["category:tools", "threat:command-injection", "owasp:llm06", "owasp:asi02"]
67
72
  },
68
73
  {
69
- "id": "agent-security-default",
74
+ "id": "agent-security.defaults",
70
75
  "name": "Agent Security",
71
- "description": "Detect and block tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats",
72
- "category": "agent_security",
76
+ "description": "Block tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats.",
77
+ "category": "agent-security",
73
78
  "file": "defaults/agent_security.cedar",
74
79
  "severity": "critical",
75
- "tags": ["tool-poisoning", "rug-pull", "indirect-injection", "mcp-security", "owasp-asi01", "owasp-asi04", "baseline"],
76
- "is_active": true
77
- }
78
- ],
79
- "templates": [
80
+ "tags": ["category:agent-security", "threat:tool-poisoning", "threat:rug-pull", "threat:indirect-injection", "threat:supply-chain", "owasp:asi01", "owasp:asi04"]
81
+ },
80
82
  {
81
- "id": "tools-mcp-allowlist",
83
+ "id": "tools.mcp-server-allowlist",
82
84
  "name": "MCP Server Allowlist",
83
- "description": "Only allow specific MCP servers to be used",
85
+ "description": "Only allow specific MCP servers to be used; customize the allowlist in the permit rule.",
84
86
  "category": "tools",
85
87
  "file": "mcp_server_allowlist.cedar",
86
88
  "severity": "medium",
87
- "tags": ["mcp", "allowlist", "whitelist"]
89
+ "tags": ["category:tools", "scope:org-wide", "posture:deny-default"]
88
90
  },
89
91
  {
90
- "id": "tools-mcp-tool-permissions",
92
+ "id": "tools.mcp-tool-permissions",
91
93
  "name": "MCP Tool Permissions",
92
- "description": "Permit every MCP call_tool by default. Ships two opt-in safety rails (block untrusted/deprecated servers, block unverified servers). Add forbid rules for per-tool or per-server gating.",
94
+ "description": "Permit MCP call_tool by default plus two safety rails (server exclusion list, block unverified servers); add forbid rules for per-tool gating.",
93
95
  "category": "tools",
94
96
  "file": "mcp_tool_permissions.cedar",
95
- "severity": "low",
96
- "tags": ["mcp", "tools", "permit-default", "exclusion"]
97
+ "severity": "critical",
98
+ "tags": ["category:tools", "threat:supply-chain", "posture:permit-default"]
97
99
  },
98
100
  {
99
- "id": "data-pii-redaction",
101
+ "id": "data-protection.pii-redaction",
100
102
  "name": "PII & Secrets Redaction",
101
- "description": "Block requests containing PII or secrets across LLM prompts and MCP tool calls -- prevents data leakage and credential exposure",
102
- "category": "data_protection",
103
+ "description": "Block requests containing PII or secrets across LLM prompts and MCP tool calls.",
104
+ "category": "data-protection",
103
105
  "file": "pii_redaction.cedar",
104
- "severity": "high",
105
- "tags": ["pii", "secrets", "data-protection", "dlp", "owasp-llm06"]
106
+ "severity": "critical",
107
+ "tags": ["category:data-protection", "threat:pii", "threat:secrets", "threat:exfiltration", "owasp:llm06"]
106
108
  },
107
109
  {
108
- "id": "llm-default-allow",
109
- "name": "Default Allow LLM Proxy",
110
- "description": "Permit all LLM chat completion requests by default -- deploy alongside threat-specific forbid policies for a default-allow posture",
110
+ "id": "organization.permit-llm-default",
111
+ "name": "Permit LLM proxy calls",
112
+ "description": "Permit all LLM chat completion requests by default; deploy alongside threat-specific forbids for a permit-default posture.",
111
113
  "category": "organization",
112
114
  "file": "llm_default_allow.cedar",
113
115
  "severity": "low",
114
- "tags": ["llm", "permit-default", "proxy", "organization"]
116
+ "tags": ["category:organization", "surface:process-prompt", "posture:permit-default"]
115
117
  }
116
118
  ]
117
119
  }