Skip to main content

Offline AI agent bill of materials and attack surface scanner

Project description

AgentBOM

CI PyPI Python License

Offline bill of materials and attack surface scanner for AI agent repositories.

AgentBOM helps reviewers answer a practical question: what AI providers, models, frameworks, prompts, MCP configuration, and sensitive capabilities exist in this agent repository, and which of those capabilities appear reachable from an AI actor?

It does not execute scanned code, import scanned modules, read secret values, or require network access.

AgentBOM HTML report preview

Quickstart

Install from PyPI:

pip install ai-agentbom

Scan a repository:

agentbom scan . --pretty

Generate the shareable reports most teams want in review:

agentbom scan . --output-dir agentbom-report --html --mermaid --sarif --pretty

Typical output:

Wrote agentbom-report/agentbom.json
Wrote agentbom-report/agentbom.md
Wrote agentbom-report/agentbom.html
Wrote agentbom-report/agentbom.mmd
Wrote agentbom-report/agentbom.sarif
Risk: high (70/100)

AgentBOM quickstart terminal demo

Why AgentBOM

AI agents combine model output with software capabilities. A dependency list or general static analyzer can tell you that code imports a package or calls a risky API, but it usually does not explain whether an agent framework, model, prompt, or MCP configuration appears connected to that capability.

AgentBOM makes that review repeatable:

  • maps AI-specific components: providers, models, frameworks, prompts, and MCP configuration
  • connects agent actors to reachable capabilities such as shell, code execution, network, database, cloud, and MCP tool invocation
  • records source paths, confidence, and rationale for review
  • produces deterministic JSON plus human-readable Markdown and HTML
  • exports Mermaid for architecture review and SARIF for GitHub code scanning
  • runs offline with zero telemetry and no runtime dependencies

Findings are review signals, not exploit claims.

AgentBOM vs. Traditional SAST

AgentBOM is not a replacement for SAST. It is a focused companion for AI agent review.

Question Traditional SAST AgentBOM
Is there a risky API call? Yes Yes, at a coarse deterministic level
Which AI provider or model is present? Usually no Yes
Which agent framework may route tool calls? Usually no Yes
Are prompt or MCP surfaces present? Usually no Yes
Can an AI actor appear to reach a capability? Usually no Yes
Does it work offline without executing code? Depends on tool Yes
Is output designed for AI governance evidence? Usually no Yes

Use SAST for language-specific vulnerability analysis. Use AgentBOM to explain the AI agent bill of materials and attack surface.

Demo Repositories

AgentBOM includes realistic static demos under examples/:

Run both demos:

agentbom scan examples/customer-support-agent --output-dir agentbom-report/support --html --mermaid --sarif --pretty
agentbom scan examples/research-agent --output-dir agentbom-report/research --html --mermaid --sarif --pretty

See the demo workflow for a repeatable walkthrough.

What It Finds

