@highflame/policy 2.2.37 → 2.2.39
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.
- package/_schemas/agent_ops/templates/templates.json +16 -8
- package/_schemas/ai_gateway/templates/templates.json +12 -6
- package/_schemas/guardrails/templates/templates.json +16 -8
- package/_schemas/sentry/templates/templates.json +12 -6
- package/dist/agent_ops-defaults.gen.d.ts +3 -0
- package/dist/agent_ops-defaults.gen.js +24 -16
- package/dist/ai_gateway-defaults.gen.d.ts +3 -0
- package/dist/ai_gateway-defaults.gen.js +18 -12
- package/dist/category-layers.gen.d.ts +22 -0
- package/dist/category-layers.gen.js +69 -0
- package/dist/engine.d.ts +10 -0
- package/dist/engine.js +25 -1
- package/dist/guardrails-defaults.gen.d.ts +3 -0
- package/dist/guardrails-defaults.gen.js +24 -16
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/overwatch-defaults.gen.d.ts +3 -0
- package/dist/overwatch-defaults.gen.js +24 -16
- package/dist/sentry-defaults.gen.d.ts +3 -0
- package/dist/sentry-defaults.gen.js +18 -12
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/package.json +1 -1
- package/_schemas/mcp_gateway/context.json +0 -655
- package/_schemas/mcp_gateway/schema.cedarschema +0 -342
- package/_schemas/mcp_gateway/templates/defaults/agent_security.cedar +0 -140
- package/_schemas/mcp_gateway/templates/defaults/baseline.cedar +0 -23
- package/_schemas/mcp_gateway/templates/defaults/semantic.cedar +0 -105
- package/_schemas/mcp_gateway/templates/defaults/tools.cedar +0 -92
- package/_schemas/mcp_gateway/templates/mcp_server_allowlist.cedar +0 -33
- package/_schemas/mcp_gateway/templates/mcp_tool_permissions.cedar +0 -77
- package/_schemas/mcp_gateway/templates/templates.json +0 -89
- package/dist/mcp_gateway-context.gen.d.ts +0 -51
- package/dist/mcp_gateway-context.gen.js +0 -52
- package/dist/mcp_gateway-defaults.gen.d.ts +0 -61
- package/dist/mcp_gateway-defaults.gen.js +0 -668
- package/dist/mcp_gateway-entities.gen.d.ts +0 -11
- package/dist/mcp_gateway-entities.gen.js +0 -37
|
@@ -6,42 +6,50 @@
|
|
|
6
6
|
{
|
|
7
7
|
"id": "threat-detection",
|
|
8
8
|
"name": "Threat Detection",
|
|
9
|
-
"description": "Detect and block injection, jailbreak, and adversarial attacks across all agent traffic."
|
|
9
|
+
"description": "Detect and block injection, jailbreak, and adversarial attacks across all agent traffic.",
|
|
10
|
+
"layer": "guardrail"
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
13
|
"id": "data-protection",
|
|
13
14
|
"name": "Data Protection",
|
|
14
|
-
"description": "Prevent secrets, PII, and sensitive data from leaking in prompts, responses, or tool calls."
|
|
15
|
+
"description": "Prevent secrets, PII, and sensitive data from leaking in prompts, responses, or tool calls.",
|
|
16
|
+
"layer": "guardrail"
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
19
|
"id": "agent-security",
|
|
18
20
|
"name": "Agent Security",
|
|
19
|
-
"description": "Guard against tool poisoning, rug-pull attacks, and multi-agent delegation abuse."
|
|
21
|
+
"description": "Guard against tool poisoning, rug-pull attacks, and multi-agent delegation abuse.",
|
|
22
|
+
"layer": "guardrail"
|
|
20
23
|
},
|
|
21
24
|
{
|
|
22
25
|
"id": "tool-permissioning",
|
|
23
26
|
"name": "Tool Permissioning",
|
|
24
|
-
"description": "Allow-list or block-list specific tools, MCP servers, and shell operations by risk tier."
|
|
27
|
+
"description": "Allow-list or block-list specific tools, MCP servers, and shell operations by risk tier.",
|
|
28
|
+
"layer": "access"
|
|
25
29
|
},
|
|
26
30
|
{
|
|
27
31
|
"id": "code-security",
|
|
28
32
|
"name": "Code Security",
|
|
29
|
-
"description": "Enforce safe coding patterns: no exfiltration commands, no destructive write operations."
|
|
33
|
+
"description": "Enforce safe coding patterns: no exfiltration commands, no destructive write operations.",
|
|
34
|
+
"layer": "guardrail"
|
|
30
35
|
},
|
|
31
36
|
{
|
|
32
37
|
"id": "content-safety",
|
|
33
38
|
"name": "Content Safety",
|
|
34
|
-
"description": "Block harmful, toxic, or policy-violating content in agent inputs and outputs."
|
|
39
|
+
"description": "Block harmful, toxic, or policy-violating content in agent inputs and outputs.",
|
|
40
|
+
"layer": "guardrail"
|
|
35
41
|
},
|
|
36
42
|
{
|
|
37
43
|
"id": "organization",
|
|
38
44
|
"name": "Organization",
|
|
39
|
-
"description": "Organization-wide baselines and default permit/deny policies."
|
|
45
|
+
"description": "Organization-wide baselines and default permit/deny policies.",
|
|
46
|
+
"layer": "access"
|
|
40
47
|
},
|
|
41
48
|
{
|
|
42
49
|
"id": "sandbox",
|
|
43
50
|
"name": "Sandbox",
|
|
44
|
-
"description": "Forge sandbox provisioning profiles \u2014 capability ceilings for the OS-layer envelope (writable paths, egress, exec, mechanism toggles, isolation tier)."
|
|
51
|
+
"description": "Forge sandbox provisioning profiles \u2014 capability ceilings for the OS-layer envelope (writable paths, egress, exec, mechanism toggles, isolation tier).",
|
|
52
|
+
"layer": "access"
|
|
45
53
|
}
|
|
46
54
|
],
|
|
47
55
|
"defaults": [
|
|
@@ -6,32 +6,38 @@
|
|
|
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
|
+
"layer": "guardrail"
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
13
|
"id": "tools",
|
|
13
14
|
"name": "Tool Permissioning",
|
|
14
|
-
"description": "Control access to MCP tools, enforce risk scoring, and manage per-tool permissions."
|
|
15
|
+
"description": "Control access to MCP tools, enforce risk scoring, and manage per-tool permissions.",
|
|
16
|
+
"layer": "access"
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
19
|
"id": "agent-security",
|
|
18
20
|
"name": "Agent Security",
|
|
19
|
-
"description": "Detect tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats."
|
|
21
|
+
"description": "Detect tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats.",
|
|
22
|
+
"layer": "guardrail"
|
|
20
23
|
},
|
|
21
24
|
{
|
|
22
25
|
"id": "data-protection",
|
|
23
26
|
"name": "Data Protection",
|
|
24
|
-
"description": "Prevent secrets leakage in LLM chat completions and MCP operations."
|
|
27
|
+
"description": "Prevent secrets leakage in LLM chat completions and MCP operations.",
|
|
28
|
+
"layer": "guardrail"
|
|
25
29
|
},
|
|
26
30
|
{
|
|
27
31
|
"id": "privacy",
|
|
28
32
|
"name": "Privacy",
|
|
29
|
-
"description": "Block personally identifiable information (PII) in LLM prompts and MCP tool calls."
|
|
33
|
+
"description": "Block personally identifiable information (PII) in LLM prompts and MCP tool calls.",
|
|
34
|
+
"layer": "guardrail"
|
|
30
35
|
},
|
|
31
36
|
{
|
|
32
37
|
"id": "organization",
|
|
33
38
|
"name": "Organization",
|
|
34
|
-
"description": "Organization-wide baselines and default permit policies."
|
|
39
|
+
"description": "Organization-wide baselines and default permit policies.",
|
|
40
|
+
"layer": "access"
|
|
35
41
|
}
|
|
36
42
|
],
|
|
37
43
|
"defaults": [
|
|
@@ -6,42 +6,50 @@
|
|
|
6
6
|
{
|
|
7
7
|
"id": "security",
|
|
8
8
|
"name": "Security",
|
|
9
|
-
"description": "Block prompt injection, jailbreak attempts, path traversal, and SQL injection."
|
|
9
|
+
"description": "Block prompt injection, jailbreak attempts, path traversal, and SQL injection.",
|
|
10
|
+
"layer": "guardrail"
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
13
|
"id": "privacy",
|
|
13
14
|
"name": "Privacy",
|
|
14
|
-
"description": "Block personally identifiable information (PII) in prompts and responses."
|
|
15
|
+
"description": "Block personally identifiable information (PII) in prompts and responses.",
|
|
16
|
+
"layer": "guardrail"
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
19
|
"id": "data-protection",
|
|
18
20
|
"name": "Data Protection",
|
|
19
|
-
"description": "Block secrets, API keys, tokens, and bulk credential exposure."
|
|
21
|
+
"description": "Block secrets, API keys, tokens, and bulk credential exposure.",
|
|
22
|
+
"layer": "guardrail"
|
|
20
23
|
},
|
|
21
24
|
{
|
|
22
25
|
"id": "trust-safety",
|
|
23
26
|
"name": "Trust & Safety",
|
|
24
|
-
"description": "Block toxic, violent, hateful, sexual, or profane content; restrict regulated topics."
|
|
27
|
+
"description": "Block toxic, violent, hateful, sexual, or profane content; restrict regulated topics.",
|
|
28
|
+
"layer": "guardrail"
|
|
25
29
|
},
|
|
26
30
|
{
|
|
27
31
|
"id": "tools",
|
|
28
32
|
"name": "Tools",
|
|
29
|
-
"description": "Per-tool MCP access control, org-wide server exclusions, unverified server blocks."
|
|
33
|
+
"description": "Per-tool MCP access control, org-wide server exclusions, unverified server blocks.",
|
|
34
|
+
"layer": "access"
|
|
30
35
|
},
|
|
31
36
|
{
|
|
32
37
|
"id": "agent-security",
|
|
33
38
|
"name": "Agent Security",
|
|
34
|
-
"description": "Block tool abuse, exfiltration patterns, loops, budget violations, tool poisoning, rug pull, and risky MCP configs."
|
|
39
|
+
"description": "Block tool abuse, exfiltration patterns, loops, budget violations, tool poisoning, rug pull, and risky MCP configs.",
|
|
40
|
+
"layer": "guardrail"
|
|
35
41
|
},
|
|
36
42
|
{
|
|
37
43
|
"id": "agent-identity",
|
|
38
44
|
"name": "Agent Identity",
|
|
39
|
-
"description": "Trust-based access control for AI agents — tiered permissions by trust level, autonomous agent restrictions, cross-turn session lockdowns."
|
|
45
|
+
"description": "Trust-based access control for AI agents — tiered permissions by trust level, autonomous agent restrictions, cross-turn session lockdowns.",
|
|
46
|
+
"layer": "guardrail"
|
|
40
47
|
},
|
|
41
48
|
{
|
|
42
49
|
"id": "organization",
|
|
43
50
|
"name": "Organization",
|
|
44
|
-
"description": "Organization-wide baselines and default permit/deny policies."
|
|
51
|
+
"description": "Organization-wide baselines and default permit/deny policies.",
|
|
52
|
+
"layer": "access"
|
|
45
53
|
}
|
|
46
54
|
],
|
|
47
55
|
"defaults": [
|
|
@@ -6,32 +6,38 @@
|
|
|
6
6
|
{
|
|
7
7
|
"id": "data-protection",
|
|
8
8
|
"name": "Secrets & Data Protection",
|
|
9
|
-
"description": "Block secrets, API keys, tokens, and credentials in messages and uploads."
|
|
9
|
+
"description": "Block secrets, API keys, tokens, and credentials in messages and uploads.",
|
|
10
|
+
"layer": "guardrail"
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
13
|
"id": "privacy",
|
|
13
14
|
"name": "PII Detection",
|
|
14
|
-
"description": "Block personally identifiable information across messages and uploads."
|
|
15
|
+
"description": "Block personally identifiable information across messages and uploads.",
|
|
16
|
+
"layer": "guardrail"
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
19
|
"id": "semantic",
|
|
18
20
|
"name": "Semantic Threat Detection",
|
|
19
|
-
"description": "Block prompt injection, jailbreak attempts, and high-severity threats."
|
|
21
|
+
"description": "Block prompt injection, jailbreak attempts, and high-severity threats.",
|
|
22
|
+
"layer": "guardrail"
|
|
20
23
|
},
|
|
21
24
|
{
|
|
22
25
|
"id": "trust-safety",
|
|
23
26
|
"name": "Content Safety",
|
|
24
|
-
"description": "Block violent, harmful, hateful, sexual, or profane content."
|
|
27
|
+
"description": "Block violent, harmful, hateful, sexual, or profane content.",
|
|
28
|
+
"layer": "guardrail"
|
|
25
29
|
},
|
|
26
30
|
{
|
|
27
31
|
"id": "clipboard",
|
|
28
32
|
"name": "Clipboard Policy",
|
|
29
|
-
"description": "Control paste operations into AI chat services."
|
|
33
|
+
"description": "Control paste operations into AI chat services.",
|
|
34
|
+
"layer": "guardrail"
|
|
30
35
|
},
|
|
31
36
|
{
|
|
32
37
|
"id": "organization",
|
|
33
38
|
"name": "Organization Rules",
|
|
34
|
-
"description": "Organization-wide baselines and session-aware threat escalation."
|
|
39
|
+
"description": "Organization-wide baselines and session-aware threat escalation.",
|
|
40
|
+
"layer": "access"
|
|
35
41
|
}
|
|
36
42
|
],
|
|
37
43
|
"defaults": [
|
|
@@ -10,6 +10,9 @@ export interface AgentOpsCategoryInfo {
|
|
|
10
10
|
id: AgentOpsCategory;
|
|
11
11
|
name: string;
|
|
12
12
|
description: string;
|
|
13
|
+
/** Control layer: 'access' governs whether an action is permitted at
|
|
14
|
+
* all; 'guardrail' governs whether a given request should pass. */
|
|
15
|
+
layer: 'access' | 'guardrail';
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* A default policy that is auto-created for new projects.
|
|
@@ -4546,14 +4546,14 @@ when {
|
|
|
4546
4546
|
// CATEGORIES
|
|
4547
4547
|
// =============================================================================
|
|
4548
4548
|
export const AGENT_OPS_CATEGORIES = [
|
|
4549
|
-
{ id: 'threat-detection', name: 'Threat Detection', description: 'Detect and block injection, jailbreak, and adversarial attacks across all agent traffic.' },
|
|
4550
|
-
{ id: 'data-protection', name: 'Data Protection', description: 'Prevent secrets, PII, and sensitive data from leaking in prompts, responses, or tool calls.' },
|
|
4551
|
-
{ id: 'agent-security', name: 'Agent Security', description: 'Guard against tool poisoning, rug-pull attacks, and multi-agent delegation abuse.' },
|
|
4552
|
-
{ id: 'tool-permissioning', name: 'Tool Permissioning', description: 'Allow-list or block-list specific tools, MCP servers, and shell operations by risk tier.' },
|
|
4553
|
-
{ id: 'code-security', name: 'Code Security', description: 'Enforce safe coding patterns: no exfiltration commands, no destructive write operations.' },
|
|
4554
|
-
{ id: 'content-safety', name: 'Content Safety', description: 'Block harmful, toxic, or policy-violating content in agent inputs and outputs.' },
|
|
4555
|
-
{ id: 'organization', name: 'Organization', description: 'Organization-wide baselines and default permit/deny policies.' },
|
|
4556
|
-
{ id: 'sandbox', name: 'Sandbox', description: 'Forge sandbox provisioning profiles — capability ceilings for the OS-layer envelope (writable paths, egress, exec, mechanism toggles, isolation tier).' },
|
|
4549
|
+
{ id: 'threat-detection', name: 'Threat Detection', description: 'Detect and block injection, jailbreak, and adversarial attacks across all agent traffic.', layer: 'guardrail' },
|
|
4550
|
+
{ id: 'data-protection', name: 'Data Protection', description: 'Prevent secrets, PII, and sensitive data from leaking in prompts, responses, or tool calls.', layer: 'guardrail' },
|
|
4551
|
+
{ id: 'agent-security', name: 'Agent Security', description: 'Guard against tool poisoning, rug-pull attacks, and multi-agent delegation abuse.', layer: 'guardrail' },
|
|
4552
|
+
{ id: 'tool-permissioning', name: 'Tool Permissioning', description: 'Allow-list or block-list specific tools, MCP servers, and shell operations by risk tier.', layer: 'access' },
|
|
4553
|
+
{ id: 'code-security', name: 'Code Security', description: 'Enforce safe coding patterns: no exfiltration commands, no destructive write operations.', layer: 'guardrail' },
|
|
4554
|
+
{ id: 'content-safety', name: 'Content Safety', description: 'Block harmful, toxic, or policy-violating content in agent inputs and outputs.', layer: 'guardrail' },
|
|
4555
|
+
{ id: 'organization', name: 'Organization', description: 'Organization-wide baselines and default permit/deny policies.', layer: 'access' },
|
|
4556
|
+
{ id: 'sandbox', name: 'Sandbox', description: 'Forge sandbox provisioning profiles — capability ceilings for the OS-layer envelope (writable paths, egress, exec, mechanism toggles, isolation tier).', layer: 'access' },
|
|
4557
4557
|
];
|
|
4558
4558
|
// =============================================================================
|
|
4559
4559
|
// DEFAULT POLICIES
|
|
@@ -5011,42 +5011,50 @@ export const AGENT_OPS_TEMPLATES_JSON = `{
|
|
|
5011
5011
|
{
|
|
5012
5012
|
"id": "threat-detection",
|
|
5013
5013
|
"name": "Threat Detection",
|
|
5014
|
-
"description": "Detect and block injection, jailbreak, and adversarial attacks across all agent traffic."
|
|
5014
|
+
"description": "Detect and block injection, jailbreak, and adversarial attacks across all agent traffic.",
|
|
5015
|
+
"layer": "guardrail"
|
|
5015
5016
|
},
|
|
5016
5017
|
{
|
|
5017
5018
|
"id": "data-protection",
|
|
5018
5019
|
"name": "Data Protection",
|
|
5019
|
-
"description": "Prevent secrets, PII, and sensitive data from leaking in prompts, responses, or tool calls."
|
|
5020
|
+
"description": "Prevent secrets, PII, and sensitive data from leaking in prompts, responses, or tool calls.",
|
|
5021
|
+
"layer": "guardrail"
|
|
5020
5022
|
},
|
|
5021
5023
|
{
|
|
5022
5024
|
"id": "agent-security",
|
|
5023
5025
|
"name": "Agent Security",
|
|
5024
|
-
"description": "Guard against tool poisoning, rug-pull attacks, and multi-agent delegation abuse."
|
|
5026
|
+
"description": "Guard against tool poisoning, rug-pull attacks, and multi-agent delegation abuse.",
|
|
5027
|
+
"layer": "guardrail"
|
|
5025
5028
|
},
|
|
5026
5029
|
{
|
|
5027
5030
|
"id": "tool-permissioning",
|
|
5028
5031
|
"name": "Tool Permissioning",
|
|
5029
|
-
"description": "Allow-list or block-list specific tools, MCP servers, and shell operations by risk tier."
|
|
5032
|
+
"description": "Allow-list or block-list specific tools, MCP servers, and shell operations by risk tier.",
|
|
5033
|
+
"layer": "access"
|
|
5030
5034
|
},
|
|
5031
5035
|
{
|
|
5032
5036
|
"id": "code-security",
|
|
5033
5037
|
"name": "Code Security",
|
|
5034
|
-
"description": "Enforce safe coding patterns: no exfiltration commands, no destructive write operations."
|
|
5038
|
+
"description": "Enforce safe coding patterns: no exfiltration commands, no destructive write operations.",
|
|
5039
|
+
"layer": "guardrail"
|
|
5035
5040
|
},
|
|
5036
5041
|
{
|
|
5037
5042
|
"id": "content-safety",
|
|
5038
5043
|
"name": "Content Safety",
|
|
5039
|
-
"description": "Block harmful, toxic, or policy-violating content in agent inputs and outputs."
|
|
5044
|
+
"description": "Block harmful, toxic, or policy-violating content in agent inputs and outputs.",
|
|
5045
|
+
"layer": "guardrail"
|
|
5040
5046
|
},
|
|
5041
5047
|
{
|
|
5042
5048
|
"id": "organization",
|
|
5043
5049
|
"name": "Organization",
|
|
5044
|
-
"description": "Organization-wide baselines and default permit/deny policies."
|
|
5050
|
+
"description": "Organization-wide baselines and default permit/deny policies.",
|
|
5051
|
+
"layer": "access"
|
|
5045
5052
|
},
|
|
5046
5053
|
{
|
|
5047
5054
|
"id": "sandbox",
|
|
5048
5055
|
"name": "Sandbox",
|
|
5049
|
-
"description": "Forge sandbox provisioning profiles \\u2014 capability ceilings for the OS-layer envelope (writable paths, egress, exec, mechanism toggles, isolation tier)."
|
|
5056
|
+
"description": "Forge sandbox provisioning profiles \\u2014 capability ceilings for the OS-layer envelope (writable paths, egress, exec, mechanism toggles, isolation tier).",
|
|
5057
|
+
"layer": "access"
|
|
5050
5058
|
}
|
|
5051
5059
|
],
|
|
5052
5060
|
"defaults": [
|
|
@@ -10,6 +10,9 @@ export interface AiGatewayCategoryInfo {
|
|
|
10
10
|
id: AiGatewayCategory;
|
|
11
11
|
name: string;
|
|
12
12
|
description: string;
|
|
13
|
+
/** Control layer: 'access' governs whether an action is permitted at
|
|
14
|
+
* all; 'guardrail' governs whether a given request should pass. */
|
|
15
|
+
layer: 'access' | 'guardrail';
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* A default policy that is auto-created for new projects.
|
|
@@ -1275,12 +1275,12 @@ when {
|
|
|
1275
1275
|
// CATEGORIES
|
|
1276
1276
|
// =============================================================================
|
|
1277
1277
|
export const AI_GATEWAY_CATEGORIES = [
|
|
1278
|
-
{ id: 'semantic', name: 'Semantic Threat Detection', description: 'Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats.' },
|
|
1279
|
-
{ id: 'tools', name: 'Tool Permissioning', description: 'Control access to MCP tools, enforce risk scoring, and manage per-tool permissions.' },
|
|
1280
|
-
{ id: 'agent-security', name: 'Agent Security', description: 'Detect tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats.' },
|
|
1281
|
-
{ id: 'data-protection', name: 'Data Protection', description: 'Prevent secrets leakage in LLM chat completions and MCP operations.' },
|
|
1282
|
-
{ id: 'privacy', name: 'Privacy', description: 'Block personally identifiable information (PII) in LLM prompts and MCP tool calls.' },
|
|
1283
|
-
{ id: 'organization', name: 'Organization', description: 'Organization-wide baselines and default permit policies.' },
|
|
1278
|
+
{ id: 'semantic', name: 'Semantic Threat Detection', description: 'Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats.', layer: 'guardrail' },
|
|
1279
|
+
{ id: 'tools', name: 'Tool Permissioning', description: 'Control access to MCP tools, enforce risk scoring, and manage per-tool permissions.', layer: 'access' },
|
|
1280
|
+
{ id: 'agent-security', name: 'Agent Security', description: 'Detect tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats.', layer: 'guardrail' },
|
|
1281
|
+
{ id: 'data-protection', name: 'Data Protection', description: 'Prevent secrets leakage in LLM chat completions and MCP operations.', layer: 'guardrail' },
|
|
1282
|
+
{ id: 'privacy', name: 'Privacy', description: 'Block personally identifiable information (PII) in LLM prompts and MCP tool calls.', layer: 'guardrail' },
|
|
1283
|
+
{ id: 'organization', name: 'Organization', description: 'Organization-wide baselines and default permit policies.', layer: 'access' },
|
|
1284
1284
|
];
|
|
1285
1285
|
// =============================================================================
|
|
1286
1286
|
// DEFAULT POLICIES
|
|
@@ -1414,32 +1414,38 @@ export const AI_GATEWAY_TEMPLATES_JSON = `{
|
|
|
1414
1414
|
{
|
|
1415
1415
|
"id": "semantic",
|
|
1416
1416
|
"name": "Semantic Threat Detection",
|
|
1417
|
-
"description": "Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats."
|
|
1417
|
+
"description": "Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats.",
|
|
1418
|
+
"layer": "guardrail"
|
|
1418
1419
|
},
|
|
1419
1420
|
{
|
|
1420
1421
|
"id": "tools",
|
|
1421
1422
|
"name": "Tool Permissioning",
|
|
1422
|
-
"description": "Control access to MCP tools, enforce risk scoring, and manage per-tool permissions."
|
|
1423
|
+
"description": "Control access to MCP tools, enforce risk scoring, and manage per-tool permissions.",
|
|
1424
|
+
"layer": "access"
|
|
1423
1425
|
},
|
|
1424
1426
|
{
|
|
1425
1427
|
"id": "agent-security",
|
|
1426
1428
|
"name": "Agent Security",
|
|
1427
|
-
"description": "Detect tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats."
|
|
1429
|
+
"description": "Detect tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats.",
|
|
1430
|
+
"layer": "guardrail"
|
|
1428
1431
|
},
|
|
1429
1432
|
{
|
|
1430
1433
|
"id": "data-protection",
|
|
1431
1434
|
"name": "Data Protection",
|
|
1432
|
-
"description": "Prevent secrets leakage in LLM chat completions and MCP operations."
|
|
1435
|
+
"description": "Prevent secrets leakage in LLM chat completions and MCP operations.",
|
|
1436
|
+
"layer": "guardrail"
|
|
1433
1437
|
},
|
|
1434
1438
|
{
|
|
1435
1439
|
"id": "privacy",
|
|
1436
1440
|
"name": "Privacy",
|
|
1437
|
-
"description": "Block personally identifiable information (PII) in LLM prompts and MCP tool calls."
|
|
1441
|
+
"description": "Block personally identifiable information (PII) in LLM prompts and MCP tool calls.",
|
|
1442
|
+
"layer": "guardrail"
|
|
1438
1443
|
},
|
|
1439
1444
|
{
|
|
1440
1445
|
"id": "organization",
|
|
1441
1446
|
"name": "Organization",
|
|
1442
|
-
"description": "Organization-wide baselines and default permit policies."
|
|
1447
|
+
"description": "Organization-wide baselines and default permit policies.",
|
|
1448
|
+
"layer": "access"
|
|
1443
1449
|
}
|
|
1444
1450
|
],
|
|
1445
1451
|
"defaults": [
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A policy's control layer.
|
|
3
|
+
*
|
|
4
|
+
* `access` — may this agent take this action at all?
|
|
5
|
+
* `guardrail` — should this particular request go through?
|
|
6
|
+
*/
|
|
7
|
+
export type PolicyLayer = 'access' | 'guardrail';
|
|
8
|
+
/**
|
|
9
|
+
* Resolve a policy or template category to its control layer.
|
|
10
|
+
*
|
|
11
|
+
* Normalizes separators, case and surrounding whitespace before looking
|
|
12
|
+
* up: the catalogues are kebab-case, but stored policy categories are
|
|
13
|
+
* not uniformly so, and an unnormalized lookup silently misses them.
|
|
14
|
+
*
|
|
15
|
+
* Returns `undefined` for a slug this package does not classify, so a
|
|
16
|
+
* caller renders nothing rather than a guessed layer.
|
|
17
|
+
*/
|
|
18
|
+
export declare function layerForCategory(category: string | null | undefined): PolicyLayer | undefined;
|
|
19
|
+
/** Every slug this package classifies, canonical first. */
|
|
20
|
+
export declare function knownCategorySlugs(): string[];
|
|
21
|
+
/** True when the slug resolves only because it is a retired alias. */
|
|
22
|
+
export declare function isRetiredCategory(category: string | null | undefined): boolean;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Code generated by highflame-policy-codegen. DO NOT EDIT.
|
|
2
|
+
// Source: `layer` on each category in schemas/*/templates/templates.json,
|
|
3
|
+
// plus RETIRED_CATEGORY_LAYERS in codegen/src/lib.rs
|
|
4
|
+
//
|
|
5
|
+
// The single source for "which control layer does this policy category
|
|
6
|
+
// belong to?". Consumers must call layerForCategory rather than keeping a
|
|
7
|
+
// private slug->layer table: this taxonomy is derived from the Cedar rule
|
|
8
|
+
// heads in each template (only categories that grant are Access), and a
|
|
9
|
+
// hand-maintained copy drifts the moment a category is added upstream.
|
|
10
|
+
/** Layer for every category the catalogues currently define. */
|
|
11
|
+
const CANONICAL = {
|
|
12
|
+
"agent-identity": 'guardrail',
|
|
13
|
+
"agent-security": 'guardrail',
|
|
14
|
+
"clipboard": 'guardrail',
|
|
15
|
+
"code-security": 'guardrail',
|
|
16
|
+
"content-safety": 'guardrail',
|
|
17
|
+
"data-protection": 'guardrail',
|
|
18
|
+
"organization": 'access',
|
|
19
|
+
"privacy": 'guardrail',
|
|
20
|
+
"sandbox": 'access',
|
|
21
|
+
"security": 'guardrail',
|
|
22
|
+
"semantic": 'guardrail',
|
|
23
|
+
"threat-detection": 'guardrail',
|
|
24
|
+
"tool-permissioning": 'access',
|
|
25
|
+
"tools": 'access',
|
|
26
|
+
"trust-safety": 'guardrail',
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Layer for slugs no catalogue defines any more but which still tag live
|
|
30
|
+
* policies. Kept separate from CANONICAL so the canonical set stays
|
|
31
|
+
* exactly what the catalogues declare, and consulted second so that
|
|
32
|
+
* reviving a retired name upstream takes effect rather than being
|
|
33
|
+
* shadowed here.
|
|
34
|
+
*/
|
|
35
|
+
const RETIRED = {
|
|
36
|
+
"agentic-security": 'guardrail', // superseded by agent-security
|
|
37
|
+
"secrets": 'guardrail', // superseded by data-protection
|
|
38
|
+
"pii": 'guardrail', // superseded by privacy
|
|
39
|
+
"pii-types": 'guardrail', // superseded by privacy
|
|
40
|
+
"keyword-filter": 'guardrail', // superseded by content-safety
|
|
41
|
+
"file-safety": 'guardrail', // superseded by content-safety
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Resolve a policy or template category to its control layer.
|
|
45
|
+
*
|
|
46
|
+
* Normalizes separators, case and surrounding whitespace before looking
|
|
47
|
+
* up: the catalogues are kebab-case, but stored policy categories are
|
|
48
|
+
* not uniformly so, and an unnormalized lookup silently misses them.
|
|
49
|
+
*
|
|
50
|
+
* Returns `undefined` for a slug this package does not classify, so a
|
|
51
|
+
* caller renders nothing rather than a guessed layer.
|
|
52
|
+
*/
|
|
53
|
+
export function layerForCategory(category) {
|
|
54
|
+
if (!category)
|
|
55
|
+
return undefined;
|
|
56
|
+
const slug = category.trim().toLowerCase().replace(/_/g, '-');
|
|
57
|
+
return CANONICAL[slug] ?? RETIRED[slug];
|
|
58
|
+
}
|
|
59
|
+
/** Every slug this package classifies, canonical first. */
|
|
60
|
+
export function knownCategorySlugs() {
|
|
61
|
+
return [...Object.keys(CANONICAL), ...Object.keys(RETIRED)];
|
|
62
|
+
}
|
|
63
|
+
/** True when the slug resolves only because it is a retired alias. */
|
|
64
|
+
export function isRetiredCategory(category) {
|
|
65
|
+
if (!category)
|
|
66
|
+
return false;
|
|
67
|
+
const slug = category.trim().toLowerCase().replace(/_/g, '-');
|
|
68
|
+
return !(slug in CANONICAL) && slug in RETIRED;
|
|
69
|
+
}
|
package/dist/engine.d.ts
CHANGED
|
@@ -80,6 +80,16 @@ export interface EvaluateRequest {
|
|
|
80
80
|
resource: EntityUID;
|
|
81
81
|
context?: Record<string, unknown>;
|
|
82
82
|
entities?: Entity[];
|
|
83
|
+
/**
|
|
84
|
+
* Narrows evaluation to the policies this predicate accepts, keyed by policy
|
|
85
|
+
* id. Cedar evaluates everything it is handed, so selecting the relevant
|
|
86
|
+
* subset is the caller's job.
|
|
87
|
+
*
|
|
88
|
+
* Omit to evaluate everything. That is also the correct fallback when a
|
|
89
|
+
* caller cannot resolve a subset: a predicate matching nothing leaves Cedar
|
|
90
|
+
* with no policies, and Cedar is default-deny.
|
|
91
|
+
*/
|
|
92
|
+
policyFilter?: (policyId: string) => boolean;
|
|
83
93
|
}
|
|
84
94
|
/**
|
|
85
95
|
* PolicyEngine wraps cedar-wasm with Highflame schema types.
|
package/dist/engine.js
CHANGED
|
@@ -186,6 +186,30 @@ function extractPolicies(policyText) {
|
|
|
186
186
|
}
|
|
187
187
|
return { policySet: policyMap, annotations: annotationsMap };
|
|
188
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Narrow a policy set to the ids `keep` accepts. Returns the set unchanged when
|
|
191
|
+
* no predicate is given, so the unfiltered path is untouched.
|
|
192
|
+
*
|
|
193
|
+
* Throws on a string-form set, which cannot be split by id. Returning it whole
|
|
194
|
+
* would silently evaluate every policy while the caller believed it had asked
|
|
195
|
+
* for a subset — the one behaviour the filter contract must never have.
|
|
196
|
+
*/
|
|
197
|
+
function filterPolicySet(set, keep) {
|
|
198
|
+
if (!keep) {
|
|
199
|
+
return set;
|
|
200
|
+
}
|
|
201
|
+
if (typeof set === "string") {
|
|
202
|
+
throw new Error("policyFilter cannot be applied: policies are loaded in string form, " +
|
|
203
|
+
"which has no per-policy ids. Load via loadPoliciesWithIds().");
|
|
204
|
+
}
|
|
205
|
+
const out = {};
|
|
206
|
+
for (const [id, policy] of Object.entries(set)) {
|
|
207
|
+
if (keep(id)) {
|
|
208
|
+
out[id] = policy;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return out;
|
|
212
|
+
}
|
|
189
213
|
/**
|
|
190
214
|
* PolicyEngine wraps cedar-wasm with Highflame schema types.
|
|
191
215
|
*/
|
|
@@ -346,7 +370,7 @@ export class PolicyEngine {
|
|
|
346
370
|
action,
|
|
347
371
|
resource,
|
|
348
372
|
context,
|
|
349
|
-
policies: { staticPolicies: this.policySet },
|
|
373
|
+
policies: { staticPolicies: filterPolicySet(this.policySet, req.policyFilter) },
|
|
350
374
|
entities,
|
|
351
375
|
};
|
|
352
376
|
// Add schema if available
|
|
@@ -10,6 +10,9 @@ export interface GuardrailsCategoryInfo {
|
|
|
10
10
|
id: GuardrailsCategory;
|
|
11
11
|
name: string;
|
|
12
12
|
description: string;
|
|
13
|
+
/** Control layer: 'access' governs whether an action is permitted at
|
|
14
|
+
* all; 'guardrail' governs whether a given request should pass. */
|
|
15
|
+
layer: 'access' | 'guardrail';
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* A default policy that is auto-created for new projects.
|
|
@@ -3455,14 +3455,14 @@ when {
|
|
|
3455
3455
|
// CATEGORIES
|
|
3456
3456
|
// =============================================================================
|
|
3457
3457
|
export const GUARDRAILS_CATEGORIES = [
|
|
3458
|
-
{ id: 'security', name: 'Security', description: 'Block prompt injection, jailbreak attempts, path traversal, and SQL injection.' },
|
|
3459
|
-
{ id: 'privacy', name: 'Privacy', description: 'Block personally identifiable information (PII) in prompts and responses.' },
|
|
3460
|
-
{ id: 'data-protection', name: 'Data Protection', description: 'Block secrets, API keys, tokens, and bulk credential exposure.' },
|
|
3461
|
-
{ id: 'trust-safety', name: 'Trust & Safety', description: 'Block toxic, violent, hateful, sexual, or profane content; restrict regulated topics.' },
|
|
3462
|
-
{ id: 'tools', name: 'Tools', description: 'Per-tool MCP access control, org-wide server exclusions, unverified server blocks.' },
|
|
3463
|
-
{ id: 'agent-security', name: 'Agent Security', description: 'Block tool abuse, exfiltration patterns, loops, budget violations, tool poisoning, rug pull, and risky MCP configs.' },
|
|
3464
|
-
{ id: 'agent-identity', name: 'Agent Identity', description: 'Trust-based access control for AI agents — tiered permissions by trust level, autonomous agent restrictions, cross-turn session lockdowns.' },
|
|
3465
|
-
{ id: 'organization', name: 'Organization', description: 'Organization-wide baselines and default permit/deny policies.' },
|
|
3458
|
+
{ id: 'security', name: 'Security', description: 'Block prompt injection, jailbreak attempts, path traversal, and SQL injection.', layer: 'guardrail' },
|
|
3459
|
+
{ id: 'privacy', name: 'Privacy', description: 'Block personally identifiable information (PII) in prompts and responses.', layer: 'guardrail' },
|
|
3460
|
+
{ id: 'data-protection', name: 'Data Protection', description: 'Block secrets, API keys, tokens, and bulk credential exposure.', layer: 'guardrail' },
|
|
3461
|
+
{ id: 'trust-safety', name: 'Trust & Safety', description: 'Block toxic, violent, hateful, sexual, or profane content; restrict regulated topics.', layer: 'guardrail' },
|
|
3462
|
+
{ id: 'tools', name: 'Tools', description: 'Per-tool MCP access control, org-wide server exclusions, unverified server blocks.', layer: 'access' },
|
|
3463
|
+
{ id: 'agent-security', name: 'Agent Security', description: 'Block tool abuse, exfiltration patterns, loops, budget violations, tool poisoning, rug pull, and risky MCP configs.', layer: 'guardrail' },
|
|
3464
|
+
{ id: 'agent-identity', name: 'Agent Identity', description: 'Trust-based access control for AI agents — tiered permissions by trust level, autonomous agent restrictions, cross-turn session lockdowns.', layer: 'guardrail' },
|
|
3465
|
+
{ id: 'organization', name: 'Organization', description: 'Organization-wide baselines and default permit/deny policies.', layer: 'access' },
|
|
3466
3466
|
];
|
|
3467
3467
|
// =============================================================================
|
|
3468
3468
|
// DEFAULT POLICIES
|
|
@@ -3803,42 +3803,50 @@ export const GUARDRAILS_TEMPLATES_JSON = `{
|
|
|
3803
3803
|
{
|
|
3804
3804
|
"id": "security",
|
|
3805
3805
|
"name": "Security",
|
|
3806
|
-
"description": "Block prompt injection, jailbreak attempts, path traversal, and SQL injection."
|
|
3806
|
+
"description": "Block prompt injection, jailbreak attempts, path traversal, and SQL injection.",
|
|
3807
|
+
"layer": "guardrail"
|
|
3807
3808
|
},
|
|
3808
3809
|
{
|
|
3809
3810
|
"id": "privacy",
|
|
3810
3811
|
"name": "Privacy",
|
|
3811
|
-
"description": "Block personally identifiable information (PII) in prompts and responses."
|
|
3812
|
+
"description": "Block personally identifiable information (PII) in prompts and responses.",
|
|
3813
|
+
"layer": "guardrail"
|
|
3812
3814
|
},
|
|
3813
3815
|
{
|
|
3814
3816
|
"id": "data-protection",
|
|
3815
3817
|
"name": "Data Protection",
|
|
3816
|
-
"description": "Block secrets, API keys, tokens, and bulk credential exposure."
|
|
3818
|
+
"description": "Block secrets, API keys, tokens, and bulk credential exposure.",
|
|
3819
|
+
"layer": "guardrail"
|
|
3817
3820
|
},
|
|
3818
3821
|
{
|
|
3819
3822
|
"id": "trust-safety",
|
|
3820
3823
|
"name": "Trust & Safety",
|
|
3821
|
-
"description": "Block toxic, violent, hateful, sexual, or profane content; restrict regulated topics."
|
|
3824
|
+
"description": "Block toxic, violent, hateful, sexual, or profane content; restrict regulated topics.",
|
|
3825
|
+
"layer": "guardrail"
|
|
3822
3826
|
},
|
|
3823
3827
|
{
|
|
3824
3828
|
"id": "tools",
|
|
3825
3829
|
"name": "Tools",
|
|
3826
|
-
"description": "Per-tool MCP access control, org-wide server exclusions, unverified server blocks."
|
|
3830
|
+
"description": "Per-tool MCP access control, org-wide server exclusions, unverified server blocks.",
|
|
3831
|
+
"layer": "access"
|
|
3827
3832
|
},
|
|
3828
3833
|
{
|
|
3829
3834
|
"id": "agent-security",
|
|
3830
3835
|
"name": "Agent Security",
|
|
3831
|
-
"description": "Block tool abuse, exfiltration patterns, loops, budget violations, tool poisoning, rug pull, and risky MCP configs."
|
|
3836
|
+
"description": "Block tool abuse, exfiltration patterns, loops, budget violations, tool poisoning, rug pull, and risky MCP configs.",
|
|
3837
|
+
"layer": "guardrail"
|
|
3832
3838
|
},
|
|
3833
3839
|
{
|
|
3834
3840
|
"id": "agent-identity",
|
|
3835
3841
|
"name": "Agent Identity",
|
|
3836
|
-
"description": "Trust-based access control for AI agents — tiered permissions by trust level, autonomous agent restrictions, cross-turn session lockdowns."
|
|
3842
|
+
"description": "Trust-based access control for AI agents — tiered permissions by trust level, autonomous agent restrictions, cross-turn session lockdowns.",
|
|
3843
|
+
"layer": "guardrail"
|
|
3837
3844
|
},
|
|
3838
3845
|
{
|
|
3839
3846
|
"id": "organization",
|
|
3840
3847
|
"name": "Organization",
|
|
3841
|
-
"description": "Organization-wide baselines and default permit/deny policies."
|
|
3848
|
+
"description": "Organization-wide baselines and default permit/deny policies.",
|
|
3849
|
+
"layer": "access"
|
|
3842
3850
|
}
|
|
3843
3851
|
],
|
|
3844
3852
|
"defaults": [
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './entities.gen.js';
|
|
|
2
2
|
export * from './actions.gen.js';
|
|
3
3
|
export * from './context.gen.js';
|
|
4
4
|
export * from './schema.gen.js';
|
|
5
|
+
export * from './category-layers.gen.js';
|
|
5
6
|
export * from './decision-effects.gen.js';
|
|
6
7
|
export * from './aarm-annotations.gen.js';
|
|
7
8
|
export * from './aarm-annotation.js';
|