Models¶
Core data models for agents, MCP servers, packages, vulnerabilities, and reports.
agent_bom.models ¶
Core data models for AI-BOM inventory.
Agent
dataclass
¶
An AI agent (client) that connects to MCP servers.
Source code in src/agent_bom/models.py
AgentType ¶
Bases: str, Enum
Source code in src/agent_bom/models.py
AgentStatus ¶
MCPServer
dataclass
¶
An MCP server with its tools, resources, and dependencies.
Source code in src/agent_bom/models.py
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 | |
stable_id
property
¶
Deterministic ID for this MCP server.
Uses registry_id when available (most stable identifier), otherwise falls back to name+command so the same server is always the same ID.
credential_names
property
¶
Return names of env vars that look like credentials.
is_mcp_surface
property
¶
True only for real MCP servers, not synthetic scan wrappers.
allows_registry_resolution
property
¶
Whether MCP registry/marketplace fallback is valid for this surface.
MCPTool
dataclass
¶
A tool exposed by an MCP server.
Source code in src/agent_bom/models.py
Package
dataclass
¶
A software package dependency.
Source code in src/agent_bom/models.py
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 | |
stable_id
property
¶
Deterministic ID for this package instance.
Same ecosystem/name/version (or purl when available) always produces the same ID across scans — enables first-seen/last-seen tracking.
primary_occurrence
property
¶
First observed occurrence in deterministic layer order.
layer_count
property
¶
Number of unique image layers that contributed this package.
Vulnerability
dataclass
¶
A known vulnerability in a package.
Source code in src/agent_bom/models.py
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 | |
is_actively_exploited
property
¶
Check if vulnerability is being actively exploited.
True when in CISA KEV catalog or EPSS score exceeds the active exploitation threshold (default 0.5, configurable via AGENT_BOM_EPSS_ACTIVE_THRESHOLD).
exploit_likelihood
property
¶
Graded exploit-likelihood signal derived from CISA KEV + EPSS percentile + EPSS probability (issue #486 scope-cut).
Returns one of:
"actively_exploited"— present in CISA KEV (observed exploitation in the wild)."likely_exploited"— EPSS probability at or above theEPSS_ACTIVE_EXPLOITATION_THRESHOLD(default 0.5) OR EPSS percentile ≥ 95. Sophisticated attackers are known to be working on (or using) exploits."public_exploit"— EPSS percentile ≥ 80. Public exploit code exists but widespread exploitation not yet observed."theoretical"— no KEV, low EPSS. Exploitation is theoretically possible but not currently evidenced.
The monotonic ordering means the highest-severity signal wins (KEV always beats EPSS-only signals) and never double-counts.
Not a replacement for is_actively_exploited (boolean); this
property provides the four-level gradation downstream consumers
(HTML, SARIF, dashboards) use for prioritization and
triage-ordering.
all_advisory_sources
property
¶
Return advisory + enrichment sources that contributed to this finding.
advisory_coverage_state
property
¶
Summarize whether the finding is primary-only or enrichment-backed.
risk_level
property
¶
Calculate overall risk level using configurable EPSS thresholds.
__post_init__ ¶
Sanitize fixed_version — filter git SHAs and non-version strings.
Source code in src/agent_bom/models.py
Severity ¶
BlastRadius
dataclass
¶
Blast radius analysis for a vulnerability.
Source code in src/agent_bom/models.py
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 | |
reachability
property
¶
Classify how reachable this vulnerability is through the blast radius.
Returns:
| Type | Description |
|---|---|
str
|
"confirmed" — credentials OR tools exposed + direct dependency |
str
|
"likely" — credentials OR tools exposed OR direct dep with agents |
str
|
"unlikely" — transitive dep, no creds, no tools, LOW severity |
str
|
"unknown" — insufficient data to determine |
is_actionable
property
¶
Whether this finding warrants user attention in default output.
LOW/MEDIUM transitive deps with no blast radius context are noise. Users can still see them with --verbose.
layer_attribution
property
¶
Concrete package occurrences that carry this vulnerability.
calculate_risk_score ¶
Calculate contextual risk score based on blast radius.
All weights and thresholds are configurable via AGENT_BOM_RISK_*
environment variables. See :mod:agent_bom.config for defaults and
documentation.
Source code in src/agent_bom/models.py
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 | |
AIBOMReport
dataclass
¶
Complete AI-BOM report.
Source code in src/agent_bom/models.py
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 | |
has_mcp_context
property
¶
True if scan discovered real MCP servers (not synthetic SBOM/image wrappers).
Uses explicit server surface classification rather than command heuristics.
has_agent_context
property
¶
True if scan discovered real AI agents (not synthetic SBOM/image wrappers).
Synthetic agents (SBOM ingest, image scan) use AgentType.CUSTOM with
names prefixed by sbom: or image:. Real discovered agents have
specific agent types (CLAUDE_DESKTOP, CURSOR, etc.).
to_findings ¶
Return the unified findings list, auto-populating from blast_radii if empty.
Phase 1 shim: if self.findings is already populated (dual-write path),
return it directly. Otherwise convert blast_radii on the fly so callers
can always work with the unified model.
Source code in src/agent_bom/models.py
cve_findings ¶
Return only CVE-type findings from the unified stream.