@highflame/policy 2.2.36 → 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 +792 -0
- package/_schemas/agent_ops/schema.cedarschema +127 -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 +278 -0
- package/_schemas/ai_gateway/schema.cedarschema +37 -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 +671 -0
- package/_schemas/guardrails/schema.cedarschema +23 -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/dist/agent_ops-defaults.gen.js +177 -120
- package/dist/agent_ops-entities.gen.js +5 -1
- package/dist/ai_gateway-defaults.gen.js +90 -164
- package/dist/ai_gateway-entities.gen.js +6 -2
- package/dist/guardrails-defaults.gen.js +144 -145
- package/dist/guardrails-entities.gen.js +5 -1
- package/dist/service-schemas.gen.d.ts +3 -3
- package/dist/service-schemas.gen.js +480 -118
- package/package.json +1 -1
- package/_schemas/guardrails/templates/profiles/advanced_detection/threat_severity.cedar +0 -30
|
@@ -1057,6 +1057,284 @@
|
|
|
1057
1057
|
}
|
|
1058
1058
|
]
|
|
1059
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
|
+
},
|
|
1060
1338
|
{
|
|
1061
1339
|
"name": "read_file",
|
|
1062
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
|
|
|
@@ -267,12 +274,13 @@ action connect_server appliesTo {
|
|
|
267
274
|
},
|
|
268
275
|
};
|
|
269
276
|
|
|
270
|
-
//
|
|
271
|
-
//
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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 = {
|
|
276
284
|
// Identity (AARM R6 / CAP-IDN-011) — projected from the principal's token; optional.
|
|
277
285
|
role?: String,
|
|
278
286
|
privilege_scope?: Set<String>,
|
|
@@ -351,7 +359,29 @@ action process_prompt appliesTo {
|
|
|
351
359
|
rpm_exceeded?: Bool,
|
|
352
360
|
tpm_remaining_pct?: Long,
|
|
353
361
|
tpm_exceeded?: Bool,
|
|
354
|
-
|
|
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,
|
|
355
385
|
};
|
|
356
386
|
|
|
357
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 {
|
|
@@ -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 {
|
|
@@ -44,7 +45,8 @@ when {
|
|
|
44
45
|
@reject_message("Content blocked: credit card number patterns detected.")
|
|
45
46
|
forbid (
|
|
46
47
|
principal,
|
|
47
|
-
action in [AIGateway::Action::"process_prompt",
|
|
48
|
+
action in [AIGateway::Action::"process_prompt",
|
|
49
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
48
50
|
resource
|
|
49
51
|
)
|
|
50
52
|
when {
|
|
@@ -63,7 +65,8 @@ when {
|
|
|
63
65
|
@reject_message("Content blocked: bank account (IBAN) number patterns detected.")
|
|
64
66
|
forbid (
|
|
65
67
|
principal,
|
|
66
|
-
action in [AIGateway::Action::"process_prompt",
|
|
68
|
+
action in [AIGateway::Action::"process_prompt",
|
|
69
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
67
70
|
resource
|
|
68
71
|
)
|
|
69
72
|
when {
|
|
@@ -85,7 +88,8 @@ when {
|
|
|
85
88
|
@reject_message("Content blocked: medical record identifier patterns detected.")
|
|
86
89
|
forbid (
|
|
87
90
|
principal,
|
|
88
|
-
action in [AIGateway::Action::"process_prompt",
|
|
91
|
+
action in [AIGateway::Action::"process_prompt",
|
|
92
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
89
93
|
resource
|
|
90
94
|
)
|
|
91
95
|
when {
|
|
@@ -109,7 +113,8 @@ when {
|
|
|
109
113
|
@reject_message("Content blocked: tax identifier (ITIN or EIN) patterns detected.")
|
|
110
114
|
forbid (
|
|
111
115
|
principal,
|
|
112
|
-
action in [AIGateway::Action::"process_prompt",
|
|
116
|
+
action in [AIGateway::Action::"process_prompt",
|
|
117
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
113
118
|
resource
|
|
114
119
|
)
|
|
115
120
|
when {
|
|
@@ -129,7 +134,8 @@ when {
|
|
|
129
134
|
@reject_message("Content blocked: credential or API key patterns detected.")
|
|
130
135
|
forbid (
|
|
131
136
|
principal,
|
|
132
|
-
action in [AIGateway::Action::"process_prompt",
|
|
137
|
+
action in [AIGateway::Action::"process_prompt",
|
|
138
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
133
139
|
resource
|
|
134
140
|
)
|
|
135
141
|
when {
|
|
@@ -160,7 +166,8 @@ when {
|
|
|
160
166
|
@reject_message("Content blocked: cryptocurrency wallet address patterns detected.")
|
|
161
167
|
forbid (
|
|
162
168
|
principal,
|
|
163
|
-
action in [AIGateway::Action::"process_prompt",
|
|
169
|
+
action in [AIGateway::Action::"process_prompt",
|
|
170
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
164
171
|
resource
|
|
165
172
|
)
|
|
166
173
|
when {
|
|
@@ -179,7 +186,8 @@ when {
|
|
|
179
186
|
@reject_message("Content blocked: personal name patterns detected.")
|
|
180
187
|
forbid (
|
|
181
188
|
principal,
|
|
182
|
-
action in [AIGateway::Action::"process_prompt",
|
|
189
|
+
action in [AIGateway::Action::"process_prompt",
|
|
190
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
183
191
|
resource
|
|
184
192
|
)
|
|
185
193
|
when {
|
|
@@ -198,7 +206,8 @@ when {
|
|
|
198
206
|
@reject_message("Content blocked: email address patterns detected.")
|
|
199
207
|
forbid (
|
|
200
208
|
principal,
|
|
201
|
-
action in [AIGateway::Action::"process_prompt",
|
|
209
|
+
action in [AIGateway::Action::"process_prompt",
|
|
210
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
202
211
|
resource
|
|
203
212
|
)
|
|
204
213
|
when {
|
|
@@ -217,7 +226,8 @@ when {
|
|
|
217
226
|
@reject_message("Content blocked: phone number patterns detected.")
|
|
218
227
|
forbid (
|
|
219
228
|
principal,
|
|
220
|
-
action in [AIGateway::Action::"process_prompt",
|
|
229
|
+
action in [AIGateway::Action::"process_prompt",
|
|
230
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
221
231
|
resource
|
|
222
232
|
)
|
|
223
233
|
when {
|
|
@@ -236,7 +246,8 @@ when {
|
|
|
236
246
|
@reject_message("Content blocked: date or time patterns detected.")
|
|
237
247
|
forbid (
|
|
238
248
|
principal,
|
|
239
|
-
action in [AIGateway::Action::"process_prompt",
|
|
249
|
+
action in [AIGateway::Action::"process_prompt",
|
|
250
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
240
251
|
resource
|
|
241
252
|
)
|
|
242
253
|
when {
|
|
@@ -258,7 +269,8 @@ when {
|
|
|
258
269
|
@reject_message("Content blocked: URL patterns detected.")
|
|
259
270
|
forbid (
|
|
260
271
|
principal,
|
|
261
|
-
action in [AIGateway::Action::"process_prompt",
|
|
272
|
+
action in [AIGateway::Action::"process_prompt",
|
|
273
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
262
274
|
resource
|
|
263
275
|
)
|
|
264
276
|
when {
|
|
@@ -277,7 +289,8 @@ when {
|
|
|
277
289
|
@reject_message("Content blocked: street address or location patterns detected.")
|
|
278
290
|
forbid (
|
|
279
291
|
principal,
|
|
280
|
-
action in [AIGateway::Action::"process_prompt",
|
|
292
|
+
action in [AIGateway::Action::"process_prompt",
|
|
293
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
281
294
|
resource
|
|
282
295
|
)
|
|
283
296
|
when {
|
|
@@ -298,7 +311,8 @@ when {
|
|
|
298
311
|
@reject_message("Content blocked: organization name patterns detected.")
|
|
299
312
|
forbid (
|
|
300
313
|
principal,
|
|
301
|
-
action in [AIGateway::Action::"process_prompt",
|
|
314
|
+
action in [AIGateway::Action::"process_prompt",
|
|
315
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
302
316
|
resource
|
|
303
317
|
)
|
|
304
318
|
when {
|
|
@@ -317,7 +331,8 @@ when {
|
|
|
317
331
|
@reject_message("Content blocked: occupation patterns detected.")
|
|
318
332
|
forbid (
|
|
319
333
|
principal,
|
|
320
|
-
action in [AIGateway::Action::"process_prompt",
|
|
334
|
+
action in [AIGateway::Action::"process_prompt",
|
|
335
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
321
336
|
resource
|
|
322
337
|
)
|
|
323
338
|
when {
|
|
@@ -336,7 +351,8 @@ when {
|
|
|
336
351
|
@reject_message("Content blocked: username patterns detected.")
|
|
337
352
|
forbid (
|
|
338
353
|
principal,
|
|
339
|
-
action in [AIGateway::Action::"process_prompt",
|
|
354
|
+
action in [AIGateway::Action::"process_prompt",
|
|
355
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
340
356
|
resource
|
|
341
357
|
)
|
|
342
358
|
when {
|
|
@@ -355,7 +371,8 @@ when {
|
|
|
355
371
|
@reject_message("Content blocked: employee or customer identifier patterns detected.")
|
|
356
372
|
forbid (
|
|
357
373
|
principal,
|
|
358
|
-
action in [AIGateway::Action::"process_prompt",
|
|
374
|
+
action in [AIGateway::Action::"process_prompt",
|
|
375
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
359
376
|
resource
|
|
360
377
|
)
|
|
361
378
|
when {
|
|
@@ -376,7 +393,8 @@ when {
|
|
|
376
393
|
@reject_message("Content blocked: device or network identifier patterns detected.")
|
|
377
394
|
forbid (
|
|
378
395
|
principal,
|
|
379
|
-
action in [AIGateway::Action::"process_prompt",
|
|
396
|
+
action in [AIGateway::Action::"process_prompt",
|
|
397
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
380
398
|
resource
|
|
381
399
|
)
|
|
382
400
|
when {
|
|
@@ -403,7 +421,8 @@ when {
|
|
|
403
421
|
@reject_message("Content blocked: vehicle identifier (VIN or plate) patterns detected.")
|
|
404
422
|
forbid (
|
|
405
423
|
principal,
|
|
406
|
-
action in [AIGateway::Action::"process_prompt",
|
|
424
|
+
action in [AIGateway::Action::"process_prompt",
|
|
425
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
407
426
|
resource
|
|
408
427
|
)
|
|
409
428
|
when {
|
|
@@ -423,7 +442,8 @@ when {
|
|
|
423
442
|
@reject_message("Content blocked: salary or financial amount patterns detected.")
|
|
424
443
|
forbid (
|
|
425
444
|
principal,
|
|
426
|
-
action in [AIGateway::Action::"process_prompt",
|
|
445
|
+
action in [AIGateway::Action::"process_prompt",
|
|
446
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
427
447
|
resource
|
|
428
448
|
)
|
|
429
449
|
when {
|
|
@@ -444,7 +464,8 @@ when {
|
|
|
444
464
|
@reject_message("Content blocked: sensitive attribute (ethnicity, religion, etc.) patterns detected.")
|
|
445
465
|
forbid (
|
|
446
466
|
principal,
|
|
447
|
-
action in [AIGateway::Action::"process_prompt",
|
|
467
|
+
action in [AIGateway::Action::"process_prompt",
|
|
468
|
+
AIGateway::Action::"process_response", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
|
|
448
469
|
resource
|
|
449
470
|
)
|
|
450
471
|
when {
|