@highflame/policy 2.2.31 → 2.2.32

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 (58) hide show
  1. package/_schemas/agent_ops/context.json +1272 -439
  2. package/_schemas/agent_ops/schema.cedarschema +24 -0
  3. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_cross_origin.cedar +92 -0
  4. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_escalation.cedar +99 -0
  5. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_identity_enforcement.cedar +101 -0
  6. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_inter_agent_injection.cedar +120 -0
  7. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_claude_block_injection.cedar +30 -0
  8. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_defaults.cedar +122 -0
  9. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_safety.cedar +164 -0
  10. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_trust.cedar +143 -0
  11. package/_schemas/agent_ops/templates/ported/agent-security/agent_security_data_pipeline.cedar +45 -0
  12. package/_schemas/agent_ops/templates/ported/agent-security/agent_security_defaults.cedar +164 -0
  13. package/_schemas/agent_ops/templates/ported/agent-security/agent_security_malicious_package.cedar +59 -0
  14. package/_schemas/agent_ops/templates/ported/agent-security/agent_security_param_validation.cedar +119 -0
  15. package/_schemas/agent_ops/templates/ported/agent-security/agent_security_tool_risk.cedar +66 -0
  16. package/_schemas/agent_ops/templates/ported/code-security/agent_identity_a2a_supply_chain.cedar +101 -0
  17. package/_schemas/agent_ops/templates/ported/code-security/agent_security_code_agent.cedar +130 -0
  18. package/_schemas/agent_ops/templates/ported/code-security/agent_security_code_agent_supply_chain.cedar +116 -0
  19. package/_schemas/agent_ops/templates/ported/code-security/security_code_agent_encoding.cedar +51 -0
  20. package/_schemas/agent_ops/templates/ported/code-security/security_code_agent_path_security.cedar +149 -0
  21. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_chat_assistant.cedar +58 -0
  22. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_defaults.cedar +111 -0
  23. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_semantic.cedar +78 -0
  24. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_toxicity.cedar +71 -0
  25. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_advanced_secrets.cedar +74 -0
  26. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_code_block_write_secrets.cedar +26 -0
  27. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_data_pipeline.cedar +52 -0
  28. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_defaults.cedar +57 -0
  29. package/_schemas/agent_ops/templates/ported/data-protection/privacy_advanced_pii.cedar +465 -0
  30. package/_schemas/agent_ops/templates/ported/data-protection/privacy_defaults.cedar +164 -0
  31. package/_schemas/agent_ops/templates/ported/data-protection/privacy_pii_model.cedar +90 -0
  32. package/_schemas/agent_ops/templates/ported/organization/organization_deny_baseline.cedar +22 -0
  33. package/_schemas/agent_ops/templates/ported/organization/organization_team_permissions.cedar +38 -0
  34. package/_schemas/agent_ops/templates/ported/threat-detection/security_advanced_block_critical_severity.cedar +30 -0
  35. package/_schemas/agent_ops/templates/ported/threat-detection/security_chat_assistant.cedar +47 -0
  36. package/_schemas/agent_ops/templates/ported/threat-detection/security_data_pipeline_block_injection.cedar +31 -0
  37. package/_schemas/agent_ops/templates/ported/threat-detection/security_injection.cedar +82 -0
  38. package/_schemas/agent_ops/templates/ported/threat-detection/security_patterns.cedar +72 -0
  39. package/_schemas/agent_ops/templates/ported/threat-detection/semantic_defaults.cedar +155 -0
  40. package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_bash_operation_classes.cedar +142 -0
  41. package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_block_shell.cedar +40 -0
  42. package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_defaults.cedar +76 -0
  43. package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_mcp_server_allowlist.cedar +41 -0
  44. package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_mcp_tool_permissions.cedar +103 -0
  45. package/_schemas/agent_ops/templates/templates.json +752 -8
  46. package/_schemas/ai_gateway/context.json +2 -2
  47. package/_schemas/guardrails/context.json +2 -2
  48. package/_schemas/guardrails/templates/templates.json +6 -1
  49. package/_schemas/overwatch/context.json +3 -3
  50. package/dist/aarm-annotations.gen.js +1 -1
  51. package/dist/agent_ops-context.gen.d.ts +5 -1
  52. package/dist/agent_ops-context.gen.js +8 -0
  53. package/dist/agent_ops-defaults.gen.js +5168 -8
  54. package/dist/guardrails-defaults.gen.js +6 -1
  55. package/dist/overwatch-defaults.gen.js +109 -0
  56. package/dist/service-schemas.gen.d.ts +1 -1
  57. package/dist/service-schemas.gen.js +48 -12
  58. package/package.json +1 -1
