@highflame/policy 2.2.29 → 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.
- package/_schemas/agent_ops/context.json +1272 -439
- package/_schemas/agent_ops/schema.cedarschema +24 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_cross_origin.cedar +92 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_escalation.cedar +99 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_identity_enforcement.cedar +101 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_inter_agent_injection.cedar +120 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_claude_block_injection.cedar +30 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_defaults.cedar +122 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_safety.cedar +164 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_trust.cedar +143 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_security_data_pipeline.cedar +45 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_security_defaults.cedar +164 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_security_malicious_package.cedar +59 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_security_param_validation.cedar +119 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_security_tool_risk.cedar +66 -0
- package/_schemas/agent_ops/templates/ported/code-security/agent_identity_a2a_supply_chain.cedar +101 -0
- package/_schemas/agent_ops/templates/ported/code-security/agent_security_code_agent.cedar +130 -0
- package/_schemas/agent_ops/templates/ported/code-security/agent_security_code_agent_supply_chain.cedar +116 -0
- package/_schemas/agent_ops/templates/ported/code-security/security_code_agent_encoding.cedar +51 -0
- package/_schemas/agent_ops/templates/ported/code-security/security_code_agent_path_security.cedar +149 -0
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_chat_assistant.cedar +58 -0
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_defaults.cedar +111 -0
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_semantic.cedar +78 -0
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_toxicity.cedar +71 -0
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_advanced_secrets.cedar +74 -0
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_code_block_write_secrets.cedar +26 -0
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_data_pipeline.cedar +52 -0
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_defaults.cedar +57 -0
- package/_schemas/agent_ops/templates/ported/data-protection/privacy_advanced_pii.cedar +465 -0
- package/_schemas/agent_ops/templates/ported/data-protection/privacy_defaults.cedar +164 -0
- package/_schemas/agent_ops/templates/ported/data-protection/privacy_pii_model.cedar +90 -0
- package/_schemas/agent_ops/templates/ported/organization/organization_deny_baseline.cedar +22 -0
- package/_schemas/agent_ops/templates/ported/organization/organization_team_permissions.cedar +38 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/security_advanced_block_critical_severity.cedar +30 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/security_chat_assistant.cedar +47 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/security_data_pipeline_block_injection.cedar +31 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/security_injection.cedar +82 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/security_patterns.cedar +72 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/semantic_defaults.cedar +155 -0
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_bash_operation_classes.cedar +142 -0
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_block_shell.cedar +40 -0
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_defaults.cedar +76 -0
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_mcp_server_allowlist.cedar +41 -0
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_mcp_tool_permissions.cedar +103 -0
- package/_schemas/agent_ops/templates/templates.json +752 -8
- package/_schemas/ai_gateway/context.json +2 -2
- package/_schemas/guardrails/context.json +2 -2
- package/_schemas/guardrails/templates/templates.json +6 -1
- package/_schemas/overwatch/context.json +3 -3
- package/dist/aarm-annotations.gen.js +1 -1
- package/dist/agent_ops-context.gen.d.ts +5 -1
- package/dist/agent_ops-context.gen.js +8 -0
- package/dist/agent_ops-defaults.gen.js +5168 -8
- package/dist/guardrails-defaults.gen.js +6 -1
- package/dist/overwatch-defaults.gen.js +109 -0
- package/dist/service-schemas.gen.d.ts +1 -1
- package/dist/service-schemas.gen.js +48 -12
- package/package.json +1 -1
package/_schemas/agent_ops/templates/ported/code-security/security_code_agent_path_security.cedar
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Code Agent — Path Security
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Blocks access to sensitive file paths: environment files, credential files,
|
|
5
|
+
// system directories, and credential/key directories. Also blocks destructive
|
|
6
|
+
// file operations (delete, rmdir, unlink) by default.
|
|
7
|
+
//
|
|
8
|
+
// Context keys consumed:
|
|
9
|
+
// - path: String
|
|
10
|
+
// - tool_name: String
|
|
11
|
+
//
|
|
12
|
+
// Compliance:
|
|
13
|
+
// - NIST 800-53 AC-6, SC-28; MITRE ATT&CK T1552, T1005; CIS 1.4
|
|
14
|
+
//
|
|
15
|
+
// Category: security
|
|
16
|
+
// Namespace: AgentOps
|
|
17
|
+
// =============================================================================
|
|
18
|
+
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Section 1: Environment files (.env*)
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
|
|
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*.")
|
|
26
|
+
@severity("high")
|
|
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.")
|
|
29
|
+
forbid (
|
|
30
|
+
principal,
|
|
31
|
+
action in [AgentOps::Action::"read_file", AgentOps::Action::"write_file", AgentOps::Action::"call_tool"],
|
|
32
|
+
resource
|
|
33
|
+
)
|
|
34
|
+
when {
|
|
35
|
+
context has path && context.path like "*.env*"
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// Section 2: Credential files
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
|
|
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.")
|
|
45
|
+
@severity("high")
|
|
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.")
|
|
48
|
+
forbid (
|
|
49
|
+
principal,
|
|
50
|
+
action in [AgentOps::Action::"read_file", AgentOps::Action::"write_file", AgentOps::Action::"call_tool"],
|
|
51
|
+
resource
|
|
52
|
+
)
|
|
53
|
+
when {
|
|
54
|
+
context has path &&
|
|
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
|
+
)
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Section 3: System directories
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
|
|
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.")
|
|
74
|
+
@severity("high")
|
|
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.")
|
|
77
|
+
forbid (
|
|
78
|
+
principal,
|
|
79
|
+
action in [AgentOps::Action::"read_file", AgentOps::Action::"write_file", AgentOps::Action::"call_tool"],
|
|
80
|
+
resource
|
|
81
|
+
)
|
|
82
|
+
when {
|
|
83
|
+
context has path &&
|
|
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
|
+
)
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
// Section 4: Credential and key directories
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
|
|
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.")
|
|
101
|
+
@severity("critical")
|
|
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.")
|
|
104
|
+
forbid (
|
|
105
|
+
principal,
|
|
106
|
+
action in [AgentOps::Action::"read_file", AgentOps::Action::"write_file", AgentOps::Action::"call_tool"],
|
|
107
|
+
resource
|
|
108
|
+
)
|
|
109
|
+
when {
|
|
110
|
+
context has path &&
|
|
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
|
+
};
|
|
123
|
+
|
|
124
|
+
// ---------------------------------------------------------------------------
|
|
125
|
+
// Section 5: Destructive file operations
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
|
|
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.")
|
|
131
|
+
@severity("high")
|
|
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.")
|
|
134
|
+
forbid (
|
|
135
|
+
principal,
|
|
136
|
+
action == AgentOps::Action::"call_tool",
|
|
137
|
+
resource
|
|
138
|
+
)
|
|
139
|
+
when {
|
|
140
|
+
context has tool_name &&
|
|
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
|
+
)
|
|
149
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Chat Assistant — Trust & Safety
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Strict content moderation for customer-facing chatbots. Lower toxicity
|
|
5
|
+
// thresholds than defaults plus topic restrictions for public-facing
|
|
6
|
+
// content.
|
|
7
|
+
//
|
|
8
|
+
// Context keys consumed:
|
|
9
|
+
// - violence_score, hate_speech_score, sexual_score, profanity_score: Long
|
|
10
|
+
// - content_topics: Set<String>
|
|
11
|
+
// - topic_confidence: Long (0-100)
|
|
12
|
+
//
|
|
13
|
+
// Compliance:
|
|
14
|
+
// - EU AI Act, ISO 42001
|
|
15
|
+
//
|
|
16
|
+
// Category: trust-safety
|
|
17
|
+
// Namespace: AgentOps
|
|
18
|
+
// =============================================================================
|
|
19
|
+
|
|
20
|
+
@id("trust-safety.chat-block-toxicity")
|
|
21
|
+
@name("Block toxicity (chat profile)")
|
|
22
|
+
@description("Blocks process_prompt when any toxicity score is >= 71 (lower threshold for public chat).")
|
|
23
|
+
@severity("critical")
|
|
24
|
+
@tags("category:trust-safety,threat:harmful,threat:hate-speech,detection:ml,compliance:eu-ai-act")
|
|
25
|
+
@reject_message("Prompt blocked: toxic content detected at the chat-profile threshold.")
|
|
26
|
+
forbid (
|
|
27
|
+
principal,
|
|
28
|
+
action == AgentOps::Action::"process_prompt",
|
|
29
|
+
resource
|
|
30
|
+
)
|
|
31
|
+
when {
|
|
32
|
+
(context has violence_score && context.violence_score >= 71) ||
|
|
33
|
+
(context has hate_speech_score && context.hate_speech_score >= 71) ||
|
|
34
|
+
(context has sexual_score && context.sexual_score >= 71) ||
|
|
35
|
+
(context has profanity_score && context.profanity_score >= 71)
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
@id("trust-safety.chat-block-restricted-topics")
|
|
39
|
+
@name("Block restricted topics (chat profile)")
|
|
40
|
+
@description("Blocks process_prompt and call_tool when topic_confidence >= 71 and content_topics contains a restricted category.")
|
|
41
|
+
@severity("high")
|
|
42
|
+
@tags("category:trust-safety,threat:harmful,detection:ml,compliance:eu-ai-act")
|
|
43
|
+
@reject_message("Prompt blocked: content discusses a topic restricted for chat assistants.")
|
|
44
|
+
forbid (
|
|
45
|
+
principal,
|
|
46
|
+
action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
|
|
47
|
+
resource
|
|
48
|
+
)
|
|
49
|
+
when {
|
|
50
|
+
context has topic_confidence && context.topic_confidence >= 71 &&
|
|
51
|
+
context has content_topics &&
|
|
52
|
+
(
|
|
53
|
+
context.content_topics.contains("weapons_manufacturing") ||
|
|
54
|
+
context.content_topics.contains("illegal_activity") ||
|
|
55
|
+
context.content_topics.contains("controlled_substances") ||
|
|
56
|
+
context.content_topics.contains("financial_fraud")
|
|
57
|
+
)
|
|
58
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Content Safety (Default)
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Blocks unsafe content using ML classifier scores: violence, weapons, hate
|
|
5
|
+
// speech, criminal activity, sexual content, and excessive profanity.
|
|
6
|
+
//
|
|
7
|
+
// Thresholds:
|
|
8
|
+
// - violence, weapons, sexual, crime: >= 80 (critical/high)
|
|
9
|
+
// - hate_speech: >= 75 (lower threshold, zero tolerance)
|
|
10
|
+
// - profanity: >= 90 (higher threshold, allows normal expression)
|
|
11
|
+
//
|
|
12
|
+
// Context keys consumed:
|
|
13
|
+
// - violence_score, weapons_score, hate_speech_score: Long (0-100)
|
|
14
|
+
// - crime_score, sexual_score, profanity_score: Long (0-100)
|
|
15
|
+
//
|
|
16
|
+
// Compliance:
|
|
17
|
+
// - NIST 800-53 SI-4; ISO 42001; EU AI Act Art. 52
|
|
18
|
+
//
|
|
19
|
+
// Category: trust-safety
|
|
20
|
+
// Namespace: AgentOps
|
|
21
|
+
// =============================================================================
|
|
22
|
+
|
|
23
|
+
@id("trust-safety.block-violence")
|
|
24
|
+
@name("Block violent content")
|
|
25
|
+
@description("Blocks process_prompt and call_tool when violence_score >= 80.")
|
|
26
|
+
@severity("critical")
|
|
27
|
+
@tags("category:trust-safety,threat:violence,detection:ml,compliance:nist-si-4,compliance:iso-42001")
|
|
28
|
+
@reject_message("Content blocked: violent content detected.")
|
|
29
|
+
forbid (
|
|
30
|
+
principal,
|
|
31
|
+
action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
|
|
32
|
+
resource
|
|
33
|
+
)
|
|
34
|
+
when {
|
|
35
|
+
context has violence_score && context.violence_score >= 80
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
@id("trust-safety.block-weapons")
|
|
39
|
+
@name("Block weapons content")
|
|
40
|
+
@description("Blocks process_prompt and call_tool when weapons_score >= 80.")
|
|
41
|
+
@severity("critical")
|
|
42
|
+
@tags("category:trust-safety,threat:weapons,detection:ml,compliance:nist-si-4")
|
|
43
|
+
@reject_message("Content blocked: weapons-related content detected (manufacturing, procurement, or specifications).")
|
|
44
|
+
forbid (
|
|
45
|
+
principal,
|
|
46
|
+
action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
|
|
47
|
+
resource
|
|
48
|
+
)
|
|
49
|
+
when {
|
|
50
|
+
context has weapons_score && context.weapons_score >= 80
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
@id("trust-safety.block-hate-speech")
|
|
54
|
+
@name("Block hate speech")
|
|
55
|
+
@description("Blocks process_prompt and call_tool when hate_speech_score >= 75.")
|
|
56
|
+
@severity("critical")
|
|
57
|
+
@tags("category:trust-safety,threat:hate-speech,detection:ml,compliance:nist-si-4,compliance:eu-ai-act")
|
|
58
|
+
@reject_message("Content blocked: hate speech or discriminatory content detected.")
|
|
59
|
+
forbid (
|
|
60
|
+
principal,
|
|
61
|
+
action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
|
|
62
|
+
resource
|
|
63
|
+
)
|
|
64
|
+
when {
|
|
65
|
+
context has hate_speech_score && context.hate_speech_score >= 75
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
@id("trust-safety.block-crime")
|
|
69
|
+
@name("Block criminal content")
|
|
70
|
+
@description("Blocks process_prompt and call_tool when crime_score >= 80.")
|
|
71
|
+
@severity("high")
|
|
72
|
+
@tags("category:trust-safety,threat:crime,detection:ml,compliance:nist-si-4")
|
|
73
|
+
@reject_message("Content blocked: criminal activity content detected (illegal activity, fraud, or related).")
|
|
74
|
+
forbid (
|
|
75
|
+
principal,
|
|
76
|
+
action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
|
|
77
|
+
resource
|
|
78
|
+
)
|
|
79
|
+
when {
|
|
80
|
+
context has crime_score && context.crime_score >= 80
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
@id("trust-safety.block-sexual")
|
|
84
|
+
@name("Block sexual content")
|
|
85
|
+
@description("Blocks process_prompt and call_tool when sexual_score >= 80.")
|
|
86
|
+
@severity("high")
|
|
87
|
+
@tags("category:trust-safety,threat:sexual,detection:ml,compliance:eu-ai-act,compliance:iso-42001")
|
|
88
|
+
@reject_message("Content blocked: sexually explicit content detected.")
|
|
89
|
+
forbid (
|
|
90
|
+
principal,
|
|
91
|
+
action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
|
|
92
|
+
resource
|
|
93
|
+
)
|
|
94
|
+
when {
|
|
95
|
+
context has sexual_score && context.sexual_score >= 80
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
@id("trust-safety.block-profanity")
|
|
99
|
+
@name("Block excessive profanity")
|
|
100
|
+
@description("Blocks process_prompt and call_tool when profanity_score >= 90.")
|
|
101
|
+
@severity("medium")
|
|
102
|
+
@tags("category:trust-safety,threat:profanity,detection:ml")
|
|
103
|
+
@reject_message("Content blocked: excessive profanity detected — please rephrase in professional language.")
|
|
104
|
+
forbid (
|
|
105
|
+
principal,
|
|
106
|
+
action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
|
|
107
|
+
resource
|
|
108
|
+
)
|
|
109
|
+
when {
|
|
110
|
+
context has profanity_score && context.profanity_score >= 90
|
|
111
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Semantic Topic Enforcement (Default)
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Blocks content based on semantic topic classification — used for
|
|
5
|
+
// application-specific topic restrictions (medical, weapons, illegal
|
|
6
|
+
// activity, etc.).
|
|
7
|
+
//
|
|
8
|
+
// Context keys consumed:
|
|
9
|
+
// - content_topics: Set<String>
|
|
10
|
+
// - topic_confidence: Long (0-100)
|
|
11
|
+
//
|
|
12
|
+
// Compliance:
|
|
13
|
+
// - EU AI Act, ISO 42001
|
|
14
|
+
//
|
|
15
|
+
// Category: trust-safety
|
|
16
|
+
// Namespace: AgentOps
|
|
17
|
+
// =============================================================================
|
|
18
|
+
|
|
19
|
+
@id("trust-safety.block-dangerous-topics")
|
|
20
|
+
@name("Block dangerous topics")
|
|
21
|
+
@description("Blocks process_prompt when content_topics contains weapons or explosives categories.")
|
|
22
|
+
@severity("critical")
|
|
23
|
+
@tags("category:trust-safety,threat:harmful,detection:ml,compliance:eu-ai-act")
|
|
24
|
+
@reject_message("Prompt blocked: content classified under a dangerous topic (weapons, explosives, illegal synthesis).")
|
|
25
|
+
forbid (
|
|
26
|
+
principal,
|
|
27
|
+
action == AgentOps::Action::"process_prompt",
|
|
28
|
+
resource
|
|
29
|
+
)
|
|
30
|
+
when {
|
|
31
|
+
context has content_topics &&
|
|
32
|
+
(
|
|
33
|
+
context.content_topics.contains("weapons_manufacturing") ||
|
|
34
|
+
context.content_topics.contains("explosive_materials") ||
|
|
35
|
+
context.content_topics.contains("illegal_synthesis")
|
|
36
|
+
)
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
@id("trust-safety.block-controlled-substances")
|
|
40
|
+
@name("Block controlled substances")
|
|
41
|
+
@description("Blocks process_prompt when content_topics contains controlled substances or precursor chemicals.")
|
|
42
|
+
@severity("high")
|
|
43
|
+
@tags("category:trust-safety,threat:harmful,detection:ml,compliance:eu-ai-act")
|
|
44
|
+
@reject_message("Prompt blocked: content discusses controlled substances or precursor chemicals.")
|
|
45
|
+
forbid (
|
|
46
|
+
principal,
|
|
47
|
+
action == AgentOps::Action::"process_prompt",
|
|
48
|
+
resource
|
|
49
|
+
)
|
|
50
|
+
when {
|
|
51
|
+
context has content_topics &&
|
|
52
|
+
(
|
|
53
|
+
context.content_topics.contains("controlled_substances") ||
|
|
54
|
+
context.content_topics.contains("drug_manufacturing") ||
|
|
55
|
+
context.content_topics.contains("precursor_chemicals")
|
|
56
|
+
)
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
@id("trust-safety.block-restricted-topics")
|
|
60
|
+
@name("Block high-confidence restricted topics")
|
|
61
|
+
@description("Blocks process_prompt when topic_confidence >= 81 and content_topics contains a restricted category.")
|
|
62
|
+
@severity("high")
|
|
63
|
+
@tags("category:trust-safety,threat:harmful,detection:ml")
|
|
64
|
+
@reject_message("Prompt blocked: content high-confidence classified into a restricted topic (illegal activity, fraud, social engineering).")
|
|
65
|
+
forbid (
|
|
66
|
+
principal,
|
|
67
|
+
action == AgentOps::Action::"process_prompt",
|
|
68
|
+
resource
|
|
69
|
+
)
|
|
70
|
+
when {
|
|
71
|
+
context has topic_confidence && context.topic_confidence >= 81 &&
|
|
72
|
+
context has content_topics &&
|
|
73
|
+
(
|
|
74
|
+
context.content_topics.contains("illegal_activity") ||
|
|
75
|
+
context.content_topics.contains("financial_fraud") ||
|
|
76
|
+
context.content_topics.contains("social_engineering")
|
|
77
|
+
)
|
|
78
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Toxicity & Content Moderation (Default)
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Blocks toxic, harmful, or inappropriate content across the six standard
|
|
5
|
+
// toxicity dimensions. Three rules: a strict critical-threshold catch-all,
|
|
6
|
+
// a hate-speech-specific lower threshold, and a "any two moderate signals"
|
|
7
|
+
// combined-toxicity rule.
|
|
8
|
+
//
|
|
9
|
+
// Context keys consumed:
|
|
10
|
+
// - violence_score: Long (0-100)
|
|
11
|
+
// - hate_speech_score: Long (0-100)
|
|
12
|
+
// - sexual_score: Long (0-100)
|
|
13
|
+
// - weapons_score: Long (0-100)
|
|
14
|
+
// - crime_score: Long (0-100)
|
|
15
|
+
// - profanity_score: Long (0-100)
|
|
16
|
+
//
|
|
17
|
+
// Compliance:
|
|
18
|
+
// - EU AI Act, ISO 42001, NIST SI-4
|
|
19
|
+
//
|
|
20
|
+
// Category: trust-safety
|
|
21
|
+
// Namespace: AgentOps
|
|
22
|
+
// =============================================================================
|
|
23
|
+
|
|
24
|
+
@id("trust-safety.block-toxicity-critical")
|
|
25
|
+
@name("Block critical toxicity")
|
|
26
|
+
@description("Blocks process_prompt when any toxicity score is >= 91.")
|
|
27
|
+
@severity("critical")
|
|
28
|
+
@tags("category:trust-safety,threat:harmful,detection:ml,compliance:eu-ai-act,compliance:iso-42001")
|
|
29
|
+
@reject_message("Prompt blocked: critical-severity toxic content detected.")
|
|
30
|
+
forbid (
|
|
31
|
+
principal,
|
|
32
|
+
action == AgentOps::Action::"process_prompt",
|
|
33
|
+
resource
|
|
34
|
+
)
|
|
35
|
+
when {
|
|
36
|
+
(context has violence_score && context.violence_score >= 91) ||
|
|
37
|
+
(context has hate_speech_score && context.hate_speech_score >= 91) ||
|
|
38
|
+
(context has sexual_score && context.sexual_score >= 91) ||
|
|
39
|
+
(context has weapons_score && context.weapons_score >= 91) ||
|
|
40
|
+
(context has crime_score && context.crime_score >= 91) ||
|
|
41
|
+
(context has profanity_score && context.profanity_score >= 91)
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
@id("trust-safety.block-toxicity-combined")
|
|
45
|
+
@name("Block combined toxicity")
|
|
46
|
+
@description("Blocks process_prompt when any two toxicity scores are >= 61.")
|
|
47
|
+
@severity("high")
|
|
48
|
+
@tags("category:trust-safety,threat:harmful,detection:aggregate")
|
|
49
|
+
@reject_message("Prompt blocked: multiple moderate toxicity signals were detected together.")
|
|
50
|
+
forbid (
|
|
51
|
+
principal,
|
|
52
|
+
action == AgentOps::Action::"process_prompt",
|
|
53
|
+
resource
|
|
54
|
+
)
|
|
55
|
+
when {
|
|
56
|
+
(context has violence_score && context has hate_speech_score && context.violence_score >= 61 && context.hate_speech_score >= 61) ||
|
|
57
|
+
(context has violence_score && context has sexual_score && context.violence_score >= 61 && context.sexual_score >= 61) ||
|
|
58
|
+
(context has violence_score && context has weapons_score && context.violence_score >= 61 && context.weapons_score >= 61) ||
|
|
59
|
+
(context has violence_score && context has crime_score && context.violence_score >= 61 && context.crime_score >= 61) ||
|
|
60
|
+
(context has violence_score && context has profanity_score && context.violence_score >= 61 && context.profanity_score >= 61) ||
|
|
61
|
+
(context has hate_speech_score && context has sexual_score && context.hate_speech_score >= 61 && context.sexual_score >= 61) ||
|
|
62
|
+
(context has hate_speech_score && context has weapons_score && context.hate_speech_score >= 61 && context.weapons_score >= 61) ||
|
|
63
|
+
(context has hate_speech_score && context has crime_score && context.hate_speech_score >= 61 && context.crime_score >= 61) ||
|
|
64
|
+
(context has hate_speech_score && context has profanity_score && context.hate_speech_score >= 61 && context.profanity_score >= 61) ||
|
|
65
|
+
(context has sexual_score && context has weapons_score && context.sexual_score >= 61 && context.weapons_score >= 61) ||
|
|
66
|
+
(context has sexual_score && context has crime_score && context.sexual_score >= 61 && context.crime_score >= 61) ||
|
|
67
|
+
(context has sexual_score && context has profanity_score && context.sexual_score >= 61 && context.profanity_score >= 61) ||
|
|
68
|
+
(context has weapons_score && context has crime_score && context.weapons_score >= 61 && context.crime_score >= 61) ||
|
|
69
|
+
(context has weapons_score && context has profanity_score && context.weapons_score >= 61 && context.profanity_score >= 61) ||
|
|
70
|
+
(context has crime_score && context has profanity_score && context.crime_score >= 61 && context.profanity_score >= 61)
|
|
71
|
+
};
|
package/_schemas/agent_ops/templates/ported/data-protection/data_protection_advanced_secrets.cedar
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Advanced Detection — Granular Secrets
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Blocks specific high-risk credential types using granular secret_types
|
|
5
|
+
// matching. Goes beyond the boolean secrets_detected flag to identify
|
|
6
|
+
// cloud provider keys, GitHub tokens, SSH keys, database credentials,
|
|
7
|
+
// and general API tokens.
|
|
8
|
+
//
|
|
9
|
+
// Context keys consumed:
|
|
10
|
+
// - secret_types: Set<String>
|
|
11
|
+
//
|
|
12
|
+
// Compliance:
|
|
13
|
+
// - NIST 800-53 IA-5, SC-28; MITRE ATT&CK T1552; CIS 1.4
|
|
14
|
+
//
|
|
15
|
+
// Category: data-protection
|
|
16
|
+
// Namespace: AgentOps
|
|
17
|
+
// =============================================================================
|
|
18
|
+
|
|
19
|
+
@id("data-protection.advanced-block-high-risk-secrets")
|
|
20
|
+
@name("Block high-risk credential types")
|
|
21
|
+
@description("Blocks process_prompt, call_tool, read_file, and write_file when secret_types contains a cloud, GitHub, SSH, or database credential.")
|
|
22
|
+
@severity("critical")
|
|
23
|
+
@tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
|
|
24
|
+
@reject_message("Content blocked: high-risk credentials detected (cloud keys, GitHub tokens, SSH keys, or database URLs).")
|
|
25
|
+
forbid (
|
|
26
|
+
principal,
|
|
27
|
+
action in [
|
|
28
|
+
AgentOps::Action::"process_prompt",
|
|
29
|
+
AgentOps::Action::"call_tool",
|
|
30
|
+
AgentOps::Action::"read_file",
|
|
31
|
+
AgentOps::Action::"write_file"
|
|
32
|
+
],
|
|
33
|
+
resource
|
|
34
|
+
)
|
|
35
|
+
when {
|
|
36
|
+
context has secret_types &&
|
|
37
|
+
(
|
|
38
|
+
context.secret_types.contains("aws_access_key") ||
|
|
39
|
+
context.secret_types.contains("aws_secret_key") ||
|
|
40
|
+
context.secret_types.contains("gcp_service_account") ||
|
|
41
|
+
context.secret_types.contains("azure_client_secret") ||
|
|
42
|
+
context.secret_types.contains("github_token") ||
|
|
43
|
+
context.secret_types.contains("github_pat") ||
|
|
44
|
+
context.secret_types.contains("ssh_private_key") ||
|
|
45
|
+
context.secret_types.contains("database_url")
|
|
46
|
+
)
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
@id("data-protection.advanced-block-api-tokens")
|
|
50
|
+
@name("Block API keys and bearer tokens")
|
|
51
|
+
@description("Blocks process_prompt, call_tool, read_file, and write_file when secret_types contains api_key, bearer_token, jwt_token, or OAuth credentials.")
|
|
52
|
+
@severity("high")
|
|
53
|
+
@tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
|
|
54
|
+
@reject_message("Content blocked: API keys, bearer tokens, or OAuth credentials detected.")
|
|
55
|
+
forbid (
|
|
56
|
+
principal,
|
|
57
|
+
action in [
|
|
58
|
+
AgentOps::Action::"process_prompt",
|
|
59
|
+
AgentOps::Action::"call_tool",
|
|
60
|
+
AgentOps::Action::"read_file",
|
|
61
|
+
AgentOps::Action::"write_file"
|
|
62
|
+
],
|
|
63
|
+
resource
|
|
64
|
+
)
|
|
65
|
+
when {
|
|
66
|
+
context has secret_types &&
|
|
67
|
+
(
|
|
68
|
+
context.secret_types.contains("api_key") ||
|
|
69
|
+
context.secret_types.contains("bearer_token") ||
|
|
70
|
+
context.secret_types.contains("jwt_token") ||
|
|
71
|
+
context.secret_types.contains("oauth_token") ||
|
|
72
|
+
context.secret_types.contains("oauth_secret")
|
|
73
|
+
)
|
|
74
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Code Agent — Secrets Protection
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Prevents code agents from writing detected secrets to output files.
|
|
5
|
+
//
|
|
6
|
+
// Context keys consumed:
|
|
7
|
+
// - secrets_detected: Bool
|
|
8
|
+
//
|
|
9
|
+
// Category: data-protection
|
|
10
|
+
// Namespace: AgentOps
|
|
11
|
+
// =============================================================================
|
|
12
|
+
|
|
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.")
|
|
16
|
+
@severity("critical")
|
|
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.")
|
|
19
|
+
forbid (
|
|
20
|
+
principal,
|
|
21
|
+
action == AgentOps::Action::"write_file",
|
|
22
|
+
resource
|
|
23
|
+
)
|
|
24
|
+
when {
|
|
25
|
+
context has secrets_detected && context.secrets_detected == true
|
|
26
|
+
};
|
package/_schemas/agent_ops/templates/ported/data-protection/data_protection_data_pipeline.cedar
ADDED
|
@@ -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: AgentOps
|
|
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
|
+
AgentOps::Action::"process_prompt",
|
|
28
|
+
AgentOps::Action::"call_tool",
|
|
29
|
+
AgentOps::Action::"read_file",
|
|
30
|
+
AgentOps::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 == AgentOps::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
|
+
};
|