@highflame/policy 2.2.35 → 2.2.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/agent_ops/context.json +822 -0
- package/_schemas/agent_ops/schema.cedarschema +134 -109
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_cross_origin.cedar +6 -4
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_escalation.cedar +5 -4
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_inter_agent_injection.cedar +9 -8
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_claude_block_injection.cedar +2 -2
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_defaults.cedar +3 -3
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_trust.cedar +6 -6
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_chat_assistant.cedar +5 -4
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_defaults.cedar +18 -12
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_semantic.cedar +6 -6
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_toxicity.cedar +4 -4
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_advanced_secrets.cedar +4 -2
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_data_pipeline.cedar +2 -1
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_defaults.cedar +4 -2
- package/_schemas/agent_ops/templates/ported/data-protection/privacy_advanced_pii.cedar +42 -21
- package/_schemas/agent_ops/templates/ported/data-protection/privacy_defaults.cedar +14 -7
- package/_schemas/agent_ops/templates/ported/data-protection/privacy_pii_model.cedar +10 -5
- package/_schemas/agent_ops/templates/ported/organization/organization_team_permissions.cedar +3 -2
- package/_schemas/agent_ops/templates/ported/threat-detection/security_advanced_block_critical_severity.cedar +3 -3
- package/_schemas/agent_ops/templates/ported/threat-detection/security_chat_assistant.cedar +5 -4
- package/_schemas/agent_ops/templates/ported/threat-detection/security_data_pipeline_block_injection.cedar +3 -2
- package/_schemas/agent_ops/templates/ported/threat-detection/security_injection.cedar +9 -8
- package/_schemas/agent_ops/templates/ported/threat-detection/security_patterns.cedar +5 -3
- package/_schemas/agent_ops/templates/ported/threat-detection/semantic_defaults.cedar +9 -7
- package/_schemas/ai_gateway/context.json +308 -0
- package/_schemas/ai_gateway/schema.cedarschema +44 -7
- package/_schemas/ai_gateway/templates/defaults/agent_security.cedar +5 -16
- package/_schemas/ai_gateway/templates/defaults/pii.cedar +14 -7
- package/_schemas/ai_gateway/templates/defaults/pii_advanced.cedar +42 -21
- package/_schemas/ai_gateway/templates/defaults/pii_model.cedar +10 -5
- package/_schemas/ai_gateway/templates/defaults/semantic.cedar +9 -74
- package/_schemas/ai_gateway/templates/defaults/tools.cedar +7 -38
- package/_schemas/ai_gateway/templates/secrets.cedar +3 -3
- package/_schemas/guardrails/context.json +701 -0
- package/_schemas/guardrails/schema.cedarschema +30 -2
- package/_schemas/guardrails/templates/defaults/agent_identity.cedar +3 -3
- package/_schemas/guardrails/templates/defaults/injection.cedar +9 -8
- package/_schemas/guardrails/templates/defaults/pii.cedar +14 -7
- package/_schemas/guardrails/templates/defaults/pii_model.cedar +10 -5
- package/_schemas/guardrails/templates/defaults/secrets.cedar +4 -2
- package/_schemas/guardrails/templates/defaults/security_patterns.cedar +5 -3
- package/_schemas/guardrails/templates/defaults/semantic.cedar +6 -6
- package/_schemas/guardrails/templates/defaults/toxicity.cedar +6 -6
- package/_schemas/guardrails/templates/profiles/a2a_security/cross_origin.cedar +6 -4
- package/_schemas/guardrails/templates/profiles/a2a_security/escalation_detection.cedar +5 -4
- package/_schemas/guardrails/templates/profiles/a2a_security/inter_agent_injection.cedar +9 -8
- package/_schemas/guardrails/templates/profiles/advanced_detection/pii.cedar +42 -21
- package/_schemas/guardrails/templates/profiles/advanced_detection/secrets.cedar +4 -2
- package/_schemas/guardrails/templates/profiles/chat_assistant/security.cedar +5 -4
- package/_schemas/guardrails/templates/profiles/chat_assistant/trust_safety.cedar +5 -4
- package/_schemas/guardrails/templates/profiles/data_pipeline/data_protection.cedar +2 -1
- package/_schemas/guardrails/templates/profiles/data_pipeline/security.cedar +3 -2
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_trust.cedar +6 -6
- package/_schemas/guardrails/templates/templates.json +0 -9
- package/_schemas/overwatch/context.json +30 -0
- package/_schemas/overwatch/schema.cedarschema +7 -0
- package/dist/agent_ops-context.gen.d.ts +6 -1
- package/dist/agent_ops-context.gen.js +10 -0
- package/dist/agent_ops-defaults.gen.js +177 -120
- package/dist/agent_ops-entities.gen.js +5 -1
- package/dist/ai_gateway-context.gen.d.ts +6 -1
- package/dist/ai_gateway-context.gen.js +10 -0
- package/dist/ai_gateway-defaults.gen.js +90 -164
- package/dist/ai_gateway-detectors.gen.js +6 -1
- package/dist/ai_gateway-entities.gen.js +6 -2
- package/dist/guardrails-context.gen.d.ts +6 -1
- package/dist/guardrails-context.gen.js +10 -0
- package/dist/guardrails-defaults.gen.js +144 -145
- package/dist/guardrails-detectors.gen.js +6 -1
- package/dist/guardrails-entities.gen.js +5 -1
- package/dist/overwatch-context.gen.d.ts +6 -1
- package/dist/overwatch-context.gen.js +10 -0
- package/dist/overwatch-detectors.gen.js +6 -1
- package/dist/service-schemas.gen.d.ts +4 -4
- package/dist/service-schemas.gen.js +528 -118
- package/package.json +1 -1
- package/_schemas/guardrails/templates/profiles/advanced_detection/threat_severity.cedar +0 -30
|
@@ -187,6 +187,36 @@
|
|
|
187
187
|
"required": false,
|
|
188
188
|
"description": "All operation classes observed in the tool call, emitted by the AST command classifiers. Subset of: 'readonly', 'write_enabling', 'execute_enabling', 'network_access', 'unknown'. A single command can carry several classes; combine with contains() to match shapes — e.g. tool_operation_classes.contains(\"network_access\") && tool_operation_classes.contains(\"execute_enabling\") catches download-and-run (curl | sh). 'unknown' appears when any unrecognized or variable-expanded command was seen and should be treated as deny-worthy."
|
|
189
189
|
},
|
|
190
|
+
{
|
|
191
|
+
"key": "resolved_target_paths",
|
|
192
|
+
"type": "string",
|
|
193
|
+
"required": false,
|
|
194
|
+
"description": "Newline-delimited (leading+trailing \\n) union of the statically-resolved absolute target paths a shell command touches, any capability, emitted by the bash AST detector. Cedar like is full-string anchored and every value starts with the \\n delimiter, so patterns must begin with '*': anchored sub-tree \"*\\n/etc/*\" (matches only paths under /etc, unlike the loose \"*/etc/*\" which also hits a project etc/ dir at any depth), bare directory \"*\\n/etc\\n*\" (e.g. rm -rf /etc, no trailing slash), exact file \"*\\n/etc/passwd\\n*\". Resolution is purely lexical (cwd-join + path.Clean; quoting, escapes, wrappers, cd/VAR/bash -c normalized); remote endpoints and dynamic operands are never fabricated. NOTE (AI Gateway): declared ahead of runtime emission — the gateway does not populate this until the bash classifier is wired (#173); policies validate now but will not match in the interim."
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"key": "read_target_paths",
|
|
198
|
+
"type": "string",
|
|
199
|
+
"required": false,
|
|
200
|
+
"description": "Newline-delimited resolved absolute paths a shell command reads or enumerates, emitted by the bash AST detector. \\n-anchored: match with like patterns that begin with '*' (see resolved_target_paths). NOTE (AI Gateway): declared ahead of runtime emission — the gateway does not populate this until the bash classifier is wired (#173); policies validate now but will not match in the interim."
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"key": "write_target_paths",
|
|
204
|
+
"type": "string",
|
|
205
|
+
"required": false,
|
|
206
|
+
"description": "Newline-delimited resolved absolute paths a shell command writes, creates, or destroys (redirects, cp/mv/dd, curl/wget -o, scp/rsync local dest, tar/unzip/cpio extraction, yq -i), emitted by the bash AST detector. \\n-anchored: e.g. write_target_paths like \"*\\n/etc/cron.d/*\". NOTE (AI Gateway): declared ahead of runtime emission — the gateway does not populate this until the bash classifier is wired (#173); policies validate now but will not match in the interim."
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"key": "exec_target_paths",
|
|
210
|
+
"type": "string",
|
|
211
|
+
"required": false,
|
|
212
|
+
"description": "Newline-delimited resolved absolute paths a shell command executes as a script, emitted by the bash AST detector. \\n-anchored: match with like patterns that begin with '*' (see resolved_target_paths). NOTE (AI Gateway): declared ahead of runtime emission — the gateway does not populate this until the bash classifier is wired (#173); policies validate now but will not match in the interim."
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"key": "unresolved_target",
|
|
216
|
+
"type": "boolean",
|
|
217
|
+
"required": false,
|
|
218
|
+
"description": "True when a shell command's target hid behind a variable, glob, command substitution, or inline shell code that static analysis could not resolve, or when the 64-path / 4096-byte path-list cap truncated the results. Benign dev traffic sets this frequently (variables, globs, and command substitution are everywhere, and the truncation cap trips it too), so it is NOT a deny signal on its own — combine it with a path or operation match, and reserve a blanket deny-on-unresolved rule for high-assurance or allowlisted environments. NOTE (AI Gateway): declared ahead of runtime emission — the gateway does not populate this until the bash classifier is wired (#173); policies validate now but will not match in the interim."
|
|
219
|
+
},
|
|
190
220
|
{
|
|
191
221
|
"key": "mcp_server_verified",
|
|
192
222
|
"type": "boolean",
|
|
@@ -1027,6 +1057,284 @@
|
|
|
1027
1057
|
}
|
|
1028
1058
|
]
|
|
1029
1059
|
},
|
|
1060
|
+
{
|
|
1061
|
+
"name": "process_response",
|
|
1062
|
+
"description": "Process a model response (LLM chat completion output) — threat focus: data leakage in output, harmful content, hallucination, indirect injection carried back to the caller. Distinct trigger from process_prompt (ADR 0031) so a policy can be scoped to one direction from its head and prompt-only detectors stay off the egress path.",
|
|
1063
|
+
"context_attributes": [
|
|
1064
|
+
{
|
|
1065
|
+
"key": "role",
|
|
1066
|
+
"type": "string",
|
|
1067
|
+
"required": false,
|
|
1068
|
+
"description": "Caller's RBAC role projected from the principal's token (AARM R6 / CAP-IDN-011), e.g. finance_lead. Absent when the token carries no role claim."
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
"key": "privilege_scope",
|
|
1072
|
+
"type": "array",
|
|
1073
|
+
"required": false,
|
|
1074
|
+
"description": "Privilege-scope strings granted to the caller, projected from the token (AARM R6 / CAP-IDN-011), e.g. transfer:approve. Absent when the token carries no claim."
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
"key": "content",
|
|
1078
|
+
"type": "string",
|
|
1079
|
+
"required": true,
|
|
1080
|
+
"description": "Raw content being scanned"
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"key": "mcp_server",
|
|
1084
|
+
"type": "string",
|
|
1085
|
+
"required": false,
|
|
1086
|
+
"description": "MCP server name"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"key": "threat_count",
|
|
1090
|
+
"type": "number",
|
|
1091
|
+
"required": false,
|
|
1092
|
+
"description": "Total threats detected"
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
"key": "highest_severity",
|
|
1096
|
+
"type": "string",
|
|
1097
|
+
"required": false,
|
|
1098
|
+
"description": "Highest threat severity"
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
"key": "threat_categories",
|
|
1102
|
+
"type": "array",
|
|
1103
|
+
"required": false,
|
|
1104
|
+
"description": "Threat category names"
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
"key": "detected_threats",
|
|
1108
|
+
"type": "array",
|
|
1109
|
+
"required": false,
|
|
1110
|
+
"description": "Detection rule names that matched"
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
"key": "max_threat_severity",
|
|
1114
|
+
"type": "number",
|
|
1115
|
+
"required": false,
|
|
1116
|
+
"description": "Numeric severity (0-4)"
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
"key": "secrets_detected",
|
|
1120
|
+
"type": "boolean",
|
|
1121
|
+
"required": false,
|
|
1122
|
+
"description": "Whether secrets/credentials detected"
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
"key": "secret_types",
|
|
1126
|
+
"type": "array",
|
|
1127
|
+
"required": false,
|
|
1128
|
+
"description": "Types of secrets found"
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
"key": "secret_count",
|
|
1132
|
+
"type": "number",
|
|
1133
|
+
"required": false,
|
|
1134
|
+
"description": "Number of distinct secrets"
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
"key": "pii_detected",
|
|
1138
|
+
"type": "boolean",
|
|
1139
|
+
"required": false,
|
|
1140
|
+
"description": "Whether PII detected"
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
"key": "pii_types",
|
|
1144
|
+
"type": "array",
|
|
1145
|
+
"required": false,
|
|
1146
|
+
"description": "Types of PII detected"
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
"key": "pii_count",
|
|
1150
|
+
"type": "number",
|
|
1151
|
+
"required": false,
|
|
1152
|
+
"description": "Number of PII matches"
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
"key": "pii_score",
|
|
1156
|
+
"type": "number",
|
|
1157
|
+
"required": false,
|
|
1158
|
+
"description": "PII classifier confidence (0-100)"
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
"key": "injection_score",
|
|
1162
|
+
"type": "number",
|
|
1163
|
+
"required": false,
|
|
1164
|
+
"description": "Injection classifier confidence (0-100)"
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
"key": "jailbreak_score",
|
|
1168
|
+
"type": "number",
|
|
1169
|
+
"required": false,
|
|
1170
|
+
"description": "Jailbreak classifier confidence (0-100)"
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
"key": "violence_score",
|
|
1174
|
+
"type": "number",
|
|
1175
|
+
"required": false,
|
|
1176
|
+
"description": "Violence content score (0-100)"
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
"key": "weapons_score",
|
|
1180
|
+
"type": "number",
|
|
1181
|
+
"required": false,
|
|
1182
|
+
"description": "Weapons content score (0-100)"
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
"key": "hate_speech_score",
|
|
1186
|
+
"type": "number",
|
|
1187
|
+
"required": false,
|
|
1188
|
+
"description": "Hate speech score (0-100)"
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
"key": "crime_score",
|
|
1192
|
+
"type": "number",
|
|
1193
|
+
"required": false,
|
|
1194
|
+
"description": "Crime content score (0-100)"
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
"key": "sexual_score",
|
|
1198
|
+
"type": "number",
|
|
1199
|
+
"required": false,
|
|
1200
|
+
"description": "Sexual content score (0-100)"
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
"key": "profanity_score",
|
|
1204
|
+
"type": "number",
|
|
1205
|
+
"required": false,
|
|
1206
|
+
"description": "Profanity score (0-100)"
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
"key": "invisible_chars_detected",
|
|
1210
|
+
"type": "boolean",
|
|
1211
|
+
"required": false,
|
|
1212
|
+
"description": "Invisible Unicode chars detected"
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
"key": "invisible_chars_score",
|
|
1216
|
+
"type": "number",
|
|
1217
|
+
"required": false,
|
|
1218
|
+
"description": "Unicode attack severity (0-100)"
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
"key": "model_name",
|
|
1222
|
+
"type": "string",
|
|
1223
|
+
"required": false,
|
|
1224
|
+
"description": "Target model name (e.g., gpt-4, claude-3-opus)"
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
"key": "model_provider",
|
|
1228
|
+
"type": "string",
|
|
1229
|
+
"required": false,
|
|
1230
|
+
"description": "Provider name (e.g., openai, anthropic, bedrock)"
|
|
1231
|
+
},
|
|
1232
|
+
{
|
|
1233
|
+
"key": "session_threat_turns",
|
|
1234
|
+
"type": "number",
|
|
1235
|
+
"required": false,
|
|
1236
|
+
"description": "Count of turns with detected threats in this session"
|
|
1237
|
+
},
|
|
1238
|
+
{
|
|
1239
|
+
"key": "session_cumulative_risk_score",
|
|
1240
|
+
"type": "number",
|
|
1241
|
+
"required": false,
|
|
1242
|
+
"description": "Cumulative risk score across session turns"
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
"key": "session_injection_detected",
|
|
1246
|
+
"type": "boolean",
|
|
1247
|
+
"required": false,
|
|
1248
|
+
"description": "Injection seen in any prior turn of this session"
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
"key": "session_command_injection",
|
|
1252
|
+
"type": "boolean",
|
|
1253
|
+
"required": false,
|
|
1254
|
+
"description": "Command injection seen in any prior turn of this session"
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
"key": "session_pii_detected",
|
|
1258
|
+
"type": "boolean",
|
|
1259
|
+
"required": false,
|
|
1260
|
+
"description": "PII seen in any prior turn of this session"
|
|
1261
|
+
},
|
|
1262
|
+
{
|
|
1263
|
+
"key": "session_pii_types",
|
|
1264
|
+
"type": "array",
|
|
1265
|
+
"required": false,
|
|
1266
|
+
"description": "PII types accumulated across session"
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
"key": "session_secrets_detected",
|
|
1270
|
+
"type": "boolean",
|
|
1271
|
+
"required": false,
|
|
1272
|
+
"description": "Secrets seen in any prior turn of this session"
|
|
1273
|
+
},
|
|
1274
|
+
{
|
|
1275
|
+
"key": "session_secret_types",
|
|
1276
|
+
"type": "array",
|
|
1277
|
+
"required": false,
|
|
1278
|
+
"description": "Secret types accumulated across session"
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
"key": "session_max_injection_score",
|
|
1282
|
+
"type": "number",
|
|
1283
|
+
"required": false,
|
|
1284
|
+
"description": "Max injection score across session turns"
|
|
1285
|
+
},
|
|
1286
|
+
{
|
|
1287
|
+
"key": "session_max_jailbreak_score",
|
|
1288
|
+
"type": "number",
|
|
1289
|
+
"required": false,
|
|
1290
|
+
"description": "Max jailbreak score across session turns"
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
"key": "session_max_command_injection_score",
|
|
1294
|
+
"type": "number",
|
|
1295
|
+
"required": false,
|
|
1296
|
+
"description": "Max command-injection score across session turns"
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
"key": "session_max_pii_score",
|
|
1300
|
+
"type": "number",
|
|
1301
|
+
"required": false,
|
|
1302
|
+
"description": "Max pii score across session turns"
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
"key": "session_max_secret_score",
|
|
1306
|
+
"type": "number",
|
|
1307
|
+
"required": false,
|
|
1308
|
+
"description": "Max secret score across session turns"
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
"key": "rpm_remaining_pct",
|
|
1312
|
+
"type": "number",
|
|
1313
|
+
"required": false,
|
|
1314
|
+
"description": "Remaining RPM (requests per minute) as percentage (0-100). Gateway-metered, Shield-decided (ADR 0014)",
|
|
1315
|
+
"range": "0-100"
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
"key": "rpm_exceeded",
|
|
1319
|
+
"type": "boolean",
|
|
1320
|
+
"required": false,
|
|
1321
|
+
"description": "Whether the RPM limit has been exceeded. Use this to enforce rate limits via Cedar policy"
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
"key": "tpm_remaining_pct",
|
|
1325
|
+
"type": "number",
|
|
1326
|
+
"required": false,
|
|
1327
|
+
"description": "Remaining TPM (tokens per minute) as percentage (0-100). Gateway-metered, Shield-decided (ADR 0014)",
|
|
1328
|
+
"range": "0-100"
|
|
1329
|
+
},
|
|
1330
|
+
{
|
|
1331
|
+
"key": "tpm_exceeded",
|
|
1332
|
+
"type": "boolean",
|
|
1333
|
+
"required": false,
|
|
1334
|
+
"description": "Whether the TPM limit has been exceeded. Use this to enforce token rate limits via Cedar policy"
|
|
1335
|
+
}
|
|
1336
|
+
]
|
|
1337
|
+
},
|
|
1030
1338
|
{
|
|
1031
1339
|
"name": "read_file",
|
|
1032
1340
|
"description": "Read an MCP resource — threat focus: secrets exposure, PII exposure",
|
|
@@ -60,6 +60,13 @@ entity Server in [Project];
|
|
|
60
60
|
/// MCP prompt -- resource for process_prompt action
|
|
61
61
|
entity LlmPrompt in [Project];
|
|
62
62
|
|
|
63
|
+
/// Model response -- resource for process_response action.
|
|
64
|
+
/// Parented to Project like every other resource: Shield injects
|
|
65
|
+
/// `when { resource in <Ns>::Project::"<id>" }` into every synced rule
|
|
66
|
+
/// (shield#428), so a resource outside the project hierarchy would make
|
|
67
|
+
/// every policy written against it unsatisfiable.
|
|
68
|
+
entity LlmResponse in [Project];
|
|
69
|
+
|
|
63
70
|
/// File/resource path -- resource for read_file/write_file actions
|
|
64
71
|
entity FilePath in [Project];
|
|
65
72
|
|
|
@@ -122,6 +129,13 @@ action call_tool appliesTo {
|
|
|
122
129
|
// --- Tool Operation Classifier ---
|
|
123
130
|
tool_operation_classes?: Set<String>, // subset of {"readonly", "write_enabling", "execute_enabling", "network_access", "unknown"}
|
|
124
131
|
|
|
132
|
+
// --- Bash AST resolved target paths (#411 / CAP-DET-007) — newline-delimited (leading+trailing \n); Cedar `like` is anchored so patterns start with "*": sub-tree "*\n/etc/*", bare dir "*\n/etc\n*", exact "*\n/etc/passwd\n*" ---
|
|
133
|
+
resolved_target_paths?: String, // union of resolved absolute target paths, any capability
|
|
134
|
+
read_target_paths?: String, // paths the command reads or enumerates
|
|
135
|
+
write_target_paths?: String, // paths the command writes, creates, or destroys
|
|
136
|
+
exec_target_paths?: String, // paths executed as a script
|
|
137
|
+
unresolved_target?: Bool, // a target hid behind a variable/glob/$()/inline code, or the path-list cap truncated
|
|
138
|
+
|
|
125
139
|
// --- MCP Trust ---
|
|
126
140
|
mcp_server_verified?: Bool, // Whether server is from verified registry
|
|
127
141
|
|
|
@@ -260,12 +274,13 @@ action connect_server appliesTo {
|
|
|
260
274
|
},
|
|
261
275
|
};
|
|
262
276
|
|
|
263
|
-
//
|
|
264
|
-
//
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
277
|
+
// Shared content-inspection context.
|
|
278
|
+
//
|
|
279
|
+
// Prompts and responses are inspected by the same detector pipeline and so
|
|
280
|
+
// carry the same context keys; only the TRIGGER differs (ADR 0031). Declaring
|
|
281
|
+
// the shape once means a new detector key cannot land on one direction and go
|
|
282
|
+
// missing on the other — the drift class shield#393 / shield#387 were about.
|
|
283
|
+
type ContentInspectionContext = {
|
|
269
284
|
// Identity (AARM R6 / CAP-IDN-011) — projected from the principal's token; optional.
|
|
270
285
|
role?: String,
|
|
271
286
|
privilege_scope?: Set<String>,
|
|
@@ -344,7 +359,29 @@ action process_prompt appliesTo {
|
|
|
344
359
|
rpm_exceeded?: Bool,
|
|
345
360
|
tpm_remaining_pct?: Long,
|
|
346
361
|
tpm_exceeded?: Bool,
|
|
347
|
-
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
// Process a prompt (MCP prompts/get or LLM chat completions)
|
|
365
|
+
// Threat focus: injection, jailbreak, secrets, PII, content safety
|
|
366
|
+
action process_prompt appliesTo {
|
|
367
|
+
principal: [User, MCP_Client],
|
|
368
|
+
resource: [LlmPrompt],
|
|
369
|
+
context: ContentInspectionContext,
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
// Process a model response (LLM chat completion output, streamed or buffered)
|
|
373
|
+
// Threat focus: data leakage in output, harmful content, hallucination,
|
|
374
|
+
// indirect injection carried back to the caller.
|
|
375
|
+
//
|
|
376
|
+
// Distinct from process_prompt so that (a) a policy can be scoped to one
|
|
377
|
+
// direction from its head alone and (b) Shield's action-scoped detector
|
|
378
|
+
// scheduling (INV-DET-001) can keep prompt-only detectors off the egress
|
|
379
|
+
// path — before this action existed, a prompt-scoped dlp/model_armor/webhook
|
|
380
|
+
// rule shipped response bodies downstream. See ADR 0031.
|
|
381
|
+
action process_response appliesTo {
|
|
382
|
+
principal: [User, MCP_Client],
|
|
383
|
+
resource: [LlmResponse],
|
|
384
|
+
context: ContentInspectionContext,
|
|
348
385
|
};
|
|
349
386
|
|
|
350
387
|
// Read an MCP resource (resources/read, resources/list)
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
// - mcp_server_verified: Bool
|
|
14
14
|
// - mcp_config_risk: Bool
|
|
15
15
|
// - mcp_risk_score: Long (0-100)
|
|
16
|
-
// - threat_count: Long
|
|
17
16
|
//
|
|
18
17
|
// Compliance:
|
|
19
18
|
// - OWASP LLM01, OWASP ASI01, OWASP ASI02, OWASP ASI04
|
|
@@ -115,21 +114,11 @@ when {
|
|
|
115
114
|
// Section 4: MCP supply chain & trust
|
|
116
115
|
// ---------------------------------------------------------------------------
|
|
117
116
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
@reject_message("Tool execution blocked: the MCP server is unverified and security threats were detected.")
|
|
124
|
-
forbid (
|
|
125
|
-
principal,
|
|
126
|
-
action == AIGateway::Action::"call_tool",
|
|
127
|
-
resource
|
|
128
|
-
)
|
|
129
|
-
when {
|
|
130
|
-
context has mcp_server_verified && context.mcp_server_verified == false &&
|
|
131
|
-
context has threat_count && context.threat_count >= 1
|
|
132
|
-
};
|
|
117
|
+
// The agent-security.block-unverified-threats rule (unverified server AND
|
|
118
|
+
// threat_count >= 1) was removed: AIGateway does not run threat aggregation,
|
|
119
|
+
// so threat_count is never in its projected context and the rule could never
|
|
120
|
+
// fire (highflame-shield#429). A working "unverified server + any detection"
|
|
121
|
+
// rule needs a key the product actually projects; restore only with one.
|
|
133
122
|
|
|
134
123
|
@id("agent-security.block-mcp-config-risk")
|
|
135
124
|
@name("Block risky MCP server configs")
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
@reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
|
|
23
23
|
forbid (
|
|
24
24
|
principal,
|
|
25
|
-
action in [AIGateway::Action::"process_prompt",
|
|
25
|
+
action in [AIGateway::Action::"process_prompt",
|
|
26
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
26
27
|
resource
|
|
27
28
|
)
|
|
28
29
|
when {
|
|
@@ -43,7 +44,8 @@ when {
|
|
|
43
44
|
@reject_message("Content blocked: credit card number patterns detected.")
|
|
44
45
|
forbid (
|
|
45
46
|
principal,
|
|
46
|
-
action in [AIGateway::Action::"process_prompt",
|
|
47
|
+
action in [AIGateway::Action::"process_prompt",
|
|
48
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
47
49
|
resource
|
|
48
50
|
)
|
|
49
51
|
when {
|
|
@@ -58,7 +60,8 @@ when {
|
|
|
58
60
|
@reject_message("Content blocked: bank account (IBAN) number patterns detected.")
|
|
59
61
|
forbid (
|
|
60
62
|
principal,
|
|
61
|
-
action in [AIGateway::Action::"process_prompt",
|
|
63
|
+
action in [AIGateway::Action::"process_prompt",
|
|
64
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
62
65
|
resource
|
|
63
66
|
)
|
|
64
67
|
when {
|
|
@@ -79,7 +82,8 @@ when {
|
|
|
79
82
|
@reject_message("Content blocked: medical record identifier patterns detected.")
|
|
80
83
|
forbid (
|
|
81
84
|
principal,
|
|
82
|
-
action in [AIGateway::Action::"process_prompt",
|
|
85
|
+
action in [AIGateway::Action::"process_prompt",
|
|
86
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
83
87
|
resource
|
|
84
88
|
)
|
|
85
89
|
when {
|
|
@@ -102,7 +106,8 @@ when {
|
|
|
102
106
|
@reject_message("Content blocked: tax identifier (ITIN or EIN) patterns detected.")
|
|
103
107
|
forbid (
|
|
104
108
|
principal,
|
|
105
|
-
action in [AIGateway::Action::"process_prompt",
|
|
109
|
+
action in [AIGateway::Action::"process_prompt",
|
|
110
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
106
111
|
resource
|
|
107
112
|
)
|
|
108
113
|
when {
|
|
@@ -122,7 +127,8 @@ when {
|
|
|
122
127
|
@reject_message("Content blocked: credential or API key patterns detected.")
|
|
123
128
|
forbid (
|
|
124
129
|
principal,
|
|
125
|
-
action in [AIGateway::Action::"process_prompt",
|
|
130
|
+
action in [AIGateway::Action::"process_prompt",
|
|
131
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
126
132
|
resource
|
|
127
133
|
)
|
|
128
134
|
when {
|
|
@@ -152,7 +158,8 @@ when {
|
|
|
152
158
|
@reject_message("Content blocked: cryptocurrency wallet address patterns detected.")
|
|
153
159
|
forbid (
|
|
154
160
|
principal,
|
|
155
|
-
action in [AIGateway::Action::"process_prompt",
|
|
161
|
+
action in [AIGateway::Action::"process_prompt",
|
|
162
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
156
163
|
resource
|
|
157
164
|
)
|
|
158
165
|
when {
|