@@ -0,0 +1,142 @@
1
+ // =============================================================================
2
+ // Tool Permissioning: Bash AST operation classes (Opt-in)
3
+ // =============================================================================
4
+ // Tiered shell control driven by Shield's bash_ast classifier. The classifier
5
+ // parses every shell command (bash, sh, zsh, dash) into an AST and emits
6
+ // tool_operation_classes, a set drawn from:
7
+ //
8
+ // readonly | network_access | write_enabling | execute_enabling | unknown
9
+ //
10
+ // One command can carry several classes ("curl -o f https://x" is
11
+ // {network_access, write_enabling}). "unknown" means the classifier saw a
12
+ // command it cannot vouch for (not in its command lists, or variable
13
+ // expanded) and is a reason to deny, never to allow. The set is never empty,
14
+ // so every shell command lands in at least one section below.
15
+ //
16
+ // Posture per class when this template is active:
17
+ //
18
+ // readonly -> allowed silently
19
+ // network_access -> blocked (Section 1)
20
+ // write_enabling -> blocked (Section 2)
21
+ // execute_enabling -> step-up human approval (Section 3)
22
+ // unknown -> step-up human approval (Section 3)
23
+ //
24
+ // Together, Sections 1 and 3 close the side door where an operation denied
25
+ // as an MCP tool is replayed through the shell: recognized network
26
+ // primitives (curl, ssh, nc) are blocked outright, and unrecognized CLI
27
+ // clients (gh, aws) classify as "unknown" and require human approval. No
28
+ // shell command reaches the network or executes silently unless it is
29
+ // purely read-only.
30
+ //
31
+ // Section 3 carries @step_up_required (AARM R4, CAP-ENF-004): Shield
32
+ // suspends the command and issues an OpenID CIBA challenge; the command
33
+ // runs only after an approver carrying the named AuthN role approves it,
34
+ // and the timeout denies it (fail-closed). Customize before deploying:
35
+ // - role: must exist in authn.roles ("security_oncall" is a placeholder;
36
+ // unknown roles reject the policy at deploy time)
37
+ // - timeout_seconds: default 86400 (24h), bounds [60, 604800]
38
+ //
39
+ // Context keys consumed:
40
+ // - tool_operation_classes: Set<String>
41
+ //
42
+ // Compliance:
43
+ // - NIST 800-53 CM-7, AC-6(1); OWASP LLM06, ASI02; MITRE ATT&CK T1059
44
+ //
45
+ // Category: tools
46
+ // Namespace: AgentOps
47
+ // =============================================================================
48
+
49
+ // ---------------------------------------------------------------------------
50
+ // Section 1: Network access
51
+ // ---------------------------------------------------------------------------
52
+ // Recognized network primitives: curl, wget, ssh, scp, nc, rsync, dig, nmap.
53
+ // Blocking this class forces network operations back through MCP tools,
54
+ // where per-tool policies apply.
55
+
56
+ @id("tools.block-bash-network")
57
+ @name("Block network access from shell commands")
58
+ @description("Blocks call_tool when the bash AST classifier marks the command network_access (curl, wget, ssh, nc), closing the side door where an operation denied as an MCP tool is replayed through the shell.")
59
+ @severity("high")
60
+ @tags("category:tools,threat:exfiltration,detection:rule,surface:call-tool,owasp:asi02")
61
+ @reject_message("Tool execution blocked: network access from shell commands is restricted; use the approved MCP tool for this operation.")
62
+ forbid (
63
+ principal,
64
+ action == AgentOps::Action::"call_tool",
65
+ resource
66
+ )
67
+ when {
68
+ context has tool_operation_classes &&
69
+ context.tool_operation_classes.contains("network_access")
70
+ };
71
+
72
+ // ---------------------------------------------------------------------------
73
+ // Section 2: Filesystem and environment writes
74
+ // ---------------------------------------------------------------------------
75
+ // rm, mv, cp, chmod, dd, sed -i, output redirects (>, >>, &>), and
76
+ // environment mutation (export VAR=val, unset).
77
+
78
+ @id("tools.block-bash-write")
79
+ @name("Block filesystem and environment writes from shell")
80
+ @description("Blocks call_tool when the bash AST classifier marks the command write_enabling (rm, mv, sed -i, output redirects, environment mutation).")
81
+ @severity("high")
82
+ @tags("category:tools,detection:rule,surface:call-tool,owasp:asi02,mitre:t1059")
83
+ @reject_message("Tool execution blocked: filesystem and environment modification from shell commands is restricted in this environment.")
84
+ forbid (
85
+ principal,
86
+ action == AgentOps::Action::"call_tool",
87
+ resource
88
+ )
89
+ when {
90
+ context has tool_operation_classes &&
91
+ context.tool_operation_classes.contains("write_enabling")
92
+ };
93
+
94
+ // ---------------------------------------------------------------------------
95
+ // Section 3: Execute-enabling and unrecognized commands (step-up approval)
96
+ // ---------------------------------------------------------------------------
97
+ // Process spawning and sub-interpreters ($(...), python3, sudo, PATH=
98
+ // hijacks) plus any command the classifier could not recognize. Routed to
99
+ // human approval rather than blocked: these classes cover a large legitimate
100
+ // surface (build scripts, interpreters, CLI clients), so a human decides.
101
+ //
102
+ // Cedar is deny-overrides and Shield emits step-up only when the decision is
103
+ // Allow, so this permit must not coexist with a forbid on the same classes.
104
+ // To hard-block instead of gating on approval, replace this rule with:
105
+ //
106
+ // @id("tools.block-bash-execute-unknown")
107
+ // @name("Block execute-enabling and unknown shell commands")
108
+ // @description("Blocks call_tool when the bash AST classifier marks the command execute_enabling (spawns processes or sub-interpreters) or unknown (unrecognized or variable-expanded commands).")
109
+ // @severity("critical")
110
+ // @tags("category:tools,threat:command-injection,detection:rule,surface:call-tool,owasp:llm06,mitre:t1059")
111
+ // @reject_message("Tool execution blocked: the shell command spawns processes or contains commands that cannot be classified.")
112
+ // forbid (
113
+ // principal,
114
+ // action == AgentOps::Action::"call_tool",
115
+ // resource
116
+ // )
117
+ // when {
118
+ // context has tool_operation_classes &&
119
+ // (
120
+ // context.tool_operation_classes.contains("execute_enabling") ||
121
+ // context.tool_operation_classes.contains("unknown")
122
+ // )
123
+ // };
124
+
125
+ @id("tools.allow-bash-step-up")
126
+ @name("Permit risky shell commands with step-up approval")
127
+ @description("Permits call_tool but suspends it for human approval when the bash AST classifier marks the command execute_enabling or unknown; an approver with the configured AuthN role must approve before the command runs.")
128
+ @severity("high")
129
+ @tags("category:tools,threat:command-injection,surface:call-tool,mitre:t1059,step-up")
130
+ @step_up_required("role=security_oncall,timeout_seconds=3600")
131
+ permit (
132
+ principal,
133
+ action == AgentOps::Action::"call_tool",
134
+ resource
135
+ )
136
+ when {
137
+ context has tool_operation_classes &&
138
+ (
139
+ context.tool_operation_classes.contains("execute_enabling") ||
140
+ context.tool_operation_classes.contains("unknown")
141
+ )
142
+ };
@@ -0,0 +1,40 @@
1
+ // =============================================================================
2
+ // Tool Permissioning — Shell execution block (Opt-in)
3
+ // =============================================================================
4
+ // Blocks shell and command execution tools. Inactive unless explicitly enabled
5
+ // because it blocks ALL shell access (including safe commands like git and
6
+ // echo). Intended for high-security environments where shell access is
7
+ // prohibited.
8
+ //
9
+ // Context keys consumed:
10
+ // - tool_name: String
11
+ //
12
+ // Compliance:
13
+ // - NIST 800-53 CM-7; OWASP LLM06; MITRE ATT&CK T1059
14
+ //
15
+ // Category: tools
16
+ // Namespace: AgentOps
17
+ // =============================================================================
18
+
19
+ @id("tools.block-shell")
20
+ @name("Block shell and command execution")
21
+ @description("Blocks call_tool when tool_name is shell, bash, sh, terminal, cmd, or powershell.")
22
+ @severity("critical")
23
+ @tags("category:tools,threat:command-injection,detection:rule,surface:call-tool,owasp:llm06,mitre:t1059")
24
+ @reject_message("Tool execution blocked: shell/command execution is restricted in this environment.")
25
+ forbid (
26
+ principal,
27
+ action == AgentOps::Action::"call_tool",
28
+ resource
29
+ )
30
+ when {
31
+ context has tool_name &&
32
+ (
33
+ context.tool_name == "shell" ||
34
+ context.tool_name == "bash" ||
35
+ context.tool_name == "sh" ||
36
+ context.tool_name == "terminal" ||
37
+ context.tool_name == "cmd" ||
38
+ context.tool_name == "powershell"
39
+ )
40
+ };
@@ -0,0 +1,76 @@
1
+ // =============================================================================
2
+ // Tool Permissioning (Default)
3
+ // =============================================================================
4
+ // Sensitive system-path file access and destructive MCP file-operation
5
+ // blocking. Shell-execution blocking lives in tools_shell_block.cedar as a
6
+ // separate opt-in template and is not bundled with this default.
7
+ //
8
+ // Context keys consumed:
9
+ // - path: String
10
+ // - tool_name: String
11
+ //
12
+ // Compliance:
13
+ // - NIST 800-53 AC-3, AC-6, CM-7
14
+ // - OWASP ASI02; MITRE ATT&CK T1005
15
+ //
16
+ // Category: tools
17
+ // Namespace: AgentOps
18
+ // =============================================================================
19
+
20
+ // ---------------------------------------------------------------------------
21
+ // Section 1: Sensitive system paths
22
+ // ---------------------------------------------------------------------------
23
+
24
+ @id("tools.block-system-paths")
25
+ @name("Block system directory access")
26
+ @description("Blocks read_file and write_file when path matches a sensitive Linux or macOS system directory.")
27
+ @severity("high")
28
+ @tags("category:tools,threat:path-traversal,detection:pattern,mitre:t1005")
29
+ @reject_message("File access blocked: sensitive system directory targeted (/etc, /proc, /sys, /root, /var, /System, /Library, /private).")
30
+ forbid (
31
+ principal,
32
+ action in [AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
33
+ resource
34
+ )
35
+ when {
36
+ context has path &&
37
+ (
38
+ context.path like "/etc/*" ||
39
+ context.path like "/proc/*" ||
40
+ context.path like "/sys/*" ||
41
+ context.path like "/root/*" ||
42
+ context.path like "/var/log/*" ||
43
+ context.path like "/var/run/*" ||
44
+ context.path like "/private/etc/*" ||
45
+ context.path like "/private/var/*" ||
46
+ context.path like "/Library/*" ||
47
+ context.path like "/System/*"
48
+ )
49
+ };
50
+
51
+ // ---------------------------------------------------------------------------
52
+ // Section 2: Destructive MCP file operations
53
+ // ---------------------------------------------------------------------------
54
+
55
+ @id("tools.block-destructive-ops")
56
+ @name("Block destructive file operations")
57
+ @description("Blocks call_tool when tool_name is a destructive MCP file operation.")
58
+ @severity("high")
59
+ @tags("category:tools,detection:rule,surface:call-tool,owasp:asi02")
60
+ @reject_message("Tool execution blocked: destructive file operations (delete, rmdir, unlink) require explicit human approval.")
61
+ forbid (
62
+ principal,
63
+ action == AgentOps::Action::"call_tool",
64
+ resource
65
+ )
66
+ when {
67
+ context has tool_name &&
68
+ (
69
+ context.tool_name == "fs.delete" ||
70
+ context.tool_name == "fs.rmdir" ||
71
+ context.tool_name == "fs.unlink" ||
72
+ context.tool_name == "fs.remove" ||
73
+ context.tool_name == "delete_file" ||
74
+ context.tool_name == "remove_directory"
75
+ )
76
+ };
@@ -0,0 +1,41 @@
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.
7
+ //
8
+ // Context keys consumed:
9
+ // - mcp_server: String
10
+ //
11
+ // Category: tools
12
+ // Namespace: AgentOps
13
+ // =============================================================================
14
+
15
+ @id("tools.allow-mcp-allowlist")
16
+ @name("Allow allowlisted MCP servers")
17
+ @description("Permits connect_server when mcp_server is in the allowlist.")
18
+ @severity("medium")
19
+ @tags("category:tools,surface:connect-server,scope:org-wide,posture:deny-default")
20
+ permit (
21
+ principal,
22
+ action == AgentOps::Action::"connect_server",
23
+ resource
24
+ )
25
+ when {
26
+ context has mcp_server &&
27
+ (context.mcp_server == "filesystem" ||
28
+ context.mcp_server == "playwright")
29
+ };
30
+
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.")
34
+ @severity("medium")
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.")
37
+ forbid (
38
+ principal,
39
+ action == AgentOps::Action::"connect_server",
40
+ resource
41
+ );
@@ -0,0 +1,103 @@
1
+ // =============================================================================
2
+ // MCP Tool Permissions
3
+ // =============================================================================
4
+ // Per-tool access control for MCP servers — fine-grained permissioning that
5
+ // allows specific tools from a server while denying others.
6
+ //
7
+ // Bundled rules cover:
8
+ // - GitHub MCP example: permit read tools, block write tools
9
+ // - Org-wide exclusion list (untrusted / deprecated servers)
10
+ // - Unverified MCP server block
11
+ //
12
+ // Context keys consumed:
13
+ // - mcp_server: String
14
+ // - tool_name: String
15
+ // - mcp_server_verified: Bool
16
+ //
17
+ // Category: tools
18
+ // Namespace: AgentOps
19
+ // =============================================================================
20
+
21
+ // ---------------------------------------------------------------------------
22
+ // Section 1: Example — GitHub MCP read/write split
23
+ // ---------------------------------------------------------------------------
24
+
25
+ @id("tools.allow-github-mcp-read")
26
+ @name("Allow GitHub MCP read tools")
27
+ @description("Permits call_tool when mcp_server is \"github\" and tool_name is a read-only operation.")
28
+ @severity("medium")
29
+ @tags("category:tools,scope:per-tool,surface:call-tool,posture:deny-default")
30
+ permit (
31
+ principal,
32
+ action == AgentOps::Action::"call_tool",
33
+ resource
34
+ )
35
+ when {
36
+ context has mcp_server && context.mcp_server == "github" &&
37
+ context has tool_name &&
38
+ (
39
+ context.tool_name == "read_issues" ||
40
+ context.tool_name == "get_issue" ||
41
+ context.tool_name == "list_repos" ||
42
+ context.tool_name == "get_pull_request" ||
43
+ context.tool_name == "search_code" ||
44
+ context.tool_name == "get_file_contents"
45
+ )
46
+ };
47
+
48
+ @id("tools.block-github-mcp-write")
49
+ @name("Block GitHub MCP write tools")
50
+ @description("Blocks call_tool when mcp_server is \"github\"; combine with the read-allow permit above.")
51
+ @severity("high")
52
+ @tags("category:tools,scope:per-tool,surface:call-tool,posture:deny-default")
53
+ @reject_message("Tool execution blocked: write operations against the GitHub MCP server are not permitted.")
54
+ forbid (
55
+ principal,
56
+ action == AgentOps::Action::"call_tool",
57
+ resource
58
+ )
59
+ when {
60
+ context has mcp_server && context.mcp_server == "github"
61
+ };
62
+
63
+ // ---------------------------------------------------------------------------
64
+ // Section 2: Org-wide exclusion list
65
+ // ---------------------------------------------------------------------------
66
+
67
+ @id("tools.exclude-mcp-servers")
68
+ @name("Block excluded MCP servers")
69
+ @description("Blocks call_tool when mcp_server is in the org-wide exclusion list.")
70
+ @severity("critical")
71
+ @tags("category:tools,scope:org-wide,surface:call-tool,posture:deny-default")
72
+ @reject_message("Tool execution blocked: MCP server is on the org-wide exclusion list.")
73
+ forbid (
74
+ principal,
75
+ action == AgentOps::Action::"call_tool",
76
+ resource
77
+ )
78
+ when {
79
+ context has mcp_server &&
80
+ (
81
+ context.mcp_server == "untrusted-server" ||
82
+ context.mcp_server == "deprecated-server"
83
+ )
84
+ };
85
+
86
+ // ---------------------------------------------------------------------------
87
+ // Section 3: Unverified server block
88
+ // ---------------------------------------------------------------------------
89
+
90
+ @id("tools.block-unverified-mcp-tools")
91
+ @name("Block unverified MCP server tools")
92
+ @description("Blocks call_tool when mcp_server_verified is false.")
93
+ @severity("high")
94
+ @tags("category:tools,threat:supply-chain,detection:rule,surface:call-tool")
95
+ @reject_message("Tool execution blocked: MCP server is not from a verified registry.")
96
+ forbid (
97
+ principal,
98
+ action == AgentOps::Action::"call_tool",
99
+ resource
100
+ )
101
+ when {
102
+ context has mcp_server_verified && context.mcp_server_verified == false
103
+ };