@highflame/policy 2.2.38 → 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.
@@ -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
+ }
@@ -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';
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ export * from './context.gen.js';
9
9
  export * from './schema.gen.js';
10
10
  // Canonical decision-effect vocabulary (AARM R4 Wave A). Always emitted —
11
11
  // source is ALLOWED_DECISION_EFFECTS in codegen/src/lib.rs, not annotations.json.
12
+ export * from './category-layers.gen.js';
12
13
  export * from './decision-effects.gen.js';
13
14
  // AARM-aware annotation registry (typed Cedar annotation vocabulary
14
15
  // Shield interprets at decision time; Studio/Admin use for lint).
@@ -10,6 +10,9 @@ export interface OverwatchCategoryInfo {
10
10
  id: OverwatchCategory;
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.
@@ -1823,14 +1823,14 @@ when {
1823
1823
  // CATEGORIES
1824
1824
  // =============================================================================
1825
1825
  export const OVERWATCH_CATEGORIES = [
1826
- { id: 'data-protection', name: 'Secrets & Data Protection', description: 'Block credential leakage and protect sensitive file paths.' },
1827
- { id: 'privacy', name: 'PII Detection', description: 'Block personally identifiable information across prompts, tool calls, and file operations.' },
1828
- { id: 'semantic', name: 'Semantic Threat Detection', description: 'Block injection attacks (SQL, path traversal, encoded), prompt injection, and jailbreak attempts.' },
1829
- { id: 'trust-safety', name: 'Content Safety', description: 'Block violent, hateful, sexual, criminal, or excessively profane content.' },
1830
- { id: 'tools', name: 'Tool Permissioning', description: 'Control shell execution, file operations, MCP servers, and sensitive system paths.' },
1831
- { id: 'agent-identity', name: 'Agent-Specific Guardrails', description: 'Per-agent security policies applied based on agent identity.' },
1832
- { id: 'agent-security', name: 'Agent Security', description: 'Block supply-chain attacks, malicious package installs, and code-agent-specific threats.' },
1833
- { id: 'organization', name: 'Organization', description: 'Organization-wide baselines, audit, and project-scoped permissions.' },
1826
+ { id: 'data-protection', name: 'Secrets & Data Protection', description: 'Block credential leakage and protect sensitive file paths.', layer: 'guardrail' },
1827
+ { id: 'privacy', name: 'PII Detection', description: 'Block personally identifiable information across prompts, tool calls, and file operations.', layer: 'guardrail' },
1828
+ { id: 'semantic', name: 'Semantic Threat Detection', description: 'Block injection attacks (SQL, path traversal, encoded), prompt injection, and jailbreak attempts.', layer: 'guardrail' },
1829
+ { id: 'trust-safety', name: 'Content Safety', description: 'Block violent, hateful, sexual, criminal, or excessively profane content.', layer: 'guardrail' },
1830
+ { id: 'tools', name: 'Tool Permissioning', description: 'Control shell execution, file operations, MCP servers, and sensitive system paths.', layer: 'access' },
1831
+ { id: 'agent-identity', name: 'Agent-Specific Guardrails', description: 'Per-agent security policies applied based on agent identity.', layer: 'guardrail' },
1832
+ { id: 'agent-security', name: 'Agent Security', description: 'Block supply-chain attacks, malicious package installs, and code-agent-specific threats.', layer: 'guardrail' },
1833
+ { id: 'organization', name: 'Organization', description: 'Organization-wide baselines, audit, and project-scoped permissions.', layer: 'access' },
1834
1834
  ];
1835
1835
  // =============================================================================
1836
1836
  // DEFAULT POLICIES
@@ -2036,42 +2036,50 @@ export const OVERWATCH_TEMPLATES_JSON = `{
2036
2036
  {
2037
2037
  "id": "data-protection",
2038
2038
  "name": "Secrets & Data Protection",
2039
- "description": "Block credential leakage and protect sensitive file paths."
2039
+ "description": "Block credential leakage and protect sensitive file paths.",
2040
+ "layer": "guardrail"
2040
2041
  },
2041
2042
  {
2042
2043
  "id": "privacy",
2043
2044
  "name": "PII Detection",
2044
- "description": "Block personally identifiable information across prompts, tool calls, and file operations."
2045
+ "description": "Block personally identifiable information across prompts, tool calls, and file operations.",
2046
+ "layer": "guardrail"
2045
2047
  },
2046
2048
  {
2047
2049
  "id": "semantic",
2048
2050
  "name": "Semantic Threat Detection",
2049
- "description": "Block injection attacks (SQL, path traversal, encoded), prompt injection, and jailbreak attempts."
2051
+ "description": "Block injection attacks (SQL, path traversal, encoded), prompt injection, and jailbreak attempts.",
2052
+ "layer": "guardrail"
2050
2053
  },
2051
2054
  {
2052
2055
  "id": "trust-safety",
2053
2056
  "name": "Content Safety",
2054
- "description": "Block violent, hateful, sexual, criminal, or excessively profane content."
2057
+ "description": "Block violent, hateful, sexual, criminal, or excessively profane content.",
2058
+ "layer": "guardrail"
2055
2059
  },
2056
2060
  {
2057
2061
  "id": "tools",
2058
2062
  "name": "Tool Permissioning",
2059
- "description": "Control shell execution, file operations, MCP servers, and sensitive system paths."
2063
+ "description": "Control shell execution, file operations, MCP servers, and sensitive system paths.",
2064
+ "layer": "access"
2060
2065
  },
2061
2066
  {
2062
2067
  "id": "agent-identity",
2063
2068
  "name": "Agent-Specific Guardrails",
2064
- "description": "Per-agent security policies applied based on agent identity."
2069
+ "description": "Per-agent security policies applied based on agent identity.",
2070
+ "layer": "guardrail"
2065
2071
  },
2066
2072
  {
2067
2073
  "id": "agent-security",
2068
2074
  "name": "Agent Security",
2069
- "description": "Block supply-chain attacks, malicious package installs, and code-agent-specific threats."
2075
+ "description": "Block supply-chain attacks, malicious package installs, and code-agent-specific threats.",
2076
+ "layer": "guardrail"
2070
2077
  },
2071
2078
  {
2072
2079
  "id": "organization",
2073
2080
  "name": "Organization",
2074
- "description": "Organization-wide baselines, audit, and project-scoped permissions."
2081
+ "description": "Organization-wide baselines, audit, and project-scoped permissions.",
2082
+ "layer": "access"
2075
2083
  }
2076
2084
  ],
2077
2085
  "defaults": [
@@ -10,6 +10,9 @@ export interface SentryCategoryInfo {
10
10
  id: SentryCategory;
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.
@@ -1227,12 +1227,12 @@ when {
1227
1227
  // CATEGORIES
1228
1228
  // =============================================================================
1229
1229
  export const SENTRY_CATEGORIES = [
1230
- { id: 'data-protection', name: 'Secrets & Data Protection', description: 'Block secrets, API keys, tokens, and credentials in messages and uploads.' },
1231
- { id: 'privacy', name: 'PII Detection', description: 'Block personally identifiable information across messages and uploads.' },
1232
- { id: 'semantic', name: 'Semantic Threat Detection', description: 'Block prompt injection, jailbreak attempts, and high-severity threats.' },
1233
- { id: 'trust-safety', name: 'Content Safety', description: 'Block violent, harmful, hateful, sexual, or profane content.' },
1234
- { id: 'clipboard', name: 'Clipboard Policy', description: 'Control paste operations into AI chat services.' },
1235
- { id: 'organization', name: 'Organization Rules', description: 'Organization-wide baselines and session-aware threat escalation.' },
1230
+ { id: 'data-protection', name: 'Secrets & Data Protection', description: 'Block secrets, API keys, tokens, and credentials in messages and uploads.', layer: 'guardrail' },
1231
+ { id: 'privacy', name: 'PII Detection', description: 'Block personally identifiable information across messages and uploads.', layer: 'guardrail' },
1232
+ { id: 'semantic', name: 'Semantic Threat Detection', description: 'Block prompt injection, jailbreak attempts, and high-severity threats.', layer: 'guardrail' },
1233
+ { id: 'trust-safety', name: 'Content Safety', description: 'Block violent, harmful, hateful, sexual, or profane content.', layer: 'guardrail' },
1234
+ { id: 'clipboard', name: 'Clipboard Policy', description: 'Control paste operations into AI chat services.', layer: 'guardrail' },
1235
+ { id: 'organization', name: 'Organization Rules', description: 'Organization-wide baselines and session-aware threat escalation.', layer: 'access' },
1236
1236
  ];
1237
1237
  // =============================================================================
1238
1238
  // DEFAULT POLICIES
@@ -1348,32 +1348,38 @@ export const SENTRY_TEMPLATES_JSON = `{
1348
1348
  {
1349
1349
  "id": "data-protection",
1350
1350
  "name": "Secrets & Data Protection",
1351
- "description": "Block secrets, API keys, tokens, and credentials in messages and uploads."
1351
+ "description": "Block secrets, API keys, tokens, and credentials in messages and uploads.",
1352
+ "layer": "guardrail"
1352
1353
  },
1353
1354
  {
1354
1355
  "id": "privacy",
1355
1356
  "name": "PII Detection",
1356
- "description": "Block personally identifiable information across messages and uploads."
1357
+ "description": "Block personally identifiable information across messages and uploads.",
1358
+ "layer": "guardrail"
1357
1359
  },
1358
1360
  {
1359
1361
  "id": "semantic",
1360
1362
  "name": "Semantic Threat Detection",
1361
- "description": "Block prompt injection, jailbreak attempts, and high-severity threats."
1363
+ "description": "Block prompt injection, jailbreak attempts, and high-severity threats.",
1364
+ "layer": "guardrail"
1362
1365
  },
1363
1366
  {
1364
1367
  "id": "trust-safety",
1365
1368
  "name": "Content Safety",
1366
- "description": "Block violent, harmful, hateful, sexual, or profane content."
1369
+ "description": "Block violent, harmful, hateful, sexual, or profane content.",
1370
+ "layer": "guardrail"
1367
1371
  },
1368
1372
  {
1369
1373
  "id": "clipboard",
1370
1374
  "name": "Clipboard Policy",
1371
- "description": "Control paste operations into AI chat services."
1375
+ "description": "Control paste operations into AI chat services.",
1376
+ "layer": "guardrail"
1372
1377
  },
1373
1378
  {
1374
1379
  "id": "organization",
1375
1380
  "name": "Organization Rules",
1376
- "description": "Organization-wide baselines and session-aware threat escalation."
1381
+ "description": "Organization-wide baselines and session-aware threat escalation.",
1382
+ "layer": "access"
1377
1383
  }
1378
1384
  ],
1379
1385
  "defaults": [
package/dist/types.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';
package/dist/types.js CHANGED
@@ -11,6 +11,7 @@ export * from './context.gen.js';
11
11
  export * from './schema.gen.js';
12
12
  // Canonical decision-effect vocabulary (browser-safe). Studio's Monaco
13
13
  // policy editor imports these typed symbols rather than string literals.
14
+ export * from './category-layers.gen.js';
14
15
  export * from './decision-effects.gen.js';
15
16
  // AARM-aware annotation registry (browser-safe — Studio uses this
16
17
  // for Monaco autocomplete + lint of @step_up_required / @defer_* keys).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highflame/policy",
3
- "version": "2.2.38",
3
+ "version": "2.2.39",
4
4
  "engines": {
5
5
  "node": ">=18"
6
6
  },