Area Examples
Providers OpenAI, Anthropic, Gemini
Models gpt-4o, gpt-4.1, claude-3-sonnet, gemini-2.0-flash
Frameworks LangChain, LlamaIndex, CrewAI, AutoGen, Semantic Kernel
MCP mcp.json, claude_desktop_config.json
Prompts AGENTS.md, CLAUDE.md, prompts/*.md, prompt YAML
Capabilities shell, code execution, network, database, cloud, MCP tool invocation
Policy gaps prompt files, MCP config, shell/cloud access without policy documentation
Secret references credential names such as OPENAI_API_KEY, never values

Reports

AgentBOM always writes:

  • agentbom.json: machine-readable findings
  • agentbom.md: human-readable review report

Optional reports:

Flag Output Use
--html agentbom.html self-contained offline report for humans
--mermaid agentbom.mmd GitHub-native attack surface graph
--sarif agentbom.sarif GitHub code scanning and SARIF consumers
--cyclonedx agentbom.cdx.json package ecosystem inventory workflows

The report guide explains how to read the findings: docs/report-guide.md.

Architecture

AgentBOM uses a deterministic static-analysis pipeline:

AgentBOM architecture flow

flowchart LR
  files[Repository files] --> filter[Text and size filter]
  filter --> detectors[Pattern detectors]
  detectors --> reachability[Reachability inference]
  reachability --> risk[Risk and policy scoring]
  risk --> reports[JSON, Markdown, HTML, Mermaid, SARIF]

Core concepts:

  • Providers: AI service vendors or runtime providers.
  • Models: concrete model identifiers found in code or configuration.
  • Frameworks: agent and orchestration libraries.
  • Capabilities: static evidence of sensitive actions.
  • Reachable capabilities: actor-to-capability relationships with risk and confidence.
  • Policy findings: missing controls or custom policy violations.

See ARCHITECTURE.md for implementation details.

GitHub Action

Use the bundled action to run AgentBOM in pull requests, upload SARIF, and keep the HTML/JSON/Markdown reports as workflow artifacts.

name: AgentBOM

on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read
  security-events: write

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run AgentBOM
        uses: vlcak27/agentbom@v0.5.0
        with:
          path: .
          fail-on: high
          sarif-upload: true
          html: true
          output-dir: agentbom-report

      - name: Upload AgentBOM reports
        uses: actions/upload-artifact@v4
        with:
          name: agentbom-report
          path: agentbom-report/

More details: docs/github-action.md.

CLI Reference

agentbom --help
agentbom scan --help

Common commands:

agentbom scan /path/to/agent-repo --pretty
agentbom scan /path/to/agent-repo --output-dir agentbom-report --html
agentbom scan /path/to/agent-repo --output-dir agentbom-report --mermaid
agentbom scan /path/to/agent-repo --output-dir agentbom-report --sarif
agentbom scan /path/to/agent-repo --policy agentbom-policy.yaml --sarif --pretty

Example policy:

deny_capabilities:
  - shell_execution
  - autonomous_execution

require:
  sandboxing: true
  human_approval: true

Output Example

Simplified JSON:

{
  "schema_version": "0.1.0",
  "repository": "examples/research-agent",
  "providers": [
    {"name": "anthropic", "path": "agent.py", "confidence": "high"}
  ],
  "frameworks": [
    {"name": "crewai", "path": "agent.py", "confidence": "high"}
  ],
  "capabilities": [
    {"name": "shell", "path": "agent.py", "confidence": "high"}
  ],
  "reachable_capabilities": [
    {
      "capability": "code_execution",
      "reachable_from": "crewai",
      "source_file": "agent.py",
      "risk": "high",
      "confidence": "high",
      "confidence_score": 100,
      "paths": ["shell_execution"]
    }
  ],
  "repository_risk": {
    "score": 100,
    "severity": "critical",
    "rationale": [
      "high-risk reachable capability detected: autonomous_execution, code_execution",
      "autonomous execution is present or reachable",
      "shell or code execution is present or reachable"
    ]
  }
}

Secret values are not stored or printed. Secret findings record names such as OPENAI_API_KEY so reviewers can see which credentials are referenced without exposing the values.

Security Model

AgentBOM is designed for safe repository review:

  • does not execute scanned code
  • does not import scanned modules
  • does not evaluate project plugins or dynamic configuration
  • skips files larger than 1 MB
  • skips binary-looking files
  • does not follow symlink loops
  • records secret names only, never secret values
  • works offline
  • emits deterministic output for the same input repository

Static analysis is intentionally conservative. Results should be reviewed by a human before being treated as a security decision.

Development

Contributor and security docs:

Install in editable mode:

pip install -e ".[dev]"

Run tests and linting:

ruff check .
pytest

Or use:

make check
make demo

Scan the demo repository:

agentbom scan examples/research-agent --output-dir agentbom-report --html --mermaid --sarif --pretty

Repository Structure

.
|-- src/agentbom/              # CLI, scanner, detectors, reports, exports
|-- tests/                     # pytest coverage for scanner and outputs
|-- docs/                      # report guide, demo workflow, schemas, assets
|-- examples/                  # demo repositories for scans
|-- .github/                   # workflows, issue templates, release templates
|-- action.yml                 # reusable GitHub Action definition
|-- ARCHITECTURE.md            # scanner design notes
|-- ROADMAP.md                 # planned improvements
|-- SPEC.md                    # project specification
`-- pyproject.toml             # package metadata and dev tooling

Roadmap

Near-term improvements focus on better package/config parsing, more detector coverage, deeper MCP analysis, and clearer policy validation while preserving offline operation, deterministic output, zero telemetry, and minimal dependencies.

See ROADMAP.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_agentbom-0.5.1.tar.gz (41.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_agentbom-0.5.1-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

Details for the file ai_agentbom-0.5.1.tar.gz.

File metadata

  • Download URL: ai_agentbom-0.5.1.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_agentbom-0.5.1.tar.gz
Algorithm Hash digest
SHA256 5b24633b6e8d1dac87e286002f7927d9135c27f05b5f50752b8e86fd0bc02b17
MD5 52f6ef19c53a02814c096f81f8c13104
BLAKE2b-256 66e5f6e952821c4899595e165e1d0faa0ad1345c0a380d1393353686a2e7d71d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_agentbom-0.5.1.tar.gz:

Publisher: release.yml on vlcak27/agentbom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_agentbom-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: ai_agentbom-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 36.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_agentbom-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd14b7a3e0e855fe886977a8dc64d87e624dd005c561d1ca5ce2e938f43af046
MD5 5e0da247bd8b8f9efc149a9f7cb11d8c
BLAKE2b-256 da72e2e66d9a00425cf751a70dd6341170e3b588d1461e693bffa60f1790d74b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_agentbom-0.5.1-py3-none-any.whl:

Publisher: release.yml on vlcak27/agentbom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page