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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bce45c9
dc20d40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bce45c9
dc20d40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
{
  "query_lineage": [
    {
      "description": "To answer software-factory related questions such as: What repos (or code repositories) are related/part of a product? or What are all the software-factory related components of a product (in this case query for asset_type and asset_name for the logical_app and logical_app_version)?"
    },
    {
      "args": {
        "columns": [],
        "filters": [],
        "metrics": [],
        "groupby": [],
        "orderby": [],
        "row_limit": 20
      },
      "instructions": "Output ONLY the JSON object with no extra text, keep Querys as simple as possible while still including all relvant info. If the query mentions querying a specific table\u2014like the vulnerabilities table\u2014or requests something like the lineage graph, the function called should correspond to that specific query."
    },
    {
      "columns": {
        "description": "list of columns to select. Use only these valid columns. Don't use extra columns, only the ones you need. If using metrics, all columns must appear in groupby.",
        "Valid Columns": [
          [
            "platform_type",
            "The type of platform to which the asset belongs (e.g SCM)"
          ],
          [
            "properties",
            "A raw json of the asset record from the attestation"
          ],
          [
            "version_id",
            "Table ID of the version"
          ],
          [
            "product_id",
            "Table ID of the product"
          ],
          [
            "parent_name",
            "The asset name of the parent asset"
          ],
          [
            "parent_type",
            "The asset type of the parent asset"
          ],
          [
            "asset_name",
            "The name of the asset"
          ],
          [
            "path",
            "A url/location of where to find the asset"
          ],
          [
            "parent_id",
            "The table id of the parent asset"
          ],
          [
            "child_id",
            "The table id of the child asset"
          ],
          [
            "teamId",
            "Scribe teamID (required for RLS)"
          ],
          [
            "owner",
            "Not Applicable"
          ],
          [
            "platform_name",
            "Name of the platform to which an asset belongs (e.g Github)"
          ],
          [
            "asset_type",
            "The type of asset (e.g image)"
          ],
          [
            "external_id",
            "Asset identifier as extracted from the relevant api or calculated"
          ],
          [
            "timestamp",
            "Timestamp of when the asset was inserted into the table"
          ],
          [
            "uri",
            "URL of the asset"
          ],
          [
            "prent_bloack",
            ""
          ],
          [
            "more",
            ""
          ],
          [
            "tooltip",
            "Pop up showing field showing asset name when hovering"
          ],
          [
            "parent_external_id",
            "Asset identifier as extracted from the relevant api or calculated for the parent of the asset"
          ],
          [
            "logical_app",
            "Product name"
          ],
          [
            "logical_app_version",
            "Version of the product"
          ],
          [
            "asset_block",
            ""
          ],
          [
            "g-source",
            "The source of the asset ( the assets parents external id combined with the parent assets type)"
          ],
          [
            "g-target",
            "The target asset ( the assets external id combined with the assets type)"
          ]
        ]
      }
    },
    {
      "filters": {
        "description": "List of filter objects with keys. When making multiple similar queries, e.g., for each ..., use the 'in' operator to group them and provide 'val' as a list.",
        "use": {
          "col": "column name (must be valid)",
          "op": "operator: ==, !=, >, <, >=, <=, in, not in, is null, is not null",
          "val": "filter value"
        }
      }
    },
    {
      "metrics": {
        "description": "Use this when the question asks for how many or to find the value of something, otherwise it should be []",
        "use": {
          "label": "output column name",
          "expressionType": "SQL",
          "sqlExpression": "e.g. \"COUNT(*)\""
        }
      }
    },
    {
      "groupby": {
        "description": "List of columns to group the query by. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "orderby": {
        "description": "List of [column_name or metric_label, is_ascending_boolean]. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "row_limit": {
        "description": "integer, 0 < int <= 30"
      }
    }
  ],
  "query_policy_results": [
    {
      "description": "To answer questions about policy evaluations like: What are the policy rules used? or Which of my products has SSDF policy violations? or List policy violations for a product."
    },
    {
      "args": {
        "columns": [],
        "filters": [],
        "metrics": [],
        "groupby": [],
        "orderby": [],
        "row_limit": 20
      },
      "instructions": "Output ONLY the JSON object with no extra text, keep Querys as simple as possible while still including all relvant info. If the query mentions querying a specific table\u2014like the vulnerabilities table\u2014or requests something like the lineage graph, the function called should correspond to that specific query."
    },
    {
      "columns": {
        "description": "list of columns to select. Use only these valid columns. Don't use extra columns, only the ones you need. If using metrics, all columns must appear in groupby.",
        "Valid Columns": [
          [
            "control_name",
            "Policy control name"
          ],
          [
            "rule_name",
            "The policy rule"
          ],
          [
            "logical_app_version",
            "Version of the product"
          ],
          [
            "formatted_msg",
            "Rule result message formatted to not break json object"
          ],
          [
            "more_json",
            "Rule result details as a json object"
          ],
          [
            "details",
            "Rule results details as xmlelement for display in UI"
          ],
          [
            "initiative_name",
            "Name of the policy initiative"
          ],
          [
            "is_latest_logical_version",
            "True if this version is the latest"
          ],
          [
            "asset",
            "Asset the rule run on and its type in parentheses"
          ],
          [
            "gate",
            "Location where the policy evalution took place and its type in parentheses"
          ],
          [
            "initiative_hash",
            "Hash of the whole initiaitive (for version differentiation)"
          ],
          [
            "count",
            "Numer of occurences of the rule evaluation on the asset with the same rule result (for vulnerabilities each vulnerability found counts as one occurrance)"
          ],
          [
            "message",
            "Rule result message"
          ],
          [
            "logical_app",
            "Product name"
          ],
          [
            "evaluations",
            "Raw SARIF of the rule result as a json object"
          ],
          [
            "date",
            "Date of last policy evaluation"
          ],
          [
            "time_evaluated",
            "Rule evaluation timestamp"
          ],
          [
            "asset_id",
            "Asset identifier as extracted from the relevant API or calculated (not necessarily unique)"
          ],
          [
            "teamId",
            "Scribe teamID (required for RLS)"
          ],
          [
            "version_id",
            "Product version id"
          ],
          [
            "gate_name",
            "Location where the policy evalution took place"
          ],
          [
            "asset_name",
            "Asset the rule run on"
          ],
          [
            "gate_type",
            "Location type where the policy evalution took place"
          ],
          [
            "status",
            "Rule result status"
          ],
          [
            "asset_type",
            "Type of the asset the rule run on"
          ],
          [
            "rule_id",
            "Policy rule ID in the format of \"rule-id:<initiative-id>/<control-id>/<rule-id>"
          ],
          [
            "status_icon",
            "Display icon for the rule result status"
          ],
          [
            "product_id",
            "Rule ID of the product"
          ]
        ]
      }
    },
    {
      "filters": {
        "description": "List of filter objects with keys. When making multiple similar queries, e.g., for each ..., use the 'in' operator to group them and provide 'val' as a list.",
        "use": {
          "col": "column name (must be valid)",
          "op": "operator: ==, !=, >, <, >=, <=, in, not in, is null, is not null",
          "val": "filter value"
        }
      }
    },
    {
      "metrics": {
        "description": "Use this when the question asks for how many or to find the value of something, otherwise it should be []",
        "use": {
          "label": "output column name",
          "expressionType": "SQL",
          "sqlExpression": "e.g. \"COUNT(*)\""
        }
      }
    },
    {
      "groupby": {
        "description": "List of columns to group the query by. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "orderby": {
        "description": "List of [column_name or metric_label, is_ascending_boolean]. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "row_limit": {
        "description": "integer, 0 < int <= 30"
      }
    }
  ],
  "query_products": [
    {
      "description": "To answer questions about products like: what are the/my products? What are the components of my product (the this case use the targetName column!)? What are the depdencieis of my product (search the component_name column)? Note that repositories and namespaces are part of the lineage table."
    },
    {
      "args": {
        "columns": [],
        "filters": [],
        "metrics": [],
        "groupby": [],
        "orderby": [],
        "row_limit": 20
      },
      "instructions": "Output ONLY the JSON object with no extra text, keep Querys as simple as possible while still including all relvant info. If the query mentions querying a specific table\u2014like the vulnerabilities table\u2014or requests something like the lineage graph, the function called should correspond to that specific query."
    },
    {
      "columns": {
        "description": "list of columns to select. Use only these valid columns. Don't use extra columns, only the ones you need. If using metrics, all columns must appear in groupby.",
        "Valid Columns": [
          [
            "more",
            "UI expandable element containing detailed component information"
          ],
          [
            "license_is_permissive_na",
            "Permissive license flag with false default for unknown licenses"
          ],
          [
            "teamId",
            "Scribe teamID (required for RLS)"
          ],
          [
            "component_version",
            "Exact version of the component currently in use"
          ],
          [
            "license_expression",
            "Complex license expression for dual or conditional licensing"
          ],
          [
            "pkg",
            "Package manager (duplicate of component_group for compatibility)"
          ],
          [
            "rstatus",
            "Version publication status (Latest, Published, or Draft)"
          ],
          [
            "component_purl",
            "Package URL - universal component identifier across ecosystems"
          ],
          [
            "dependency_parents",
            "Array of components that depend on this component"
          ],
          [
            "dependency_children",
            "Array of components that this component depends on"
          ],
          [
            "component_dependency_type",
            "Array of dependency types (runtime, compile, test, optional, development)"
          ],
          [
            "logical_app",
            "Product name"
          ],
          [
            "logical_app_version",
            "Version of the product"
          ],
          [
            "scorecard_id",
            "Reference to detailed OpenSSF Scorecard analysis record"
          ],
          [
            "version_is_up_to_date",
            "Boolean indicating if the component is using the latest available version"
          ],
          [
            "product_id",
            "Unique identifier of the product/application containing this component"
          ],
          [
            "attestation_name",
            "Name of the attestation that discovered this component"
          ],
          [
            "high_severity_cves",
            "Count of critical and high severity vulnerabilities"
          ],
          [
            "maintenance_score",
            "Text representation of component maintenance health assessment"
          ],
          [
            "component_name",
            "Full name of the component including namespace if applicable"
          ],
          [
            "labels",
            "Custom tags for categorization and filtering (tier, environment, etc.)"
          ],
          [
            "licenses",
            "SPDX license identifiers for the component"
          ],
          [
            "attestation_ids",
            "Array of attestation record IDs linked to this component"
          ],
          [
            "component_external_ref",
            "URL to component repository, documentation, or homepage"
          ],
          [
            "license_expression_na",
            "License expression with N/A displayed for missing license data"
          ],
          [
            "component_publisher",
            "Organization or individual who published the component to the package registry"
          ],
          [
            "component_description",
            "Brief description of the component's functionality and purpose"
          ],
          [
            "targets_translated",
            "User-friendly SBOM type (container\u2192image, git\u2192source)"
          ],
          [
            "component_author",
            "Original creator or maintainer of the component"
          ],
          [
            "relation",
            "Human-readable summary of dependency relationships"
          ],
          [
            "main_tool",
            "Primary scanner tool that generated this SBOM entry"
          ],
          [
            "maintenance_score_int",
            "The dependency's OpenSSF maintenance score (as an integer) [Check]"
          ],
          [
            "block",
            ""
          ],
          [
            "tools",
            "Comma-separated list of scanners that detected this component"
          ],
          [
            "license_is_permissive",
            "Boolean indicating if the license allows free use (true for MIT/Apache, false for GPL)"
          ],
          [
            "scorecard_score",
            "OpenSSF security score (0.0-10.0) measuring security practices"
          ],
          [
            "targets",
            "SBOM type indicating source (container, git, package, file, etc.)"
          ],
          [
            "component_type",
            "Component classification (library, framework, application, etc.)"
          ],
          [
            "source_layer",
            "Container layer or source location where component was introduced"
          ],
          [
            "component_locations",
            "JSON array of file paths and locations where component is used"
          ],
          [
            "component_id",
            "Id of the component foud in the attestation"
          ],
          [
            "id",
            "Unique record identifier for this SBOM entry"
          ],
          [
            "base_layer",
            "is dependency coming from a an image layer that is a known base layer"
          ],
          [
            "latest_version",
            "Most recent version available in the package registry"
          ],
          [
            "tag",
            "Version tag or release identifier for the component"
          ],
          [
            "targetName",
            "Primary name of the component as it appears in the package manager"
          ],
          [
            "component_group",
            "Package manager or ecosystem (npm, maven, pypi, docker, gem, go, etc.)"
          ],
          [
            "version_timestamp",
            "Earliest upload timestamp of an attestation in the currently in the product version"
          ],
          [
            "attestation_ids_cnt",
            "Count of security attestations that have verified this component"
          ],
          [
            "pipeline_run_id",
            "Identifier of the ETL pipeline execution that created/updated this record"
          ]
        ]
      }
    },
    {
      "filters": {
        "description": "List of filter objects with keys. When making multiple similar queries, e.g., for each ..., use the 'in' operator to group them and provide 'val' as a list.",
        "use": {
          "col": "column name (must be valid)",
          "op": "operator: ==, !=, >, <, >=, <=, in, not in, is null, is not null",
          "val": "filter value"
        }
      }
    },
    {
      "metrics": {
        "description": "Use this when the question asks for how many or to find the value of something, otherwise it should be []",
        "use": {
          "label": "output column name",
          "expressionType": "SQL",
          "sqlExpression": "e.g. \"COUNT(*)\""
        }
      }
    },
    {
      "groupby": {
        "description": "List of columns to group the query by. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "orderby": {
        "description": "List of [column_name or metric_label, is_ascending_boolean]. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "row_limit": {
        "description": "integer, 0 < int <= 30"
      }
    }
  ],
  "query_risk": [
    {
      "description": "To answer questions about products like: what are the/my products? What are the components of my product (the this case use the targetName column!)? What are the depdencieis of my product (search the component_name column)? Note that repositories and namespaces are part of the lineage table."
    },
    {
      "args": {
        "columns": [],
        "filters": [],
        "metrics": [],
        "groupby": [],
        "orderby": [],
        "row_limit": 20
      },
      "instructions": "Output ONLY the JSON object with no extra text, keep Querys as simple as possible while still including all relvant info. If the query mentions querying a specific table\u2014like the vulnerabilities table\u2014or requests something like the lineage graph, the function called should correspond to that specific query."
    },
    {
      "columns": {
        "description": "list of columns to select. Use only these valid columns. Don't use extra columns, only the ones you need. If using metrics, all columns must appear in groupby.",
        "Valid Columns": [
          [
            "target_cves_in_base_image",
            "Number of CVEs in Component Base Image"
          ],
          [
            "total_completion",
            ""
          ],
          [
            "target_fixables",
            "Number of fixable risky CVEs of the component"
          ],
          [
            "weighted_cve_risk",
            "Risk imposed by the CVE, taking into account weights (business criticality, public facing, publicly available)"
          ],
          [
            "target_risk",
            "Total risk for this component of the product"
          ],
          [
            "has_fix",
            "True if there is a fix for this vulnerability (usually an udate for the vulnerable dependency)"
          ],
          [
            "in_base_image",
            "True if the vulnerability is in the base layer of a Docker image"
          ],
          [
            "target",
            "The component (usually a Docker image name:tag)"
          ],
          [
            "vulnerability_id",
            "CVE ID for this line"
          ],
          [
            "target_badges",
            ""
          ],
          [
            "logical_app_version_cves_in_base_image",
            "Total CVEs in base image for this product version"
          ],
          [
            "logical_app_version",
            "Version of Product in ScribeHub"
          ],
          [
            "logical_app",
            "Name of Product in ScribeHub. A product is made of components (e.g. a few docker images)"
          ],
          [
            "logical_app_version_exploitables",
            "Number of exploitable CVEs in the Product-Version"
          ],
          [
            "logical_app_version_fixables",
            "Number of Fixable CVEs in the product-version"
          ],
          [
            "weight",
            "the is the accumulated weight for this Componen (Target)"
          ],
          [
            "logical_app_version_risk",
            "Total risk for this Product Version"
          ],
          [
            "has_kev",
            "True if this CVE is a Known Exploitable Vulnerability"
          ],
          [
            "target_exploitables",
            "Number of Exploitable CVEs in the component"
          ],
          [
            "num_targets",
            "Number of Components in the Product"
          ],
          [
            "logical_app_badges",
            ""
          ],
          [
            "teamId",
            "ID of the team within Scribe"
          ],
          [
            "total_risk",
            "Total risk for this team (across all product-versions)"
          ],
          [
            "total_exploitables",
            "Total number of exploitable CVEs in the team"
          ],
          [
            "total_fixables",
            "Total number of CVEs with a fix in the team"
          ],
          [
            "total_cves_in_base_image",
            "Total number of CVEs that are in a base image, across the team"
          ],
          [
            "totals_badge",
            ""
          ],
          [
            "cve_badges",
            ""
          ]
        ]
      }
    },
    {
      "filters": {
        "description": "List of filter objects with keys. When making multiple similar queries, e.g., for each ..., use the 'in' operator to group them and provide 'val' as a list.",
        "use": {
          "col": "column name (must be valid)",
          "op": "operator: ==, !=, >, <, >=, <=, in, not in, is null, is not null",
          "val": "filter value"
        }
      }
    },
    {
      "metrics": {
        "description": "Use this when the question asks for how many or to find the value of something, otherwise it should be []",
        "use": {
          "label": "output column name",
          "expressionType": "SQL",
          "sqlExpression": "e.g. \"COUNT(*)\""
        }
      }
    },
    {
      "groupby": {
        "description": "List of columns to group the query by. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "orderby": {
        "description": "List of [column_name or metric_label, is_ascending_boolean]. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "row_limit": {
        "description": "integer, 0 < int <= 30"
      }
    }
  ],
  "query_vulnerabilities": [
    {
      "description": "To answer questions about vulnerabilities like: What are the vulnerabilities of my product? What are the vulnerabilities of a specific component? What are the vulnerabilities of a specific version of a component? Which products have a specific vulnerability, or a vulnerability with a specificy characteristic (such as has_key)"
    },
    {
      "args": {
        "columns": [],
        "filters": [],
        "metrics": [],
        "groupby": [],
        "orderby": [],
        "row_limit": 20
      },
      "instructions": "Output ONLY the JSON object with no extra text, keep Querys as simple as possible while still including all relvant info. If the query mentions querying a specific table\u2014like the vulnerabilities table\u2014or requests something like the lineage graph, the function called should correspond to that specific query."
    },
    {
      "columns": {
        "description": "list of columns to select. Use only these valid columns. Don't use extra columns, only the ones you need. If using metrics, all columns must appear in groupby.",
        "Valid Columns": [
          [
            "component_id",
            "The id of the component/dependency that the vulnerability affects"
          ],
          [
            "vulnerability_id",
            "the id of the vulnerability"
          ],
          [
            "vector",
            "The cvss vector of the vulnerability"
          ],
          [
            "severity_string",
            "severity string of the vulnerability (e.g Medium)"
          ],
          [
            "base_severity_string",
            "Text representation of the base severity level of the vulnerability"
          ],
          [
            "advisory_status",
            "current status of the advisory related to the vulnerability (e.g. draft, published, approved, rejected)"
          ],
          [
            "final_severity",
            "0 if a user/3rd part advisory that lowers the severity, if not lowered then its the severity of the vulnerability"
          ],
          [
            "tool",
            "The tool that found the vulnerability"
          ],
          [
            "teamId",
            "Scribe teamID (required for RLS)"
          ],
          [
            "pipeline_run_id",
            "Version(pipeline run) id that contains the vulnerability"
          ],
          [
            "pkg",
            "The package manager of the dependency that contains the vulnerability"
          ],
          [
            "latest_package_version",
            "The latest known versison of the dependency"
          ],
          [
            "attestation_ids",
            "The ids of the attestations in which the vulnerability was found"
          ],
          [
            "cvss_score",
            "The cvss score of the vulnerability"
          ],
          [
            "logical_app",
            "Product name"
          ],
          [
            "vul_component_fixed_in_versions",
            "The versions of the component in which the vulnerability as fixed"
          ],
          [
            "will_not_fix",
            "Reported by the source as the vulnerability on this component will not be fixed"
          ],
          [
            "attestation_name",
            "The name of the attestation where the vulnerability was found [CHECK]"
          ],
          [
            "tag",
            "The version of the component to which the vulnerability effects"
          ],
          [
            "targetName",
            "The name of the attestation where the vulnerability was found"
          ],
          [
            "base_score",
            "The severity score of the vulnerability (e.g 4)"
          ],
          [
            "source_layer",
            "container/image layer where vulnerability was introduced"
          ],
          [
            "text",
            "Details about the vulnerability as provided by the advisory"
          ],
          [
            "is_latest_logical_version",
            "True if this version is the latest"
          ],
          [
            "update",
            "[CHECK]"
          ],
          [
            "cwe_array",
            "array of CWE ID's"
          ],
          [
            "has_fix",
            "Resolves to TRUE if vulnerability has a fixed version"
          ],
          [
            "component_purl",
            "The package url of the effected dependency"
          ],
          [
            "component_version",
            "the version of the dependency/component that is vulnerable"
          ],
          [
            "component_locations",
            "The path to where the dependency was imported from into the project"
          ],
          [
            "vul_date_changed",
            "Timestamp of most recent vulnerability change"
          ],
          [
            "vul_component_created",
            "Time when the vulnerability component was inserted into the table"
          ],
          [
            "epssProbability",
            "The epss percentage for the vulnerability"
          ],
          [
            "vendor",
            "The vendor of the application who provided the advisory"
          ],
          [
            "direct_cwes",
            ""
          ],
          [
            "advisory_modified",
            "The timestamp refelecting the time in which the advisory was updated"
          ],
          [
            "hyper_links",
            "Hyper links provided by the advisory"
          ],
          [
            "advisory_text",
            "The description given about the vulnerability from this advisory"
          ],
          [
            "cwes",
            "The CWEs associated with the vulnerability"
          ],
          [
            "advisory_justification",
            "Justification when marking a product version as not affected by a specific vulnerability"
          ],
          [
            "component_dependency_type",
            "The relationship of the component to the overall system"
          ],
          [
            "cpes",
            "cpes of the depencies that are affected by the vulnerability"
          ],
          [
            "has_kev",
            "The vulnerability is a Known Exploitable Vulnerability"
          ],
          [
            "version_timestamp",
            "The timestamp of the version to which the vulnerability belongs"
          ],
          [
            "severity",
            "The severity score of the vulnerability (e,g 8)"
          ],
          [
            "epssPercentile",
            "The percentile rank of the EPSS score, indicating how likely the vulnerability is to be exploited compared to others"
          ],
          [
            "epssScoreDate",
            "The date when the EPSS (Exploit Prediction Scoring System) score was last updated for the vulnerability"
          ],
          [
            "vul_adv_id",
            "Unique identifier for the vulnerability advisory record"
          ],
          [
            "dependency_analysis",
            "Details on how the dependency was introduced: direct or transitive (dependent library of a library), through source (e.g. package.json) or image (e.g. Dockerfile)"
          ],
          [
            "main_tool",
            "Tool that found the vulnerability"
          ],
          [
            "vul_published_on",
            "When the vulnerability was published"
          ],
          [
            "vul_hyperlinks",
            "Hyperlinks provided by the vul advisory to sources of the vulnerability"
          ],
          [
            "component_name",
            "The name of the dependency/component that is vulnerable"
          ],
          [
            "product_id",
            "table id of the product"
          ],
          [
            "labels",
            "Labels set by valint or user whe uploading the attestation"
          ],
          [
            "vul_source",
            "The advisory who reported the vulnerability"
          ],
          [
            "targets",
            "List of components affected by the vulnerability"
          ],
          [
            "logical_app_version",
            "Version of the product"
          ],
          [
            "id",
            "Identfier of the row"
          ]
        ]
      }
    },
    {
      "filters": {
        "description": "List of filter objects with keys. When making multiple similar queries, e.g., for each ..., use the 'in' operator to group them and provide 'val' as a list.",
        "use": {
          "col": "column name (must be valid)",
          "op": "operator: ==, !=, >, <, >=, <=, in, not in, is null, is not null",
          "val": "filter value"
        }
      }
    },
    {
      "metrics": {
        "description": "Use this when the question asks for how many or to find the value of something, otherwise it should be []",
        "use": {
          "label": "output column name",
          "expressionType": "SQL",
          "sqlExpression": "e.g. \"COUNT(*)\""
        }
      }
    },
    {
      "groupby": {
        "description": "List of columns to group the query by. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "orderby": {
        "description": "List of [column_name or metric_label, is_ascending_boolean]. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "row_limit": {
        "description": "integer, 0 < int <= 30"
      }
    }
  ],
  "query_findings": [
    {
      "description": "Use this function to answer questions about security findings from tools, such as severities, CWE types, affected components, or file locations. Use it when asking about issues found in scans, their severity, tool origin, or impacted products."
    },
    {
      "args": {
        "columns": [],
        "filters": [],
        "metrics": [],
        "groupby": [],
        "orderby": [],
        "row_limit": 20
      },
      "instructions": "Output ONLY the JSON object with no extra text, keep Querys as simple as possible while still including all relvant info. If the query mentions querying a specific table\u2014like the vulnerabilities table\u2014or requests something like the lineage graph, the function called should correspond to that specific query."
    },
    {
      "columns": {
        "description": "list of columns to select. Use only these valid columns. Don't use extra columns, only the ones you need. If using metrics, all columns must appear in groupby.",
        "Valid Columns": [
          [
            "line",
            "line number in the source file or codebase where the vulnerability or issue was found"
          ],
          [
            "file_path",
            "The source code file/ configuration file/ component name or artifact/ path in a container or image in which the issue exists"
          ],
          [
            "description",
            "A description of the finding"
          ],
          [
            "title",
            "The title of the finding"
          ],
          [
            "parser",
            "The tool used to generate the attestation"
          ],
          [
            "targetName",
            "The name of the attestation uploaded"
          ],
          [
            "logical_app_version",
            "Version of the product"
          ],
          [
            "context",
            "The context of the attestation"
          ],
          [
            "original_attestation_id",
            "The id of the attestation which is uploaded to be converted"
          ],
          [
            "severity_string",
            "severity of the cve as a single word"
          ],
          [
            "finding",
            "A raw json record of the finding"
          ],
          [
            "severity",
            "The severity of the finding which corresponds to the severity string (e.g 4)"
          ],
          [
            "more",
            "A column showing more details about the finding"
          ],
          [
            "cvssv3",
            "The cvss vector for the finding"
          ],
          [
            "created",
            "Timestamp of when the record was inserted into the databse"
          ],
          [
            "cwe_id",
            "The CWE ID for associated with the finding"
          ],
          [
            "id",
            "the table id of the finding"
          ],
          [
            "main_tool",
            "The tool used to create the attestation"
          ],
          [
            "severity_order",
            "Assigns a ranking to the severity. e,g (0-Critical, 1-High)"
          ],
          [
            "product_id",
            "Unique identifier for the product associated with the finding"
          ],
          [
            "pipeline_id",
            "Identifier for the pipeline in which the finding was detected"
          ],
          [
            "attestation_id",
            "The source attestation for this data. This ID can be used to retrieve the attestation or its metadata"
          ],
          [
            "component_name",
            "The name of the component to which the finding belongs"
          ],
          [
            "logical_app",
            "Product name"
          ],
          [
            "teamId",
            "Scribe teamID (required for RLS)"
          ],
          [
            "attack_vector",
            "A column calculated by looking at the attack vector component of the cvss vector and assigns a rating. (e.g /AV:N is assigned Network for the attack vector being the network)"
          ],
          [
            "Severity",
            "A caluclated column that creates a div containing an image depicting the severity of the finding"
          ],
          [
            "availability_impact",
            "A column calculated by looking at the availability impact component of the cvss vector and assigns a rating. (e.g '/A:L' is assigned Low for a Low availability impact)"
          ],
          [
            "confidentiality_impact",
            "A column calculated by looking at the confidentiality impact component of the cvss vector and assigns a rating. (e.g '/C:L' is assigned Low for a Low confidentiality impact)"
          ],
          [
            "integrity_impact",
            "A column calculated by looking at the intergity component of the cvss vector and assigns an impact rating. E.g ( /I:H is assingned High for a high intergity impact)"
          ],
          [
            "attack_complexity",
            "A column calculated by looking at the attack complexity component of the cvss vector and assigns a rating. (e.g /AC:L is assigned High for a High attack complexity)"
          ]
        ]
      }
    },
    {
      "filters": {
        "description": "List of filter objects with keys. When making multiple similar queries, e.g., for each ..., use the 'in' operator to group them and provide 'val' as a list.",
        "use": {
          "col": "column name (must be valid)",
          "op": "operator: ==, !=, >, <, >=, <=, in, not in, is null, is not null",
          "val": "filter value"
        }
      }
    },
    {
      "metrics": {
        "description": "Use this when the question asks for how many or to find the value of something, otherwise it should be []",
        "use": {
          "label": "output column name",
          "expressionType": "SQL",
          "sqlExpression": "e.g. \"COUNT(*)\""
        }
      }
    },
    {
      "groupby": {
        "description": "List of columns to group the query by. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "orderby": {
        "description": "List of [column_name or metric_label, is_ascending_boolean]. Should be either valid column or metrics label, otherwise []"
      }
    },
    {
      "row_limit": {
        "description": "integer, 0 < int <= 30"
      }
    }
  ]
}