@highflame/policy 2.1.36 → 2.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_schemas/ai_gateway/context.json +431 -11
- package/_schemas/ai_gateway/schema.cedarschema +91 -11
- package/_schemas/ai_gateway/templates/defaults/agent_security.cedar +66 -43
- package/_schemas/ai_gateway/templates/defaults/baseline.cedar +9 -11
- package/_schemas/ai_gateway/templates/defaults/semantic.cedar +63 -40
- package/_schemas/ai_gateway/templates/defaults/tools.cedar +48 -36
- package/_schemas/ai_gateway/templates/llm_default_allow.cedar +9 -10
- package/_schemas/ai_gateway/templates/mcp_server_allowlist.cedar +22 -14
- package/_schemas/ai_gateway/templates/mcp_tool_permissions.cedar +29 -27
- package/_schemas/ai_gateway/templates/pii_redaction.cedar +38 -33
- package/_schemas/ai_gateway/templates/templates.json +42 -47
- package/_schemas/guardrails/context.json +12 -12
- package/_schemas/guardrails/schema.cedarschema +12 -12
- package/_schemas/guardrails/templates/defaults/agent_identity.cedar +60 -56
- package/_schemas/guardrails/templates/defaults/agentic_safety.cedar +83 -58
- package/_schemas/guardrails/templates/defaults/baseline.cedar +9 -12
- package/_schemas/guardrails/templates/defaults/injection.cedar +48 -36
- package/_schemas/guardrails/templates/defaults/pii.cedar +27 -20
- package/_schemas/guardrails/templates/defaults/secrets.cedar +39 -22
- package/_schemas/guardrails/templates/defaults/security_patterns.cedar +38 -25
- package/_schemas/guardrails/templates/defaults/semantic.cedar +47 -31
- package/_schemas/guardrails/templates/defaults/tool_risk.cedar +34 -26
- package/_schemas/guardrails/templates/defaults/toxicity.cedar +57 -47
- package/_schemas/guardrails/templates/mcp_tool_permissions.cedar +60 -43
- package/_schemas/guardrails/templates/profiles/a2a_security/cross_origin.cedar +29 -42
- package/_schemas/guardrails/templates/profiles/a2a_security/escalation_detection.cedar +43 -57
- package/_schemas/guardrails/templates/profiles/a2a_security/identity_enforcement.cedar +40 -57
- package/_schemas/guardrails/templates/profiles/a2a_security/inter_agent_injection.cedar +48 -62
- package/_schemas/guardrails/templates/profiles/a2a_security/supply_chain.cedar +40 -56
- package/_schemas/guardrails/templates/profiles/advanced_detection/pii.cedar +24 -34
- package/_schemas/guardrails/templates/profiles/advanced_detection/secrets.cedar +45 -37
- package/_schemas/guardrails/templates/profiles/advanced_detection/threat_severity.cedar +11 -16
- package/_schemas/guardrails/templates/profiles/chat_assistant/privacy.cedar +22 -9
- package/_schemas/guardrails/templates/profiles/chat_assistant/security.cedar +27 -15
- package/_schemas/guardrails/templates/profiles/chat_assistant/trust_safety.cedar +37 -22
- package/_schemas/guardrails/templates/profiles/code_agent/agentic_security.cedar +68 -47
- package/_schemas/guardrails/templates/profiles/code_agent/encoding.cedar +17 -21
- package/_schemas/guardrails/templates/profiles/code_agent/path_security.cedar +74 -73
- package/_schemas/guardrails/templates/profiles/code_agent/security.cedar +13 -9
- package/_schemas/guardrails/templates/profiles/code_agent/supply_chain.cedar +36 -58
- package/_schemas/guardrails/templates/profiles/data_pipeline/agentic_security.cedar +22 -15
- package/_schemas/guardrails/templates/profiles/data_pipeline/data_protection.cedar +52 -0
- package/_schemas/guardrails/templates/profiles/data_pipeline/privacy.cedar +41 -18
- package/_schemas/guardrails/templates/profiles/data_pipeline/security.cedar +18 -36
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_safety.cedar +86 -79
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_trust.cedar +73 -70
- package/_schemas/guardrails/templates/templates.json +188 -210
- package/_schemas/overwatch/context.json +14 -14
- package/_schemas/overwatch/schema.cedarschema +12 -12
- package/_schemas/sentry/context.json +11 -11
- package/_schemas/sentry/schema.cedarschema +11 -11
- package/_schemas/sentry/templates/defaults/baseline.cedar +8 -12
- package/_schemas/sentry/templates/defaults/clipboard.cedar +43 -42
- package/_schemas/sentry/templates/defaults/content_safety.cedar +38 -68
- package/_schemas/sentry/templates/defaults/file_safety.cedar +18 -26
- package/_schemas/sentry/templates/defaults/organization.cedar +10 -17
- package/_schemas/sentry/templates/defaults/pii.cedar +52 -73
- package/_schemas/sentry/templates/defaults/secrets.cedar +65 -58
- package/_schemas/sentry/templates/defaults/semantic.cedar +40 -59
- package/_schemas/sentry/templates/templates.json +46 -46
- package/dist/ai_gateway-context.gen.d.ts +18 -4
- package/dist/ai_gateway-context.gen.js +18 -4
- package/dist/ai_gateway-defaults.gen.d.ts +1 -1
- package/dist/ai_gateway-defaults.gen.js +377 -313
- package/dist/guardrails-context.gen.d.ts +5 -5
- package/dist/guardrails-context.gen.js +5 -5
- package/dist/guardrails-defaults.gen.d.ts +1 -1
- package/dist/guardrails-defaults.gen.js +2070 -1849
- package/dist/overwatch-context.gen.d.ts +5 -5
- package/dist/overwatch-context.gen.js +5 -5
- package/dist/overwatch-defaults.gen.d.ts +1 -1
- package/dist/overwatch-defaults.gen.js +547 -573
- package/dist/sentry-context.gen.d.ts +3 -3
- package/dist/sentry-context.gen.js +3 -3
- package/dist/sentry-defaults.gen.d.ts +1 -1
- package/dist/sentry-defaults.gen.js +379 -460
- package/dist/service-schemas.gen.d.ts +4 -4
- package/dist/service-schemas.gen.js +249 -99
- package/package.json +1 -1
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
2
|
// Code Agent — Path Security
|
|
3
3
|
// =============================================================================
|
|
4
|
-
// Blocks access to sensitive file paths
|
|
5
|
-
//
|
|
4
|
+
// Blocks access to sensitive file paths: environment files, credential files,
|
|
5
|
+
// system directories, and credential/key directories. Also blocks destructive
|
|
6
6
|
// file operations (delete, rmdir, unlink) by default.
|
|
7
7
|
//
|
|
8
|
-
//
|
|
8
|
+
// Context keys consumed:
|
|
9
|
+
// - path: String
|
|
10
|
+
// - tool_name: String
|
|
9
11
|
//
|
|
10
12
|
// Compliance:
|
|
11
|
-
// NIST 800-53 AC-6
|
|
12
|
-
// NIST 800-53 SC-28 (Protection of Information at Rest)
|
|
13
|
-
// MITRE ATT&CK T1552 (Unsecured Credentials)
|
|
14
|
-
// MITRE ATT&CK T1005 (Data from Local System)
|
|
15
|
-
// CIS Benchmark 1.4 (Secrets Management)
|
|
13
|
+
// - NIST 800-53 AC-6, SC-28; MITRE ATT&CK T1552, T1005; CIS 1.4
|
|
16
14
|
//
|
|
17
|
-
// Category:
|
|
15
|
+
// Category: security
|
|
18
16
|
// Namespace: Guardrails
|
|
19
17
|
// =============================================================================
|
|
20
18
|
|
|
21
19
|
// ---------------------------------------------------------------------------
|
|
22
|
-
// Section 1: Environment
|
|
23
|
-
// Environment files are the #1 source of accidental credential exposure.
|
|
20
|
+
// Section 1: Environment files (.env*)
|
|
24
21
|
// ---------------------------------------------------------------------------
|
|
25
22
|
|
|
26
|
-
@id("code-block-env-files")
|
|
27
|
-
@name("Block
|
|
28
|
-
@description("
|
|
23
|
+
@id("security.code-block-env-files")
|
|
24
|
+
@name("Block dotenv file access (code profile)")
|
|
25
|
+
@description("Blocks read_file, write_file, and call_tool when path matches *.env*.")
|
|
29
26
|
@severity("high")
|
|
30
|
-
@tags("
|
|
31
|
-
@reject_message("
|
|
27
|
+
@tags("category:security,threat:secrets,detection:pattern,compliance:nist-si-3")
|
|
28
|
+
@reject_message("File access blocked: .env files commonly contain secrets and API keys — use a secrets manager instead.")
|
|
32
29
|
forbid (
|
|
33
30
|
principal,
|
|
34
31
|
action in [Guardrails::Action::"read_file", Guardrails::Action::"write_file", Guardrails::Action::"call_tool"],
|
|
@@ -39,16 +36,15 @@ when {
|
|
|
39
36
|
};
|
|
40
37
|
|
|
41
38
|
// ---------------------------------------------------------------------------
|
|
42
|
-
// Section 2: Credential
|
|
43
|
-
// Blocks access to common credential and configuration files.
|
|
39
|
+
// Section 2: Credential files
|
|
44
40
|
// ---------------------------------------------------------------------------
|
|
45
41
|
|
|
46
|
-
@id("code-block-credential-files")
|
|
47
|
-
@name("Block credential
|
|
48
|
-
@description("
|
|
42
|
+
@id("security.code-block-credential-files")
|
|
43
|
+
@name("Block credential files (code profile)")
|
|
44
|
+
@description("Blocks read_file, write_file, and call_tool when path matches a common credential file.")
|
|
49
45
|
@severity("high")
|
|
50
|
-
@tags("
|
|
51
|
-
@reject_message("
|
|
46
|
+
@tags("category:security,threat:secrets,detection:pattern,compliance:nist-si-3")
|
|
47
|
+
@reject_message("File access blocked: .netrc, .npmrc, .pypirc, cloud config, and service-account files commonly contain hardcoded credentials.")
|
|
52
48
|
forbid (
|
|
53
49
|
principal,
|
|
54
50
|
action in [Guardrails::Action::"read_file", Guardrails::Action::"write_file", Guardrails::Action::"call_tool"],
|
|
@@ -56,27 +52,28 @@ forbid (
|
|
|
56
52
|
)
|
|
57
53
|
when {
|
|
58
54
|
context has path &&
|
|
59
|
-
(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
(
|
|
56
|
+
context.path like "*/.netrc" ||
|
|
57
|
+
context.path like "*/.npmrc" ||
|
|
58
|
+
context.path like "*/.pypirc" ||
|
|
59
|
+
context.path like "*/.docker/config.json" ||
|
|
60
|
+
context.path like "*/.kube/config" ||
|
|
61
|
+
context.path like "*/.config/gcloud/*" ||
|
|
62
|
+
context.path like "*/credentials.json" ||
|
|
63
|
+
context.path like "*/service-account*.json"
|
|
64
|
+
)
|
|
67
65
|
};
|
|
68
66
|
|
|
69
67
|
// ---------------------------------------------------------------------------
|
|
70
|
-
// Section 3: System
|
|
71
|
-
// Blocks access to sensitive system directories.
|
|
68
|
+
// Section 3: System directories
|
|
72
69
|
// ---------------------------------------------------------------------------
|
|
73
70
|
|
|
74
|
-
@id("code-block-system-paths")
|
|
75
|
-
@name("Block system directory access")
|
|
76
|
-
@description("
|
|
71
|
+
@id("security.code-block-system-paths")
|
|
72
|
+
@name("Block system directory access (code profile)")
|
|
73
|
+
@description("Blocks read_file, write_file, and call_tool on /etc, /proc, /sys, /root, /var/log, /var/run paths.")
|
|
77
74
|
@severity("high")
|
|
78
|
-
@tags("
|
|
79
|
-
@reject_message("
|
|
75
|
+
@tags("category:security,threat:path-traversal,detection:pattern,mitre:t1005")
|
|
76
|
+
@reject_message("File access blocked: sensitive system directory targeted — agents may not access /etc, /proc, /sys, /root, or /var.")
|
|
80
77
|
forbid (
|
|
81
78
|
principal,
|
|
82
79
|
action in [Guardrails::Action::"read_file", Guardrails::Action::"write_file", Guardrails::Action::"call_tool"],
|
|
@@ -84,25 +81,26 @@ forbid (
|
|
|
84
81
|
)
|
|
85
82
|
when {
|
|
86
83
|
context has path &&
|
|
87
|
-
(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
(
|
|
85
|
+
context.path like "/etc/*" ||
|
|
86
|
+
context.path like "/proc/*" ||
|
|
87
|
+
context.path like "/sys/*" ||
|
|
88
|
+
context.path like "/root/*" ||
|
|
89
|
+
context.path like "/var/log/*" ||
|
|
90
|
+
context.path like "/var/run/*"
|
|
91
|
+
)
|
|
93
92
|
};
|
|
94
93
|
|
|
95
94
|
// ---------------------------------------------------------------------------
|
|
96
|
-
// Section 4: Credential
|
|
97
|
-
// Blocks access to SSH keys, cloud credentials, and key material.
|
|
95
|
+
// Section 4: Credential and key directories
|
|
98
96
|
// ---------------------------------------------------------------------------
|
|
99
97
|
|
|
100
|
-
@id("code-block-credential-paths")
|
|
101
|
-
@name("Block credential
|
|
102
|
-
@description("
|
|
98
|
+
@id("security.code-block-credential-paths")
|
|
99
|
+
@name("Block credential directories (code profile)")
|
|
100
|
+
@description("Blocks read_file, write_file, and call_tool on .ssh, .aws, .gnupg, .azure, .config/gcloud, .pem, and id_* paths.")
|
|
103
101
|
@severity("critical")
|
|
104
|
-
@tags("
|
|
105
|
-
@reject_message("
|
|
102
|
+
@tags("category:security,threat:secrets,detection:pattern,compliance:nist-si-3")
|
|
103
|
+
@reject_message("File access blocked: SSH, cloud, or GPG key material targeted — agents must never access authentication material.")
|
|
106
104
|
forbid (
|
|
107
105
|
principal,
|
|
108
106
|
action in [Guardrails::Action::"read_file", Guardrails::Action::"write_file", Guardrails::Action::"call_tool"],
|
|
@@ -110,28 +108,29 @@ forbid (
|
|
|
110
108
|
)
|
|
111
109
|
when {
|
|
112
110
|
context has path &&
|
|
113
|
-
(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
111
|
+
(
|
|
112
|
+
context.path like "*/.ssh/*" ||
|
|
113
|
+
context.path like "*/.aws/*" ||
|
|
114
|
+
context.path like "*/.gnupg/*" ||
|
|
115
|
+
context.path like "*/.config/gcloud/*" ||
|
|
116
|
+
context.path like "*/.azure/*" ||
|
|
117
|
+
context.path like "*.pem" ||
|
|
118
|
+
context.path like "*/id_rsa*" ||
|
|
119
|
+
context.path like "*/id_ed25519*" ||
|
|
120
|
+
context.path like "*/id_ecdsa*"
|
|
121
|
+
)
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
// ---------------------------------------------------------------------------
|
|
125
|
-
// Section 5: Destructive
|
|
126
|
-
// Blocks destructive file operations by default.
|
|
125
|
+
// Section 5: Destructive file operations
|
|
127
126
|
// ---------------------------------------------------------------------------
|
|
128
127
|
|
|
129
|
-
@id("code-block-destructive-ops")
|
|
130
|
-
@name("Block destructive file operations")
|
|
131
|
-
@description("
|
|
128
|
+
@id("security.code-block-destructive-ops")
|
|
129
|
+
@name("Block destructive file operations (code profile)")
|
|
130
|
+
@description("Blocks call_tool when tool_name is a destructive file operation.")
|
|
132
131
|
@severity("high")
|
|
133
|
-
@tags("
|
|
134
|
-
@reject_message("Tool execution
|
|
132
|
+
@tags("category:security,detection:rule,surface:call-tool,compliance:nist-si-3")
|
|
133
|
+
@reject_message("Tool execution blocked: destructive file operations (delete, rmdir, unlink) require explicit human approval.")
|
|
135
134
|
forbid (
|
|
136
135
|
principal,
|
|
137
136
|
action == Guardrails::Action::"call_tool",
|
|
@@ -139,10 +138,12 @@ forbid (
|
|
|
139
138
|
)
|
|
140
139
|
when {
|
|
141
140
|
context has tool_name &&
|
|
142
|
-
(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
(
|
|
142
|
+
context.tool_name == "fs.delete" ||
|
|
143
|
+
context.tool_name == "fs.rmdir" ||
|
|
144
|
+
context.tool_name == "fs.unlink" ||
|
|
145
|
+
context.tool_name == "fs.remove" ||
|
|
146
|
+
context.tool_name == "delete_file" ||
|
|
147
|
+
context.tool_name == "remove_directory"
|
|
148
|
+
)
|
|
148
149
|
};
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
|
-
// Code Agent —
|
|
2
|
+
// Code Agent — Secrets Protection
|
|
3
3
|
// =============================================================================
|
|
4
|
-
// Secrets protection for coding assistants.
|
|
5
4
|
// Prevents code agents from writing detected secrets to output files.
|
|
6
5
|
//
|
|
7
|
-
//
|
|
6
|
+
// Context keys consumed:
|
|
7
|
+
// - secrets_detected: Bool
|
|
8
|
+
//
|
|
9
|
+
// Category: data-protection
|
|
8
10
|
// Namespace: Guardrails
|
|
9
11
|
// =============================================================================
|
|
10
12
|
|
|
11
|
-
@id("code-block-write-secrets")
|
|
12
|
-
@name("Block writing secrets to files")
|
|
13
|
-
@description("
|
|
13
|
+
@id("data-protection.code-block-write-secrets")
|
|
14
|
+
@name("Block writing secrets to files (code profile)")
|
|
15
|
+
@description("Blocks write_file when secrets_detected is true.")
|
|
14
16
|
@severity("critical")
|
|
15
|
-
@tags("
|
|
17
|
+
@tags("category:data-protection,threat:secrets,detection:rule,surface:write-file,owasp:llm06")
|
|
18
|
+
@reject_message("File write blocked: secrets detected in content — code agents must not persist credentials.")
|
|
16
19
|
forbid (
|
|
17
20
|
principal,
|
|
18
21
|
action == Guardrails::Action::"write_file",
|
|
19
22
|
resource
|
|
20
|
-
)
|
|
21
|
-
|
|
23
|
+
)
|
|
24
|
+
when {
|
|
25
|
+
context has secrets_detected && context.secrets_detected == true
|
|
22
26
|
};
|
|
@@ -1,40 +1,30 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
2
|
// Code Agent — Supply Chain Security
|
|
3
3
|
// =============================================================================
|
|
4
|
-
// Detects and blocks MCP server poisoning, indirect prompt injection from
|
|
5
|
-
// outputs, credential theft chains, and destructive operation sequences.
|
|
4
|
+
// Detects and blocks MCP server poisoning, indirect prompt injection from
|
|
5
|
+
// tool outputs, credential theft chains, and destructive operation sequences.
|
|
6
6
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
7
|
+
// Context keys consumed:
|
|
8
|
+
// - tool_poisoning_score: Long (0-100)
|
|
9
|
+
// - indirect_injection_score: Long (0-100)
|
|
10
|
+
// - tool_is_sensitive: Bool
|
|
11
|
+
// - suspicious_pattern: Bool
|
|
12
|
+
// - pattern_type: String
|
|
12
13
|
//
|
|
13
14
|
// Compliance:
|
|
14
|
-
// OWASP ASI01
|
|
15
|
-
//
|
|
16
|
-
// OWASP ASI04 (Supply Chain)
|
|
17
|
-
// OWASP LLM01 (Prompt Injection) — indirect variant
|
|
18
|
-
// OWASP MCP01-05
|
|
19
|
-
// MITRE ATLAS AML.T0051 (Prompt Injection)
|
|
20
|
-
// MITRE ATT&CK T1552 (Unsecured Credentials)
|
|
15
|
+
// - OWASP ASI01, ASI02, ASI04, LLM01 (indirect), MCP01–05
|
|
16
|
+
// - MITRE ATLAS AML.T0051, MITRE ATT&CK T1552
|
|
21
17
|
//
|
|
22
|
-
// Category:
|
|
18
|
+
// Category: agent-security
|
|
23
19
|
// Namespace: Guardrails
|
|
24
20
|
// =============================================================================
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// Lower threshold than tool-level poisoning since it affects all tools.
|
|
30
|
-
// ---------------------------------------------------------------------------
|
|
31
|
-
|
|
32
|
-
@id("code-block-server-poisoning")
|
|
33
|
-
@name("Block poisoned MCP servers")
|
|
34
|
-
@description("Block connections to MCP servers when tool poisoning patterns are detected in tool descriptions (score >= 60). Lower threshold than tool-level poisoning since server-level poisoning affects all tools on the server.")
|
|
22
|
+
@id("agent-security.code-block-server-poisoning")
|
|
23
|
+
@name("Block poisoned MCP servers (code profile)")
|
|
24
|
+
@description("Blocks connect_server when tool_poisoning_score >= 60.")
|
|
35
25
|
@severity("critical")
|
|
36
|
-
@tags("
|
|
37
|
-
@reject_message("MCP server connection blocked: tool poisoning patterns detected in server tool descriptions.
|
|
26
|
+
@tags("category:agent-security,threat:tool-poisoning,detection:ml,surface:connect-server,owasp:asi04")
|
|
27
|
+
@reject_message("MCP server connection blocked: tool poisoning patterns detected in server tool descriptions.")
|
|
38
28
|
forbid (
|
|
39
29
|
principal,
|
|
40
30
|
action == Guardrails::Action::"connect_server",
|
|
@@ -44,19 +34,12 @@ when {
|
|
|
44
34
|
context has tool_poisoning_score && context.tool_poisoning_score >= 60
|
|
45
35
|
};
|
|
46
36
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// user input but external content that manipulates agent behavior.
|
|
51
|
-
// Ref: EchoLeak CVE-2025-32711, IDEsaster (30+ CVEs)
|
|
52
|
-
// ---------------------------------------------------------------------------
|
|
53
|
-
|
|
54
|
-
@id("code-block-indirect-injection")
|
|
55
|
-
@name("Block indirect prompt injection")
|
|
56
|
-
@description("Block tool execution when indirect prompt injection is detected in tool outputs, file contents, or retrieved documents (score >= 70). Defends against injection via external content that manipulates agent behavior.")
|
|
37
|
+
@id("agent-security.code-block-indirect-injection")
|
|
38
|
+
@name("Block indirect injection (code profile)")
|
|
39
|
+
@description("Blocks call_tool when indirect_injection_score >= 70.")
|
|
57
40
|
@severity("critical")
|
|
58
|
-
@tags("
|
|
59
|
-
@reject_message("Content blocked: indirect prompt injection detected in tool output or retrieved content.
|
|
41
|
+
@tags("category:agent-security,threat:indirect-injection,detection:ml,surface:call-tool,owasp:llm01,owasp:asi01")
|
|
42
|
+
@reject_message("Content blocked: indirect prompt injection detected in tool output or retrieved content.")
|
|
60
43
|
forbid (
|
|
61
44
|
principal,
|
|
62
45
|
action == Guardrails::Action::"call_tool",
|
|
@@ -66,12 +49,12 @@ when {
|
|
|
66
49
|
context has indirect_injection_score && context.indirect_injection_score >= 70
|
|
67
50
|
};
|
|
68
51
|
|
|
69
|
-
@id("code-block-indirect-injection-sensitive")
|
|
70
|
-
@name("Block indirect injection on sensitive tools")
|
|
71
|
-
@description("
|
|
52
|
+
@id("agent-security.code-block-indirect-injection-sensitive")
|
|
53
|
+
@name("Block indirect injection on sensitive tools (code profile)")
|
|
54
|
+
@description("Blocks call_tool when indirect_injection_score >= 50 and tool_is_sensitive is true.")
|
|
72
55
|
@severity("critical")
|
|
73
|
-
@tags("
|
|
74
|
-
@reject_message("Sensitive tool execution blocked: moderate indirect
|
|
56
|
+
@tags("category:agent-security,threat:indirect-injection,detection:ml,surface:call-tool,owasp:asi02")
|
|
57
|
+
@reject_message("Sensitive tool execution blocked: moderate indirect-injection risk detected (code profile).")
|
|
75
58
|
forbid (
|
|
76
59
|
principal,
|
|
77
60
|
action == Guardrails::Action::"call_tool",
|
|
@@ -82,17 +65,12 @@ when {
|
|
|
82
65
|
context has tool_is_sensitive && context.tool_is_sensitive == true
|
|
83
66
|
};
|
|
84
67
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
// ---------------------------------------------------------------------------
|
|
89
|
-
|
|
90
|
-
@id("code-block-credential-theft")
|
|
91
|
-
@name("Block credential theft chains")
|
|
92
|
-
@description("Block tool execution when a credential theft chain is detected — accessing SSH keys, cloud credentials, or API tokens followed by encoding, compression, or transfer operations. Multi-step attack pattern for autonomous credential harvesting.")
|
|
68
|
+
@id("agent-security.code-block-credential-theft")
|
|
69
|
+
@name("Block credential theft chains (code profile)")
|
|
70
|
+
@description("Blocks call_tool when suspicious_pattern is true and pattern_type equals \"credential_theft\".")
|
|
93
71
|
@severity("critical")
|
|
94
|
-
@tags("
|
|
95
|
-
@reject_message("Tool execution blocked: credential theft chain detected
|
|
72
|
+
@tags("category:agent-security,threat:exfiltration,detection:rule,surface:call-tool,mitre:t1059")
|
|
73
|
+
@reject_message("Tool execution blocked: credential theft chain detected — multi-step credential harvesting pattern.")
|
|
96
74
|
forbid (
|
|
97
75
|
principal,
|
|
98
76
|
action == Guardrails::Action::"call_tool",
|
|
@@ -103,12 +81,12 @@ when {
|
|
|
103
81
|
context has pattern_type && context.pattern_type == "credential_theft"
|
|
104
82
|
};
|
|
105
83
|
|
|
106
|
-
@id("code-block-destructive-sequence")
|
|
107
|
-
@name("Block destructive operation sequences")
|
|
108
|
-
@description("
|
|
84
|
+
@id("agent-security.code-block-destructive-sequence")
|
|
85
|
+
@name("Block destructive operation sequences (code profile)")
|
|
86
|
+
@description("Blocks call_tool when suspicious_pattern is true and pattern_type equals \"destructive_sequence\".")
|
|
109
87
|
@severity("critical")
|
|
110
|
-
@tags("
|
|
111
|
-
@reject_message("Tool execution blocked: destructive operation sequence detected
|
|
88
|
+
@tags("category:agent-security,detection:rule,surface:call-tool,owasp:asi02")
|
|
89
|
+
@reject_message("Tool execution blocked: destructive operation sequence detected — bulk deletions, config overwrites, or repo manipulation.")
|
|
112
90
|
forbid (
|
|
113
91
|
principal,
|
|
114
92
|
action == Guardrails::Action::"call_tool",
|
|
@@ -2,37 +2,44 @@
|
|
|
2
2
|
// Data Pipeline — Agentic Security
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// Exfiltration prevention and tool risk controls for data pipelines.
|
|
5
|
-
// Prevents retrieval data from being sent to external endpoints.
|
|
6
5
|
//
|
|
7
|
-
//
|
|
6
|
+
// Context keys consumed:
|
|
7
|
+
// - suspicious_pattern: Bool
|
|
8
|
+
// - pattern_type: String
|
|
9
|
+
// - tool_risk_score: Long (0-100)
|
|
10
|
+
//
|
|
11
|
+
// Category: agent-security
|
|
8
12
|
// Namespace: Guardrails
|
|
9
13
|
// =============================================================================
|
|
10
14
|
|
|
11
|
-
@id("data-block-exfiltration")
|
|
12
|
-
@name("Block data exfiltration
|
|
13
|
-
@description("
|
|
15
|
+
@id("agent-security.data-pipeline-block-exfiltration")
|
|
16
|
+
@name("Block data exfiltration (data-pipeline profile)")
|
|
17
|
+
@description("Blocks call_tool when suspicious_pattern is true and pattern_type matches an exfiltration class.")
|
|
14
18
|
@severity("critical")
|
|
15
|
-
@tags("
|
|
19
|
+
@tags("category:agent-security,threat:exfiltration,detection:rule,surface:call-tool")
|
|
20
|
+
@reject_message("Tool execution blocked: data exfiltration pattern detected in a data pipeline.")
|
|
16
21
|
forbid (
|
|
17
22
|
principal,
|
|
18
23
|
action == Guardrails::Action::"call_tool",
|
|
19
24
|
resource
|
|
20
|
-
)
|
|
25
|
+
)
|
|
26
|
+
when {
|
|
21
27
|
context has suspicious_pattern && context.suspicious_pattern == true &&
|
|
22
28
|
context has pattern_type &&
|
|
23
|
-
(context.pattern_type == "data_exfiltration" ||
|
|
24
|
-
context.pattern_type == "db_exfiltration")
|
|
29
|
+
(context.pattern_type == "data_exfiltration" || context.pattern_type == "db_exfiltration")
|
|
25
30
|
};
|
|
26
31
|
|
|
27
|
-
@id("data-block-high-risk-tools")
|
|
28
|
-
@name("Block high-risk tools
|
|
29
|
-
@description("
|
|
32
|
+
@id("agent-security.data-pipeline-block-high-risk-tools")
|
|
33
|
+
@name("Block high-risk tools (data-pipeline profile)")
|
|
34
|
+
@description("Blocks call_tool when tool_risk_score >= 61.")
|
|
30
35
|
@severity("high")
|
|
31
|
-
@tags("
|
|
36
|
+
@tags("category:agent-security,detection:aggregate,surface:call-tool,owasp:llm06")
|
|
37
|
+
@reject_message("Tool execution blocked: elevated tool risk in a data pipeline.")
|
|
32
38
|
forbid (
|
|
33
39
|
principal,
|
|
34
40
|
action == Guardrails::Action::"call_tool",
|
|
35
41
|
resource
|
|
36
|
-
)
|
|
37
|
-
|
|
42
|
+
)
|
|
43
|
+
when {
|
|
44
|
+
context has tool_risk_score && context.tool_risk_score >= 61
|
|
38
45
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Data Pipeline — Data Protection (Secrets)
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Strict secrets detection for data pipelines. Any secret triggers a block;
|
|
5
|
+
// secrets in writes are blocked unconditionally to prevent persistence.
|
|
6
|
+
//
|
|
7
|
+
// Context keys consumed:
|
|
8
|
+
// - secrets_detected: Bool
|
|
9
|
+
// - secret_count: Long
|
|
10
|
+
//
|
|
11
|
+
// Compliance:
|
|
12
|
+
// - OWASP LLM06
|
|
13
|
+
//
|
|
14
|
+
// Category: data-protection
|
|
15
|
+
// Namespace: Guardrails
|
|
16
|
+
// =============================================================================
|
|
17
|
+
|
|
18
|
+
@id("data-protection.data-pipeline-block-secrets")
|
|
19
|
+
@name("Block secrets in data pipeline")
|
|
20
|
+
@description("Blocks process_prompt, call_tool, read_file, and write_file when secrets_detected is true.")
|
|
21
|
+
@severity("critical")
|
|
22
|
+
@tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
|
|
23
|
+
@reject_message("Request blocked: secrets detected in a data pipeline — any credential exposure is unacceptable here.")
|
|
24
|
+
forbid (
|
|
25
|
+
principal,
|
|
26
|
+
action in [
|
|
27
|
+
Guardrails::Action::"process_prompt",
|
|
28
|
+
Guardrails::Action::"call_tool",
|
|
29
|
+
Guardrails::Action::"read_file",
|
|
30
|
+
Guardrails::Action::"write_file"
|
|
31
|
+
],
|
|
32
|
+
resource
|
|
33
|
+
)
|
|
34
|
+
when {
|
|
35
|
+
context has secrets_detected && context.secrets_detected == true
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
@id("data-protection.data-pipeline-block-secrets-output")
|
|
39
|
+
@name("Block secrets in pipeline outputs")
|
|
40
|
+
@description("Blocks write_file when secrets_detected is true or secret_count >= 1.")
|
|
41
|
+
@severity("critical")
|
|
42
|
+
@tags("category:data-protection,threat:secrets,detection:rule,surface:write-file,owasp:llm06")
|
|
43
|
+
@reject_message("File write blocked: secrets detected in pipeline output — credentials must not be persisted.")
|
|
44
|
+
forbid (
|
|
45
|
+
principal,
|
|
46
|
+
action == Guardrails::Action::"write_file",
|
|
47
|
+
resource
|
|
48
|
+
)
|
|
49
|
+
when {
|
|
50
|
+
(context has secrets_detected && context.secrets_detected == true) ||
|
|
51
|
+
(context has secret_count && context.secret_count >= 1)
|
|
52
|
+
};
|
|
@@ -4,37 +4,60 @@
|
|
|
4
4
|
// Strict PII protection for RAG pipelines and data processing agents.
|
|
5
5
|
// Zero-tolerance for sensitive PII types — data pipelines must not leak PII.
|
|
6
6
|
//
|
|
7
|
-
//
|
|
7
|
+
// Context keys consumed:
|
|
8
|
+
// - pii_detected: Bool
|
|
9
|
+
// - pii_types: Set<String>
|
|
10
|
+
//
|
|
11
|
+
// Compliance:
|
|
12
|
+
// - GDPR Art. 32, HIPAA §164.312, PCI DSS 3.4
|
|
13
|
+
//
|
|
14
|
+
// Category: privacy
|
|
8
15
|
// Namespace: Guardrails
|
|
9
16
|
// =============================================================================
|
|
10
17
|
|
|
11
|
-
@id("data-
|
|
12
|
-
@name("Block
|
|
13
|
-
@description("
|
|
18
|
+
@id("privacy.data-pipeline-block-pii")
|
|
19
|
+
@name("Block PII in data pipeline")
|
|
20
|
+
@description("Blocks process_prompt, call_tool, read_file, and write_file when pii_detected is true.")
|
|
14
21
|
@severity("critical")
|
|
15
|
-
@tags("
|
|
22
|
+
@tags("category:privacy,threat:pii,detection:rule,compliance:gdpr,compliance:hipaa")
|
|
23
|
+
@reject_message("Request blocked: PII detected in a data pipeline — pipelines must not process or leak personal data.")
|
|
16
24
|
forbid (
|
|
17
25
|
principal,
|
|
18
|
-
action in [
|
|
26
|
+
action in [
|
|
27
|
+
Guardrails::Action::"process_prompt",
|
|
28
|
+
Guardrails::Action::"call_tool",
|
|
29
|
+
Guardrails::Action::"read_file",
|
|
30
|
+
Guardrails::Action::"write_file"
|
|
31
|
+
],
|
|
19
32
|
resource
|
|
20
|
-
)
|
|
33
|
+
)
|
|
34
|
+
when {
|
|
21
35
|
context has pii_detected && context.pii_detected == true
|
|
22
36
|
};
|
|
23
37
|
|
|
24
|
-
@id("data-
|
|
25
|
-
@name("Block sensitive PII types
|
|
26
|
-
@description("
|
|
38
|
+
@id("privacy.data-pipeline-block-pii-sensitive")
|
|
39
|
+
@name("Block sensitive PII types in data pipeline")
|
|
40
|
+
@description("Blocks process_prompt, call_tool, read_file, and write_file when pii_types contains SSN, credit_card, passport, medical_id, or tax_id.")
|
|
27
41
|
@severity("critical")
|
|
28
|
-
@tags("
|
|
42
|
+
@tags("category:privacy,threat:pii,detection:rule,compliance:gdpr,compliance:hipaa,compliance:pci-dss")
|
|
43
|
+
@reject_message("Request blocked: highly sensitive PII (SSN, credit card, passport, medical ID, or tax ID) detected in a data pipeline.")
|
|
29
44
|
forbid (
|
|
30
45
|
principal,
|
|
31
|
-
action in [
|
|
46
|
+
action in [
|
|
47
|
+
Guardrails::Action::"process_prompt",
|
|
48
|
+
Guardrails::Action::"call_tool",
|
|
49
|
+
Guardrails::Action::"read_file",
|
|
50
|
+
Guardrails::Action::"write_file"
|
|
51
|
+
],
|
|
32
52
|
resource
|
|
33
|
-
)
|
|
53
|
+
)
|
|
54
|
+
when {
|
|
34
55
|
context has pii_types &&
|
|
35
|
-
(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
56
|
+
(
|
|
57
|
+
context.pii_types.contains("ssn") ||
|
|
58
|
+
context.pii_types.contains("credit_card") ||
|
|
59
|
+
context.pii_types.contains("passport") ||
|
|
60
|
+
context.pii_types.contains("medical_id") ||
|
|
61
|
+
context.pii_types.contains("tax_id")
|
|
62
|
+
)
|
|
40
63
|
};
|