@highflame/policy 2.2.24 → 2.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_schemas/ai_gateway/context.json +28 -14
- package/_schemas/ai_gateway/templates/defaults/malicious_package.cedar +59 -0
- package/_schemas/ai_gateway/templates/templates.json +14 -0
- package/_schemas/guardrails/context.json +176 -88
- package/_schemas/overwatch/context.json +146 -33
- package/dist/ai_gateway-defaults.gen.js +83 -0
- package/dist/overwatch-context.gen.d.ts +11 -1
- package/dist/overwatch-context.gen.js +20 -0
- package/dist/overwatch-defaults.gen.d.ts +1 -1
- package/dist/overwatch-defaults.gen.js +93 -0
- package/dist/overwatch-detectors.gen.js +24 -0
- package/dist/service-schemas.gen.js +13 -0
- package/package.json +1 -1
|
@@ -203,25 +203,29 @@
|
|
|
203
203
|
"key": "injection_pulse_score",
|
|
204
204
|
"type": "number",
|
|
205
205
|
"required": false,
|
|
206
|
-
"description": "Highflame single-turn classifier score for prompt injection (0-100). Raw score from Pulse detector before combination with deep-context. Use for per-detector policy control"
|
|
206
|
+
"description": "Highflame single-turn classifier score for prompt injection (0-100). Raw score from Pulse detector before combination with deep-context. Use for per-detector policy control",
|
|
207
|
+
"range": "0-100"
|
|
207
208
|
},
|
|
208
209
|
{
|
|
209
210
|
"key": "injection_deep_context_score",
|
|
210
211
|
"type": "number",
|
|
211
212
|
"required": false,
|
|
212
|
-
"description": "DeepContext multi-turn analyzer score for prompt injection (0-100). Tracks injection patterns across conversation history. Generally higher confidence than single-turn"
|
|
213
|
+
"description": "DeepContext multi-turn analyzer score for prompt injection (0-100). Tracks injection patterns across conversation history. Generally higher confidence than single-turn",
|
|
214
|
+
"range": "0-100"
|
|
213
215
|
},
|
|
214
216
|
{
|
|
215
217
|
"key": "jailbreak_pulse_score",
|
|
216
218
|
"type": "number",
|
|
217
219
|
"required": false,
|
|
218
|
-
"description": "Highflame single-turn classifier score for jailbreak attempts (0-100). Raw score from Pulse detector before combination with deep-context"
|
|
220
|
+
"description": "Highflame single-turn classifier score for jailbreak attempts (0-100). Raw score from Pulse detector before combination with deep-context",
|
|
221
|
+
"range": "0-100"
|
|
219
222
|
},
|
|
220
223
|
{
|
|
221
224
|
"key": "jailbreak_deep_context_score",
|
|
222
225
|
"type": "number",
|
|
223
226
|
"required": false,
|
|
224
|
-
"description": "DeepContext multi-turn analyzer score for jailbreak attempts (0-100). Detects jailbreak escalation patterns across conversation turns"
|
|
227
|
+
"description": "DeepContext multi-turn analyzer score for jailbreak attempts (0-100). Detects jailbreak escalation patterns across conversation turns",
|
|
228
|
+
"range": "0-100"
|
|
225
229
|
},
|
|
226
230
|
{
|
|
227
231
|
"key": "indirect_injection_score",
|
|
@@ -229,6 +233,24 @@
|
|
|
229
233
|
"required": true,
|
|
230
234
|
"description": "Indirect prompt injection risk score (0-100) — injection via tool outputs or retrieved content"
|
|
231
235
|
},
|
|
236
|
+
{
|
|
237
|
+
"key": "package_install_detected",
|
|
238
|
+
"type": "boolean",
|
|
239
|
+
"required": false,
|
|
240
|
+
"description": "True iff a package install/download command was recognized in the request content."
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"key": "malicious_package_detected",
|
|
244
|
+
"type": "boolean",
|
|
245
|
+
"required": false,
|
|
246
|
+
"description": "True iff any referenced package has a known-malicious (MAL-) OSV advisory."
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"key": "package_check_status",
|
|
250
|
+
"type": "string",
|
|
251
|
+
"required": false,
|
|
252
|
+
"description": "Set to 'degraded' when the osv.dev lookup failed (fail-open); empty otherwise."
|
|
253
|
+
},
|
|
232
254
|
{
|
|
233
255
|
"key": "session_pii_detected",
|
|
234
256
|
"type": "boolean",
|
|
@@ -275,31 +297,36 @@
|
|
|
275
297
|
"key": "session_max_injection_score",
|
|
276
298
|
"type": "number",
|
|
277
299
|
"required": false,
|
|
278
|
-
"description": "Highest prompt injection score seen in any turn of the session (0-100). Use for tiered responses: >75 hard block, >50 restrict permissions"
|
|
300
|
+
"description": "Highest prompt injection score seen in any turn of the session (0-100). Use for tiered responses: >75 hard block, >50 restrict permissions",
|
|
301
|
+
"range": "0-100"
|
|
279
302
|
},
|
|
280
303
|
{
|
|
281
304
|
"key": "session_max_jailbreak_score",
|
|
282
305
|
"type": "number",
|
|
283
306
|
"required": false,
|
|
284
|
-
"description": "Highest jailbreak detection score seen in any turn of the session (0-100)"
|
|
307
|
+
"description": "Highest jailbreak detection score seen in any turn of the session (0-100)",
|
|
308
|
+
"range": "0-100"
|
|
285
309
|
},
|
|
286
310
|
{
|
|
287
311
|
"key": "session_max_command_injection_score",
|
|
288
312
|
"type": "number",
|
|
289
313
|
"required": false,
|
|
290
|
-
"description": "Highest command injection score seen in any turn of the session (0-100)"
|
|
314
|
+
"description": "Highest command injection score seen in any turn of the session (0-100)",
|
|
315
|
+
"range": "0-100"
|
|
291
316
|
},
|
|
292
317
|
{
|
|
293
318
|
"key": "session_max_pii_score",
|
|
294
319
|
"type": "number",
|
|
295
320
|
"required": false,
|
|
296
|
-
"description": "Highest PII risk score seen in any turn of the session (0-100)"
|
|
321
|
+
"description": "Highest PII risk score seen in any turn of the session (0-100)",
|
|
322
|
+
"range": "0-100"
|
|
297
323
|
},
|
|
298
324
|
{
|
|
299
325
|
"key": "session_max_secret_score",
|
|
300
326
|
"type": "number",
|
|
301
327
|
"required": false,
|
|
302
|
-
"description": "Highest secret detection score seen in any turn of the session (0-100)"
|
|
328
|
+
"description": "Highest secret detection score seen in any turn of the session (0-100)",
|
|
329
|
+
"range": "0-100"
|
|
303
330
|
},
|
|
304
331
|
{
|
|
305
332
|
"key": "session_cumulative_risk_score",
|
|
@@ -527,25 +554,29 @@
|
|
|
527
554
|
"key": "injection_pulse_score",
|
|
528
555
|
"type": "number",
|
|
529
556
|
"required": false,
|
|
530
|
-
"description": "Highflame single-turn classifier score for prompt injection in tool arguments (0-100). Raw score from Pulse detector before combination with deep-context"
|
|
557
|
+
"description": "Highflame single-turn classifier score for prompt injection in tool arguments (0-100). Raw score from Pulse detector before combination with deep-context",
|
|
558
|
+
"range": "0-100"
|
|
531
559
|
},
|
|
532
560
|
{
|
|
533
561
|
"key": "injection_deep_context_score",
|
|
534
562
|
"type": "number",
|
|
535
563
|
"required": false,
|
|
536
|
-
"description": "DeepContext multi-turn analyzer score for prompt injection in tool arguments (0-100). Tracks injection patterns across tool call history"
|
|
564
|
+
"description": "DeepContext multi-turn analyzer score for prompt injection in tool arguments (0-100). Tracks injection patterns across tool call history",
|
|
565
|
+
"range": "0-100"
|
|
537
566
|
},
|
|
538
567
|
{
|
|
539
568
|
"key": "jailbreak_pulse_score",
|
|
540
569
|
"type": "number",
|
|
541
570
|
"required": false,
|
|
542
|
-
"description": "Highflame single-turn classifier score for jailbreak in tool arguments (0-100). Raw score from Pulse detector before combination with deep-context"
|
|
571
|
+
"description": "Highflame single-turn classifier score for jailbreak in tool arguments (0-100). Raw score from Pulse detector before combination with deep-context",
|
|
572
|
+
"range": "0-100"
|
|
543
573
|
},
|
|
544
574
|
{
|
|
545
575
|
"key": "jailbreak_deep_context_score",
|
|
546
576
|
"type": "number",
|
|
547
577
|
"required": false,
|
|
548
|
-
"description": "DeepContext multi-turn analyzer score for jailbreak in tool arguments (0-100). Detects jailbreak escalation patterns across tool call turns"
|
|
578
|
+
"description": "DeepContext multi-turn analyzer score for jailbreak in tool arguments (0-100). Detects jailbreak escalation patterns across tool call turns",
|
|
579
|
+
"range": "0-100"
|
|
549
580
|
},
|
|
550
581
|
{
|
|
551
582
|
"key": "tool_poisoning_score",
|
|
@@ -649,6 +680,68 @@
|
|
|
649
680
|
"required": false,
|
|
650
681
|
"description": "All operation classes observed in the tool call. Subset of: 'readonly', 'write_enabling', 'execute_enabling', 'network_access', 'unknown'. 'unknown' appears when any unrecognized or variable-expanded command was seen."
|
|
651
682
|
},
|
|
683
|
+
{
|
|
684
|
+
"key": "package_install_detected",
|
|
685
|
+
"type": "boolean",
|
|
686
|
+
"required": false,
|
|
687
|
+
"description": "True iff a package install/download command was recognized in the tool call arguments."
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"key": "malicious_package_detected",
|
|
691
|
+
"type": "boolean",
|
|
692
|
+
"required": false,
|
|
693
|
+
"description": "True iff any referenced package has a known-malicious (MAL-) OSV advisory."
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"key": "malicious_package_score",
|
|
697
|
+
"type": "number",
|
|
698
|
+
"required": false,
|
|
699
|
+
"description": "100 when a malicious package was detected, 0 otherwise.",
|
|
700
|
+
"range": "0-100"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
"key": "malicious_packages",
|
|
704
|
+
"type": "array",
|
|
705
|
+
"required": false,
|
|
706
|
+
"description": "Malicious packages as ecosystem/name[@version] strings."
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"key": "packages_checked",
|
|
710
|
+
"type": "number",
|
|
711
|
+
"required": false,
|
|
712
|
+
"description": "Number of unique packages checked against osv.dev."
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"key": "package_names",
|
|
716
|
+
"type": "array",
|
|
717
|
+
"required": false,
|
|
718
|
+
"description": "Names of all packages parsed from install commands (without ecosystem prefix)."
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
"key": "package_ecosystems",
|
|
722
|
+
"type": "array",
|
|
723
|
+
"required": false,
|
|
724
|
+
"description": "Unique package ecosystems seen in this event, e.g. 'PyPI', 'npm'."
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"key": "package_advisory_count",
|
|
728
|
+
"type": "number",
|
|
729
|
+
"required": false,
|
|
730
|
+
"description": "Total non-malicious OSV advisories (GHSA- / CVE- IDs) found across all checked packages."
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"key": "package_risk_score",
|
|
734
|
+
"type": "number",
|
|
735
|
+
"required": false,
|
|
736
|
+
"description": "Graduated supply-chain risk score (0-100). 100 when any malicious package is found.",
|
|
737
|
+
"range": "0-100"
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"key": "package_check_status",
|
|
741
|
+
"type": "string",
|
|
742
|
+
"required": false,
|
|
743
|
+
"description": "Set to 'degraded' when the osv.dev lookup failed (fail-open); empty otherwise."
|
|
744
|
+
},
|
|
652
745
|
{
|
|
653
746
|
"key": "session_pii_detected",
|
|
654
747
|
"type": "boolean",
|
|
@@ -695,31 +788,36 @@
|
|
|
695
788
|
"key": "session_max_injection_score",
|
|
696
789
|
"type": "number",
|
|
697
790
|
"required": false,
|
|
698
|
-
"description": "Highest prompt injection score seen in any turn of the session (0-100). Use for tiered responses: >75 hard block, >50 restrict permissions"
|
|
791
|
+
"description": "Highest prompt injection score seen in any turn of the session (0-100). Use for tiered responses: >75 hard block, >50 restrict permissions",
|
|
792
|
+
"range": "0-100"
|
|
699
793
|
},
|
|
700
794
|
{
|
|
701
795
|
"key": "session_max_jailbreak_score",
|
|
702
796
|
"type": "number",
|
|
703
797
|
"required": false,
|
|
704
|
-
"description": "Highest jailbreak detection score seen in any turn of the session (0-100)"
|
|
798
|
+
"description": "Highest jailbreak detection score seen in any turn of the session (0-100)",
|
|
799
|
+
"range": "0-100"
|
|
705
800
|
},
|
|
706
801
|
{
|
|
707
802
|
"key": "session_max_command_injection_score",
|
|
708
803
|
"type": "number",
|
|
709
804
|
"required": false,
|
|
710
|
-
"description": "Highest command injection score seen in any turn of the session (0-100)"
|
|
805
|
+
"description": "Highest command injection score seen in any turn of the session (0-100)",
|
|
806
|
+
"range": "0-100"
|
|
711
807
|
},
|
|
712
808
|
{
|
|
713
809
|
"key": "session_max_pii_score",
|
|
714
810
|
"type": "number",
|
|
715
811
|
"required": false,
|
|
716
|
-
"description": "Highest PII risk score seen in any turn of the session (0-100)"
|
|
812
|
+
"description": "Highest PII risk score seen in any turn of the session (0-100)",
|
|
813
|
+
"range": "0-100"
|
|
717
814
|
},
|
|
718
815
|
{
|
|
719
816
|
"key": "session_max_secret_score",
|
|
720
817
|
"type": "number",
|
|
721
818
|
"required": false,
|
|
722
|
-
"description": "Highest secret detection score seen in any turn of the session (0-100)"
|
|
819
|
+
"description": "Highest secret detection score seen in any turn of the session (0-100)",
|
|
820
|
+
"range": "0-100"
|
|
723
821
|
},
|
|
724
822
|
{
|
|
725
823
|
"key": "session_cumulative_risk_score",
|
|
@@ -899,31 +997,36 @@
|
|
|
899
997
|
"key": "session_max_injection_score",
|
|
900
998
|
"type": "number",
|
|
901
999
|
"required": false,
|
|
902
|
-
"description": "Highest prompt injection score seen in any turn of the session (0-100). Use for tiered responses: >75 hard block, >50 restrict permissions"
|
|
1000
|
+
"description": "Highest prompt injection score seen in any turn of the session (0-100). Use for tiered responses: >75 hard block, >50 restrict permissions",
|
|
1001
|
+
"range": "0-100"
|
|
903
1002
|
},
|
|
904
1003
|
{
|
|
905
1004
|
"key": "session_max_jailbreak_score",
|
|
906
1005
|
"type": "number",
|
|
907
1006
|
"required": false,
|
|
908
|
-
"description": "Highest jailbreak detection score seen in any turn of the session (0-100)"
|
|
1007
|
+
"description": "Highest jailbreak detection score seen in any turn of the session (0-100)",
|
|
1008
|
+
"range": "0-100"
|
|
909
1009
|
},
|
|
910
1010
|
{
|
|
911
1011
|
"key": "session_max_command_injection_score",
|
|
912
1012
|
"type": "number",
|
|
913
1013
|
"required": false,
|
|
914
|
-
"description": "Highest command injection score seen in any turn of the session (0-100)"
|
|
1014
|
+
"description": "Highest command injection score seen in any turn of the session (0-100)",
|
|
1015
|
+
"range": "0-100"
|
|
915
1016
|
},
|
|
916
1017
|
{
|
|
917
1018
|
"key": "session_max_pii_score",
|
|
918
1019
|
"type": "number",
|
|
919
1020
|
"required": false,
|
|
920
|
-
"description": "Highest PII risk score seen in any turn of the session (0-100)"
|
|
1021
|
+
"description": "Highest PII risk score seen in any turn of the session (0-100)",
|
|
1022
|
+
"range": "0-100"
|
|
921
1023
|
},
|
|
922
1024
|
{
|
|
923
1025
|
"key": "session_max_secret_score",
|
|
924
1026
|
"type": "number",
|
|
925
1027
|
"required": false,
|
|
926
|
-
"description": "Highest secret detection score seen in any turn of the session (0-100)"
|
|
1028
|
+
"description": "Highest secret detection score seen in any turn of the session (0-100)",
|
|
1029
|
+
"range": "0-100"
|
|
927
1030
|
},
|
|
928
1031
|
{
|
|
929
1032
|
"key": "session_cumulative_risk_score",
|
|
@@ -1103,31 +1206,36 @@
|
|
|
1103
1206
|
"key": "session_max_injection_score",
|
|
1104
1207
|
"type": "number",
|
|
1105
1208
|
"required": false,
|
|
1106
|
-
"description": "Highest prompt injection score seen in any turn of the session (0-100). Use for tiered responses: >75 hard block, >50 restrict permissions"
|
|
1209
|
+
"description": "Highest prompt injection score seen in any turn of the session (0-100). Use for tiered responses: >75 hard block, >50 restrict permissions",
|
|
1210
|
+
"range": "0-100"
|
|
1107
1211
|
},
|
|
1108
1212
|
{
|
|
1109
1213
|
"key": "session_max_jailbreak_score",
|
|
1110
1214
|
"type": "number",
|
|
1111
1215
|
"required": false,
|
|
1112
|
-
"description": "Highest jailbreak detection score seen in any turn of the session (0-100)"
|
|
1216
|
+
"description": "Highest jailbreak detection score seen in any turn of the session (0-100)",
|
|
1217
|
+
"range": "0-100"
|
|
1113
1218
|
},
|
|
1114
1219
|
{
|
|
1115
1220
|
"key": "session_max_command_injection_score",
|
|
1116
1221
|
"type": "number",
|
|
1117
1222
|
"required": false,
|
|
1118
|
-
"description": "Highest command injection score seen in any turn of the session (0-100)"
|
|
1223
|
+
"description": "Highest command injection score seen in any turn of the session (0-100)",
|
|
1224
|
+
"range": "0-100"
|
|
1119
1225
|
},
|
|
1120
1226
|
{
|
|
1121
1227
|
"key": "session_max_pii_score",
|
|
1122
1228
|
"type": "number",
|
|
1123
1229
|
"required": false,
|
|
1124
|
-
"description": "Highest PII risk score seen in any turn of the session (0-100)"
|
|
1230
|
+
"description": "Highest PII risk score seen in any turn of the session (0-100)",
|
|
1231
|
+
"range": "0-100"
|
|
1125
1232
|
},
|
|
1126
1233
|
{
|
|
1127
1234
|
"key": "session_max_secret_score",
|
|
1128
1235
|
"type": "number",
|
|
1129
1236
|
"required": false,
|
|
1130
|
-
"description": "Highest secret detection score seen in any turn of the session (0-100)"
|
|
1237
|
+
"description": "Highest secret detection score seen in any turn of the session (0-100)",
|
|
1238
|
+
"range": "0-100"
|
|
1131
1239
|
},
|
|
1132
1240
|
{
|
|
1133
1241
|
"key": "session_cumulative_risk_score",
|
|
@@ -1313,31 +1421,36 @@
|
|
|
1313
1421
|
"key": "session_max_injection_score",
|
|
1314
1422
|
"type": "number",
|
|
1315
1423
|
"required": false,
|
|
1316
|
-
"description": "Highest prompt injection score seen in any turn of the session (0-100). Use for tiered responses: >75 hard block, >50 restrict permissions"
|
|
1424
|
+
"description": "Highest prompt injection score seen in any turn of the session (0-100). Use for tiered responses: >75 hard block, >50 restrict permissions",
|
|
1425
|
+
"range": "0-100"
|
|
1317
1426
|
},
|
|
1318
1427
|
{
|
|
1319
1428
|
"key": "session_max_jailbreak_score",
|
|
1320
1429
|
"type": "number",
|
|
1321
1430
|
"required": false,
|
|
1322
|
-
"description": "Highest jailbreak detection score seen in any turn of the session (0-100)"
|
|
1431
|
+
"description": "Highest jailbreak detection score seen in any turn of the session (0-100)",
|
|
1432
|
+
"range": "0-100"
|
|
1323
1433
|
},
|
|
1324
1434
|
{
|
|
1325
1435
|
"key": "session_max_command_injection_score",
|
|
1326
1436
|
"type": "number",
|
|
1327
1437
|
"required": false,
|
|
1328
|
-
"description": "Highest command injection score seen in any turn of the session (0-100)"
|
|
1438
|
+
"description": "Highest command injection score seen in any turn of the session (0-100)",
|
|
1439
|
+
"range": "0-100"
|
|
1329
1440
|
},
|
|
1330
1441
|
{
|
|
1331
1442
|
"key": "session_max_pii_score",
|
|
1332
1443
|
"type": "number",
|
|
1333
1444
|
"required": false,
|
|
1334
|
-
"description": "Highest PII risk score seen in any turn of the session (0-100)"
|
|
1445
|
+
"description": "Highest PII risk score seen in any turn of the session (0-100)",
|
|
1446
|
+
"range": "0-100"
|
|
1335
1447
|
},
|
|
1336
1448
|
{
|
|
1337
1449
|
"key": "session_max_secret_score",
|
|
1338
1450
|
"type": "number",
|
|
1339
1451
|
"required": false,
|
|
1340
|
-
"description": "Highest secret detection score seen in any turn of the session (0-100)"
|
|
1452
|
+
"description": "Highest secret detection score seen in any turn of the session (0-100)",
|
|
1453
|
+
"range": "0-100"
|
|
1341
1454
|
},
|
|
1342
1455
|
{
|
|
1343
1456
|
"key": "session_cumulative_risk_score",
|
|
@@ -427,6 +427,66 @@ when {
|
|
|
427
427
|
context has mcp_server_verified && context.mcp_server_verified == false
|
|
428
428
|
};
|
|
429
429
|
`;
|
|
430
|
+
const AI_GATEWAY_AGENT_SECURITY_MALICIOUS_PACKAGE_CEDAR = `// =============================================================================
|
|
431
|
+
// Malicious Package (Default)
|
|
432
|
+
// =============================================================================
|
|
433
|
+
// Blocks tool calls that install or download packages flagged as malicious
|
|
434
|
+
// by the osv.dev database (OpenSSF MAL- advisories). The malicious_package
|
|
435
|
+
// detector (Shield, Tier Slow) parses package-manager invocations (pip, npm,
|
|
436
|
+
// yarn, pnpm, bun, uv, gem, cargo, go, composer) out of tool-call arguments
|
|
437
|
+
// and checks each referenced package against the OSV batch API.
|
|
438
|
+
//
|
|
439
|
+
// Context keys consumed:
|
|
440
|
+
// - malicious_package_detected: Bool
|
|
441
|
+
// - package_install_detected: Bool
|
|
442
|
+
// - package_check_status: String ("" | "degraded")
|
|
443
|
+
//
|
|
444
|
+
// Compliance:
|
|
445
|
+
// - OWASP LLM03 (Supply Chain), OWASP ASI02
|
|
446
|
+
//
|
|
447
|
+
// Category: agent-security
|
|
448
|
+
// Namespace: AIGateway
|
|
449
|
+
// =============================================================================
|
|
450
|
+
|
|
451
|
+
@id("agent-security.block-malicious-package")
|
|
452
|
+
@name("Block malicious package installs")
|
|
453
|
+
@description("Blocks call_tool when a referenced package carries a known-malicious osv.dev (MAL-) advisory.")
|
|
454
|
+
@severity("critical")
|
|
455
|
+
@tags("category:agent-security,threat:supply-chain,detection:aggregate,surface:call-tool,owasp:llm03,owasp:asi02")
|
|
456
|
+
@reject_message("Package install blocked: the requested package is flagged as malicious in the osv.dev database.")
|
|
457
|
+
forbid (
|
|
458
|
+
principal,
|
|
459
|
+
action == AIGateway::Action::"call_tool",
|
|
460
|
+
resource
|
|
461
|
+
)
|
|
462
|
+
when {
|
|
463
|
+
context has malicious_package_detected &&
|
|
464
|
+
context.malicious_package_detected == true
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
// Alternative (fail-closed): the detector fails OPEN by design — when the
|
|
468
|
+
// OSV lookup is unavailable, installs proceed with package_check_status set
|
|
469
|
+
// to "degraded". Uncomment to block package installs whenever they cannot be
|
|
470
|
+
// verified, trading install availability for supply-chain certainty.
|
|
471
|
+
//
|
|
472
|
+
// @id("agent-security.block-unverified-package")
|
|
473
|
+
// @name("Block unverified package installs")
|
|
474
|
+
// @description("Blocks call_tool package installs when the malicious-package lookup is degraded.")
|
|
475
|
+
// @severity("medium")
|
|
476
|
+
// @tags("category:agent-security,threat:supply-chain,detection:aggregate,surface:call-tool,owasp:llm03")
|
|
477
|
+
// @reject_message("Package install blocked: the package could not be verified against the malicious-package database.")
|
|
478
|
+
// forbid (
|
|
479
|
+
// principal,
|
|
480
|
+
// action == AIGateway::Action::"call_tool",
|
|
481
|
+
// resource
|
|
482
|
+
// )
|
|
483
|
+
// when {
|
|
484
|
+
// context has package_install_detected &&
|
|
485
|
+
// context.package_install_detected == true &&
|
|
486
|
+
// context has package_check_status &&
|
|
487
|
+
// context.package_check_status == "degraded"
|
|
488
|
+
// };
|
|
489
|
+
`;
|
|
430
490
|
const AI_GATEWAY_TOOLS_MCP_SERVER_ALLOWLIST_CEDAR = `// =============================================================================
|
|
431
491
|
// MCP Server Allowlist
|
|
432
492
|
// =============================================================================
|
|
@@ -1366,6 +1426,15 @@ export const AI_GATEWAY_TEMPLATES = [
|
|
|
1366
1426
|
severity: 'critical',
|
|
1367
1427
|
tags: ['category:agent-security', 'threat:tool-poisoning', 'threat:rug-pull', 'threat:indirect-injection', 'threat:supply-chain', 'owasp:asi01', 'owasp:asi04'],
|
|
1368
1428
|
},
|
|
1429
|
+
{
|
|
1430
|
+
id: 'agent-security.malicious-package',
|
|
1431
|
+
name: 'Malicious Package',
|
|
1432
|
+
description: 'Block package installs (pip, npm, yarn, pnpm, bun, uv, gem, cargo, go, composer) flagged as malicious.',
|
|
1433
|
+
category: 'agent-security',
|
|
1434
|
+
cedarText: AI_GATEWAY_AGENT_SECURITY_MALICIOUS_PACKAGE_CEDAR,
|
|
1435
|
+
severity: 'critical',
|
|
1436
|
+
tags: ['category:agent-security', 'threat:supply-chain', 'owasp:llm03', 'owasp:asi02'],
|
|
1437
|
+
},
|
|
1369
1438
|
{
|
|
1370
1439
|
id: 'tools.mcp-server-allowlist',
|
|
1371
1440
|
name: 'MCP Server Allowlist',
|
|
@@ -1530,6 +1599,20 @@ export const AI_GATEWAY_TEMPLATES_JSON = `{
|
|
|
1530
1599
|
"owasp:asi04"
|
|
1531
1600
|
]
|
|
1532
1601
|
},
|
|
1602
|
+
{
|
|
1603
|
+
"id": "agent-security.malicious-package",
|
|
1604
|
+
"name": "Malicious Package",
|
|
1605
|
+
"description": "Block package installs (pip, npm, yarn, pnpm, bun, uv, gem, cargo, go, composer) flagged as malicious.",
|
|
1606
|
+
"category": "agent-security",
|
|
1607
|
+
"file": "defaults/malicious_package.cedar",
|
|
1608
|
+
"severity": "critical",
|
|
1609
|
+
"tags": [
|
|
1610
|
+
"category:agent-security",
|
|
1611
|
+
"threat:supply-chain",
|
|
1612
|
+
"owasp:llm03",
|
|
1613
|
+
"owasp:asi02"
|
|
1614
|
+
]
|
|
1615
|
+
},
|
|
1533
1616
|
{
|
|
1534
1617
|
"id": "tools.mcp-server-allowlist",
|
|
1535
1618
|
"name": "MCP Server Allowlist",
|
|
@@ -24,12 +24,22 @@ export declare const OverwatchContextKey: {
|
|
|
24
24
|
readonly LoopCount: "loop_count";
|
|
25
25
|
readonly LoopDetected: "loop_detected";
|
|
26
26
|
readonly LoopTool: "loop_tool";
|
|
27
|
+
readonly MaliciousPackageDetected: "malicious_package_detected";
|
|
28
|
+
readonly MaliciousPackageScore: "malicious_package_score";
|
|
29
|
+
readonly MaliciousPackages: "malicious_packages";
|
|
27
30
|
readonly MaxThreatSeverity: "max_threat_severity";
|
|
28
31
|
readonly McpConfigRisk: "mcp_config_risk";
|
|
29
32
|
readonly McpRiskScore: "mcp_risk_score";
|
|
30
33
|
readonly McpServer: "mcp_server";
|
|
31
34
|
readonly McpServerVerified: "mcp_server_verified";
|
|
32
35
|
readonly McpTool: "mcp_tool";
|
|
36
|
+
readonly PackageAdvisoryCount: "package_advisory_count";
|
|
37
|
+
readonly PackageCheckStatus: "package_check_status";
|
|
38
|
+
readonly PackageEcosystems: "package_ecosystems";
|
|
39
|
+
readonly PackageInstallDetected: "package_install_detected";
|
|
40
|
+
readonly PackageNames: "package_names";
|
|
41
|
+
readonly PackageRiskScore: "package_risk_score";
|
|
42
|
+
readonly PackagesChecked: "packages_checked";
|
|
33
43
|
readonly Path: "path";
|
|
34
44
|
readonly PatternType: "pattern_type";
|
|
35
45
|
readonly PiiCount: "pii_count";
|
|
@@ -83,4 +93,4 @@ export type OverwatchContextKey = (typeof OverwatchContextKey)[keyof typeof Over
|
|
|
83
93
|
* The full set of authorable context attribute keys for Overwatch.
|
|
84
94
|
* Iterate this to enumerate the authorable surface (cockpit, conformance).
|
|
85
95
|
*/
|
|
86
|
-
export declare const OverwatchContextKeys: readonly ["content", "crime_score", "cwd", "detected_threats", "event", "hate_speech_score", "highest_severity", "indirect_injection_score", "injection_deep_context_score", "injection_pulse_score", "injection_score", "invisible_chars_detected", "invisible_chars_score", "jailbreak_deep_context_score", "jailbreak_pulse_score", "jailbreak_score", "loop_count", "loop_detected", "loop_tool", "max_threat_severity", "mcp_config_risk", "mcp_risk_score", "mcp_server", "mcp_server_verified", "mcp_tool", "path", "pattern_type", "pii_count", "pii_detected", "pii_score", "pii_types", "privilege_scope", "profanity_score", "prompt_text", "response_content", "role", "rug_pull_detected", "rug_pull_score", "secret_count", "secret_types", "secrets_detected", "sequence_risk", "session_command_injection", "session_cumulative_risk_score", "session_injection_detected", "session_max_command_injection_score", "session_max_injection_score", "session_max_jailbreak_score", "session_max_pii_score", "session_max_secret_score", "session_pii_detected", "session_pii_types", "session_secret_types", "session_secrets_detected", "session_threat_turns", "sexual_score", "source", "suspicious_pattern", "threat_categories", "threat_count", "tool_category", "tool_is_builtin", "tool_is_sensitive", "tool_name", "tool_operation_classes", "tool_poisoning_detected", "tool_poisoning_score", "tool_risk_score", "user_email", "violence_score", "weapons_score", "workspace_root"];
|
|
96
|
+
export declare const OverwatchContextKeys: readonly ["content", "crime_score", "cwd", "detected_threats", "event", "hate_speech_score", "highest_severity", "indirect_injection_score", "injection_deep_context_score", "injection_pulse_score", "injection_score", "invisible_chars_detected", "invisible_chars_score", "jailbreak_deep_context_score", "jailbreak_pulse_score", "jailbreak_score", "loop_count", "loop_detected", "loop_tool", "malicious_package_detected", "malicious_package_score", "malicious_packages", "max_threat_severity", "mcp_config_risk", "mcp_risk_score", "mcp_server", "mcp_server_verified", "mcp_tool", "package_advisory_count", "package_check_status", "package_ecosystems", "package_install_detected", "package_names", "package_risk_score", "packages_checked", "path", "pattern_type", "pii_count", "pii_detected", "pii_score", "pii_types", "privilege_scope", "profanity_score", "prompt_text", "response_content", "role", "rug_pull_detected", "rug_pull_score", "secret_count", "secret_types", "secrets_detected", "sequence_risk", "session_command_injection", "session_cumulative_risk_score", "session_injection_detected", "session_max_command_injection_score", "session_max_injection_score", "session_max_jailbreak_score", "session_max_pii_score", "session_max_secret_score", "session_pii_detected", "session_pii_types", "session_secret_types", "session_secrets_detected", "session_threat_turns", "sexual_score", "source", "suspicious_pattern", "threat_categories", "threat_count", "tool_category", "tool_is_builtin", "tool_is_sensitive", "tool_name", "tool_operation_classes", "tool_poisoning_detected", "tool_poisoning_score", "tool_risk_score", "user_email", "violence_score", "weapons_score", "workspace_root"];
|
|
@@ -26,12 +26,22 @@ export const OverwatchContextKey = {
|
|
|
26
26
|
LoopCount: 'loop_count',
|
|
27
27
|
LoopDetected: 'loop_detected',
|
|
28
28
|
LoopTool: 'loop_tool',
|
|
29
|
+
MaliciousPackageDetected: 'malicious_package_detected',
|
|
30
|
+
MaliciousPackageScore: 'malicious_package_score',
|
|
31
|
+
MaliciousPackages: 'malicious_packages',
|
|
29
32
|
MaxThreatSeverity: 'max_threat_severity',
|
|
30
33
|
McpConfigRisk: 'mcp_config_risk',
|
|
31
34
|
McpRiskScore: 'mcp_risk_score',
|
|
32
35
|
McpServer: 'mcp_server',
|
|
33
36
|
McpServerVerified: 'mcp_server_verified',
|
|
34
37
|
McpTool: 'mcp_tool',
|
|
38
|
+
PackageAdvisoryCount: 'package_advisory_count',
|
|
39
|
+
PackageCheckStatus: 'package_check_status',
|
|
40
|
+
PackageEcosystems: 'package_ecosystems',
|
|
41
|
+
PackageInstallDetected: 'package_install_detected',
|
|
42
|
+
PackageNames: 'package_names',
|
|
43
|
+
PackageRiskScore: 'package_risk_score',
|
|
44
|
+
PackagesChecked: 'packages_checked',
|
|
35
45
|
Path: 'path',
|
|
36
46
|
PatternType: 'pattern_type',
|
|
37
47
|
PiiCount: 'pii_count',
|
|
@@ -104,12 +114,22 @@ export const OverwatchContextKeys = [
|
|
|
104
114
|
OverwatchContextKey.LoopCount,
|
|
105
115
|
OverwatchContextKey.LoopDetected,
|
|
106
116
|
OverwatchContextKey.LoopTool,
|
|
117
|
+
OverwatchContextKey.MaliciousPackageDetected,
|
|
118
|
+
OverwatchContextKey.MaliciousPackageScore,
|
|
119
|
+
OverwatchContextKey.MaliciousPackages,
|
|
107
120
|
OverwatchContextKey.MaxThreatSeverity,
|
|
108
121
|
OverwatchContextKey.McpConfigRisk,
|
|
109
122
|
OverwatchContextKey.McpRiskScore,
|
|
110
123
|
OverwatchContextKey.McpServer,
|
|
111
124
|
OverwatchContextKey.McpServerVerified,
|
|
112
125
|
OverwatchContextKey.McpTool,
|
|
126
|
+
OverwatchContextKey.PackageAdvisoryCount,
|
|
127
|
+
OverwatchContextKey.PackageCheckStatus,
|
|
128
|
+
OverwatchContextKey.PackageEcosystems,
|
|
129
|
+
OverwatchContextKey.PackageInstallDetected,
|
|
130
|
+
OverwatchContextKey.PackageNames,
|
|
131
|
+
OverwatchContextKey.PackageRiskScore,
|
|
132
|
+
OverwatchContextKey.PackagesChecked,
|
|
113
133
|
OverwatchContextKey.Path,
|
|
114
134
|
OverwatchContextKey.PatternType,
|
|
115
135
|
OverwatchContextKey.PiiCount,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Overwatch policy category identifiers.
|
|
3
3
|
* Maps to UI tab names in Studio.
|
|
4
4
|
*/
|
|
5
|
-
export type OverwatchCategory = 'data-protection' | 'privacy' | 'semantic' | 'trust-safety' | 'tools' | 'agent-identity' | 'organization';
|
|
5
|
+
export type OverwatchCategory = 'data-protection' | 'privacy' | 'semantic' | 'trust-safety' | 'tools' | 'agent-identity' | 'agent-security' | 'organization';
|
|
6
6
|
/**
|
|
7
7
|
* Category metadata for UI display.
|
|
8
8
|
*/
|