Skip to Content
Dependencies

Generating an AIBOM

Produce a CycloneDX 1.6 AI Bill of Materials with xgrep sbom --include aibom — an inventory of the AI/LLM SDKs, frameworks, inference runtimes, and models a codebase uses, across 20 languages, fully offline.

xgrep sbom --include aibom builds an AI Bill of Materials (AIBOM): a machine-readable inventory of the AI building blocks a codebase uses — which model providers it calls (OpenAI, Anthropic, Google Vertex/Gemini, AWS Bedrock, Together AI, …), which orchestration frameworks it is built on (LangChain, LlamaIndex, Spring AI, the Vercel AI SDK, …), which local inference runtimes it embeds (Ollama, llama.cpp, Hugging Face Transformers, ONNX Runtime), and which models it requests (gpt-4o, claude-3-5-sonnet, …).

xgrep sbom --include aibom .

The path is optional — xgrep sbom --include aibom with no path scans the current directory, just like xgrep scan.

The scan is fully offline and reads source code, detecting AI usage with xgrep's language-aware rule engine — the AIBOM reflects what the code actually imports and calls, not what a manifest merely declares. Where a detected library also appears in the project's dependency manifests, its version and package URL (purl) are attached to the component (see Versions below); a library the code imports but no manifest pins simply stays version-less. The output is a CycloneDX 1.6 JSON document on stdout (or CycloneDX 1.7 with --spec-version 1.7, see CycloneDX 1.7 output):

xgrep sbom --include aibom --output aibom.cdx.json .

--include aibom selects the AI-inventory bill of materials on its own — it emits AI assets only, with no software dependencies. To get the AI inventory and your dependencies (and optionally cryptographic assets) as one merged CycloneDX document, list them together:

xgrep sbom --include sca,aibom --output bom.cdx.json .

See Combined bills of materials for the full content grid. Because AI-inventory detections are a distinct category, they never appear in a normal xgrep scan — an AIBOM is an inventory, not a list of vulnerabilities.

The older xgrep sbom --aibom flag still works as a deprecated alias for --include aibom, and is slated for removal in v0.3.0.

What it detects

Every detected asset is a CycloneDX component carrying an aibom:* property set. The aibom:kind facet classifies it, so a consumer can filter to just the providers, just the models, and so on:

aibom:kindWhat it isExamples
providera hosted/managed LLM API SDKOpenAI, Anthropic, Cohere, Together, Groq, AWS Bedrock, watsonx
frameworkan orchestration / agent frameworkLangChain, LlamaIndex, Spring AI, Vercel AI SDK, Semantic Kernel
inferencea local / self-hosted inference runtimeOllama, llama.cpp, Hugging Face Transformers, ONNX Runtime
ml-corea general ML frameworkPyTorch, TensorFlow, Keras, JAX, scikit-learn, XGBoost, ONNX, Candle, DJL
vector-dba RAG vector-store clientPinecone, Chroma, Qdrant, Milvus, Weaviate, pgvector, RedisVL, Elasticsearch (at a kNN search)
mlopsan experiment-tracking / model-registry clientMLflow, Weights & Biases
observabilityan LLM tracing / observability / eval platformLangSmith, Langfuse, Arize Phoenix, TruLens
guardrailsan LLM guardrail / safety I-O-validation libraryGuardrails AI, NeMo Guardrails, LLM Guard, LlamaFirewall
evaluationan LLM evaluation / testing frameworkRagas, DeepEval, Braintrust, Patronus AI, Inspect AI
modela specific model requested in codegpt-4o, claude-3-5-sonnet, gemini-1.5-pro

Other facets carried per asset:

  • aibom:provider — the canonical provider (e.g. Google Gemini for both the new and legacy Google SDKs), so distinct SDKs still roll up to one provider.
  • aibom:hosting — managed-api, cloud-platform, or local.
  • aibom:deprecated — set on superseded SDKs (e.g. Google's legacy google-generativeai, @xenova/transformers) so legacy AI usage is surfaced, not hidden.
  • aibom:openai-compatible — set on providers reached through the OpenAI SDK with a custom endpoint (see below).

Providers, frameworks, and inference runtimes are emitted as CycloneDX library components; models are emitted as machine-learning-model components.

Provider services

Each remote AI provider API the code reaches is also listed under the document's services, one entry per provider (two SDKs for the same API share one service):

  • Which: a managed provider SDK (OpenAI, Anthropic, Gemini, Cohere, AWS Bedrock, AWS SageMaker, Vertex AI, Azure OpenAI, …), a provider resolved from an OpenAI-compatible base_url, an unknown public base_url host, and the single collapsed self-hosted endpoint, Azure AI Inference, and Hugging Face's hosted inference where the code calls it (InferenceClient, smolagents' InferenceClientModel; importing huggingface_hub alone, which also downloads weights, is not a call). Frameworks, local runtimes, vector stores and tracing platforms get no service.
  • Self-hosted servers: a call the code sends to a self-hosted inference server it names (Ollama, vLLM, SGLang) is a service named by the server, with aibom:self-hosted=true and the configured base URLs as endpoints. The server is named by the client (ollama.New(ollama.WithModel(...))), by a settings section (ollama: with an api_base), or by a settings profile file pointing an OpenAI-compatible client at a local server (settings-vllm.yaml). Importing the server's package alone adds no service, since some of them also run in-process.
  • Framework clients: a framework's built-in integration for a provider is a call to that provider, even when the provider's own SDK is never imported: langchaingo openai.New(), Genkit's Google AI and Vertex AI plugins, Semantic Kernel's OpenAI connectors, LangChain's ChatOpenAI, Microsoft Agent Framework's OpenAI clients, the Claude Agent SDK client, Koog's executors and LangChain4j's Azure OpenAI models. These are only counted in files that import the framework, since names such as New are common, and only where the client is constructed: importing ChatOpenAI is not a call. An OpenAI client pointed at another endpoint (ChatOpenAI(base_url="http://localhost:11434/v1"), langchaingo openai.WithBaseURL(...), a Semantic Kernel connector given an endpoint, whether named, a new Uri(…) or a variable whose name says it is one (AddOpenAIChatCompletion("llama3", ollamaEndpoint, null)), an Agent Framework client given base_url) is not the OpenAI API: a URL written in the code is listed as the endpoint it names (a known provider, the self-hosted endpoint, or its host), and a URL the code reads from configuration lists no service.
  • Gateways: a Vercel AI SDK model given as a provider/model string (model: "openai/gpt-4o") is sent through the Vercel AI Gateway, so the model depends on both the gateway's service and the provider's. The model is named without the route (gpt-4o), so the same model stated as openai("gpt-4o") elsewhere is one model. The gateway's own provider names count (google/gemini-2.5-flash is Google Gemini, xai/grok-4 is xAI); a prefix naming no single provider (meta/llama-4-scout) still goes through the gateway, but names no provider service and keeps the prefix in the model name. A model handed to a provider function (openai("gpt-4o")) calls the provider directly. Mastra's provider/model strings name the provider the same way.
  • name, provider, group: the provider (OpenAI, AWS Bedrock) and the organisation that operates it (OpenAI, Amazon).
  • endpoints: the provider's documented API host (https://api.openai.com), or the URL the code configured as base_url. Bedrock, Vertex AI, Azure OpenAI and watsonx use regional or per-resource hosts, so no endpoint is stated for them.
  • trustZone: third-party, cloud-platform, or self-hosted. x-trust-boundary is true for every remote provider and public endpoint.
  • Properties: aibom:kind is service; aibom:evidence lists each source location (path:line) that reaches the service.
  • aibom:region: the cloud region the service is reached in, once per region, only where the code or infrastructure proves it (see Hosting region).

The dependencies graph links them: the SDK library provides its service, and a model dependsOn both its provider SDK and the service that serves it. A consumer that reads only components sees the same components as before.

Model facts

A model id the model catalog recognises carries:

  • aibom:creator (also the component group) — who made the model, which can differ from who serves it: an AWS Bedrock id such as anthropic.claude-3-5-sonnet-20241022-v2:0 has creator Anthropic.
  • aibom:hosting — on a model, the service that hosts it, stated only when the id itself proves it (a vendor-namespaced Bedrock id, or a Vertex AI publishers/…/models/… path).
  • aibom:family — the id without its snapshot, host or organisation prefix: gpt-4o and gpt-4o-2024-08-06 are both family gpt-4o.
  • version — the dated snapshot (2024-08-06, 20241022-v2:0); a floating alias such as gpt-4o or claude-3-5-sonnet-latest has none.
  • aibom:modality — text, embedding, rerank, image, or audio.
  • aibom:open-weights — true for models whose weights the creator publishes (Llama, Qwen, Phi, Gemma, Mixtral, DeepSeek-R1, …). Its absence means "not stated", not "closed". The catalog also knows the lines a creator serves through its API only (GPT-3.5/4/5, the o-series, Claude, Gemini, Cohere Embed and Rerank, …); the open-weights policy reads that (see Open weights only).

Two more facts come from the call that uses the model, not from its name, and are set only when the call proves them:

  • modelCard.modelParameters.task — what the call uses the model for, in the Hugging Face task vocabulary: chat-completion (a chat or messages call, a chat-model class, the Bedrock Converse API, ollama.chat), feature-extraction (an embeddings call, SentenceTransformer), text-ranking (a rerank call, a CrossEncoder), text-to-image (an images call, a text-to-image diffusers pipeline), text-to-speech, automatic-speech-recognition, text-generation (fill-in-the-middle, ollama.generate), the task a Transformers pipeline("…") names, and the task a model class's head names (AutoModelForCausalLM is text-generation). A call that can serve several tasks (Bedrock invoke_model, Gemini generate_content, a bare AutoModel) states none, and a model used for two different tasks in one codebase states none. A model the catalog does not place gets aibom:modality embedding or rerank from an embedding or ranking task.
  • purl — pkg:huggingface/<namespace>/<name> for a model loaded from the Hugging Face Hub: from_pretrained on a Transformers model class or a diffusers pipeline, a Transformers or Transformers.js pipeline, SentenceTransformer, CrossEncoder, hf_hub_download, snapshot_download, and a Hugging Face repository setting (llm_hf_repo_id, a tokenizer). It carries @<revision> only when the call pins a commit (revision="<40-hex commit>" in Python, { revision: '<40-hex commit>' } in a Transformers.js options object); a branch or tag such as main moves, so the purl stays version-less. A bare id (gpt2), a local path (including an org/name id that is a directory in the scanned project), and a call from a library with look-alike names (ModelScope's snapshot_download and AutoModel) get no Hub purl.

The catalog covers the published model lists of OpenAI, Anthropic, Google, Mistral AI, Cohere, xAI, DeepSeek, Meta, Alibaba (Qwen), Microsoft (Phi), AI21, Voyage AI, Nomic and Mixedbread. An id it does not recognise is still listed, with none of these facts rather than guessed ones.

Observability & tracing platforms

The observability kind inventories the LLM tracing / observability / evaluation platforms a codebase integrates — LangSmith, Langfuse, and Arize Phoenix (Python and JavaScript/TypeScript), plus Arize AX and TruLens (Python only, the languages with a first-party SDK). A traced application ships its prompts and completions to that third-party service, so its presence is a supply-chain and data-egress signal — a governance team can filter to aibom:kind=observability to see which external services receive model inputs and outputs. Detection is import-based and anchored precisely (for example, the phoenix import for Arize Phoenix is matched so the unrelated Apache phoenixdb driver is not). Tools enabled only through environment variables (LangSmith auto-tracing when LangChain is present) or a proxy/config (Helicone, promptfoo) are not import-detectable and are a documented gap.

Guardrail & safety tooling

The guardrails kind inventories the LLM guardrail / safety libraries an application uses to defend its model inputs and outputs — prompt-injection and jailbreak detection, PII redaction, content moderation, output validation. This is the inverse of the observability signal: filter to aibom:kind=guardrails to see whether — and with what — an LLM app validates its I/O. Detected today: Guardrails AI, NeMo Guardrails, LLM Guard, LlamaFirewall, and the legacy Rebuff (Python; Rebuff also JS/TS), plus OpenAI Guardrails (JavaScript/TypeScript). Detection is import-based. General-purpose tools that merely get used near an LLM (e.g. Microsoft Presidio for PII) are excluded, since an import alone is not a reliable guardrail signal; API-only services (Lakera) and models rather than libraries (Llama Guard) are out of scope.

Evaluation & testing frameworks

The evaluation kind inventories the LLM evaluation / testing frameworks an application uses to score or test model output — RAG and answer-quality metrics, faithfulness checks, pytest-style assertions, model-graded evals. It's the quality-assurance member of the AI-ops trio (alongside observability and guardrails): filter to aibom:kind=evaluation to see whether — and with what — an app's output quality is tested. Detected today: Ragas, DeepEval, Braintrust, Patronus AI (Python; DeepEval, Braintrust, and Patronus also JavaScript/TypeScript) and Inspect AI (Python). Detection is import-based; general-purpose ML tooling (Evidently, DeepChecks, HuggingFace evaluate) and config/CLI-only tools (promptfoo) are excluded, since an import alone is not a reliable LLM-evaluation signal.

Versions

When a detected library is also declared in the project's dependency manifests, its component carries the pinned version and a purl (e.g. pkg:pypi/openai@1.35.7, pkg:npm/openai@4.52.1, pkg:maven/com.openai/openai-java@0.31.0), so the inventory can be matched against advisory feeds. Versions are read offline from each ecosystem's manifests and lockfiles — package.json and npm lockfiles, go.mod, requirements.txt and the Python lockfiles, Cargo.lock, Gemfile.lock, composer.lock, pubspec.lock, Maven/Gradle (pom.xml), NuGet (packages.lock.json/packages.config), mix.lock, Package.resolved, conan.lock, Manifest.toml, and renv.lock — covering every language xgrep detects AI libraries in.

The version is only ever attached to a library the code actually imports, never synthesized from a manifest line nothing uses. A library with no matching manifest entry stays version-less rather than guessing. Because one provider can be reached from more than one ecosystem (say openai used from both Python and JavaScript), a component whose usages resolve to different versions is left version-less — the BOM states a version only when every usage agrees, and the per-file evidence still records where each import was found.

Providers reached through a custom endpoint

Many providers are used through the OpenAI SDK pointed at a different base URL. xgrep resolves the endpoint host to the real provider:

  • a known host (api.deepseek.com, openrouter.ai, api.groq.com, NVIDIA NIM, …) resolves to that provider, marked openai-compatible;
  • the canonical OpenAI/Azure endpoint adds no duplicate (the SDK component already represents it);
  • an unknown public host becomes a generic OpenAI-compatible endpoint asset named by its host;
  • a local host (loopback, an IP, localhost, a .local/single-label name) collapses into a single self-hosted LLM endpoint asset (local inference) rather than one component per address.

Provider calls from scripts

Scripts often call a provider's REST API directly, with no SDK: curl https://api.openai.com/v1/chat/completions -d '{"model": "gpt-4o-mini", …}'. xgrep inventories such a call from its URL:

  • a call to a known provider API host (OpenAI, Anthropic, Gemini, Mistral, Groq, OpenRouter, Cohere, …, an Azure OpenAI *.openai.azure.com resource, or a local Ollama server on port 11434; an explicit port such as :443 is the same host) lists that provider's service. No library component is listed, since no SDK is installed;
  • a literal model in the request (a JSON body's top-level "model" key, wherever it sits in the object, or the models/<id>: segment of a Gemini URL) is listed as a model that depends on the provider the URL reaches, whatever its name suggests;
  • in a shell script, a body piped to curl (echo '{…}' | curl <url> -d @-) is read like one passed as an argument, and a shell variable spliced in as the model ("model": "'$model'", or \"$model\" in a double-quoted body) names the literal the script assigns it (model="gpt-4o", aibom:resolved-via=constant);
  • a call to any other host is not inventoried, even if its path or query mentions a provider host, and a body read from a file, or a variable the script never assigns a literal, names no model.

In shell scripts, xgrep also lists the models a script drives through a CLI: ollama run/ollama pull, huggingface-cli download/hf download (a Hugging Face Hub model, with its pkg:huggingface purl; a download with --repo-type dataset or --repo-type space, in either the spaced or the = form, is skipped), and Azure OpenAI deployments made with az cognitiveservices account deployment create --model-name. The run: steps of GitHub Actions workflows and composite actions are read the same way (see below); shell in Dockerfile RUN lines is not yet scanned for these.

In Lua, the same applies to HTTP calls (lua-resty-http request_uri, LuaSocket http.request, plenary curl.post, …) to a provider host, with the model of a JSON-encoded request body. xgrep also lists the lua-openai client and its models, and the Neovim AI assistant plugins a configuration requires (avante.nvim, codecompanion.nvim, CopilotChat.nvim, copilot.lua, gp.nvim, ChatGPT.nvim, llm.nvim, minuet-ai.nvim, parrot.nvim, ollama.nvim). A plugin listed only in a lazy.nvim spec, and never required, is not yet detected.

In PowerShell, the same applies to Invoke-RestMethod and Invoke-WebRequest (and their aliases irm and iwr), with the URL given by -Uri or positionally (also after other named parameters, as in Invoke-RestMethod -Method Post '<url>'), and the model of a JSON -Body string. xgrep also lists the PSOpenAI, PowerShellAI and PSAI modules a script imports or installs, and the model a PSOpenAI cmdlet requests with -Model. A PSOpenAI cmdlet names the service it calls by -ApiType: Azure is Azure OpenAI (and its -Model is a deployment name, not a model), while no -ApiType or OpenAI is OpenAI; a value the script assigns to a variable first ($AuthType = 'Azure') counts too. A request body built as a hashtable and converted with ConvertTo-Json is not yet read for its model; the provider the call reaches is still listed.

In Groovy (including Jenkins pipelines), the same applies to new URL(…), "…".toURL(), URI.create(…) and the Jenkins HTTP Request plugin's httpRequest(url: …) step, with or without parentheses (httpRequest url: …, httpMode: 'POST'), with the model of its JSON requestBody. A paren-less step whose only argument is the URL is not yet read. Groovy code that uses the Java AI SDKs (Spring AI, LangChain4j, the OpenAI, Anthropic, Google, Azure and Bedrock SDKs, …) is inventoried like Java, from its imports and builder model names. Shell run by a Jenkins sh step is not yet scanned.

AI in CI workflow steps

A project can use a model with no code of its own, only through a GitHub Actions workflow step. xgrep reads .github/workflows/*.yml and composite actions' action.yml as YAML, so a comment, a step name or a string that merely mentions an action or a CLI is not a use:

  • a step that uses a known AI action is listed as a ci-action application, named by its owner/repo, with the ref after @ as its version, the purl the SBOM gives the same action (pkg:github/anthropics/claude-code-action@v1), and aibom:ci:pinned=true only when that ref is a full 40-character commit SHA. The provider the action calls is listed as a service it reaches. The known actions are Claude Code (anthropics/claude-code-action, anthropics/claude-code-base-action, anthropics/claude-code-security-review), Codex (openai/codex-action), the Gemini CLI (google-github-actions/run-gemini-cli, google-gemini/gemini-cli-action), GitHub Models (actions/ai-inference), the OpenAI pull-request reviewers coderabbitai/ai-pr-reviewer, anc95/ChatGPT-CodeReview and freeedcom/ai-codereviewer, and PR-Agent (qodo-ai/pr-agent, Codium-ai/pr-agent, whose provider is your configuration, so none is listed). Owner and repository are matched whole: myorg/claude-code-action or a fork under another name is not listed;
  • a run: step that runs an AI CLI headless is listed as an ai-cli application when the step gives it a key from the repository's secrets: claude -p/--print (Claude Code), codex exec (Codex), gemini -p/--prompt (the Gemini CLI), aider --message/-m/--message-file, and copilot -p/--prompt (the GitHub Copilot CLI). The key is one the CLI reads (ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN for Claude Code, OPENAI_API_KEY for Codex, GEMINI_API_KEY for the Gemini CLI, a provider's key for aider, COPILOT_GITHUB_TOKEN or GH_TOKEN for Copilot) set from ${{ secrets.… }} in the workflow's, job's or step's env:, or assigned inline (KEY=${{ secrets.… }} claude -p …); a secret passed on the command line counts too. The service listed is the provider that key is for, and the key's name (never its value) is recorded as aibom:ci:credential. The same command in a plain script file, or a step that reads its key from vars, a file or a login, is not listed: the source does not show it reach a model;
  • a provider API call or model CLI in a run: step is inventoried like one in a shell script (above).

A step's shell is its shell:, else the job's or workflow's defaults.run.shell, else the runner's default; PowerShell steps (and every step on a Windows runner without a shell set) are not read. These assets are dev-tooling (see the scope section below), except in a root action.yml, which is the product.

AWS Bedrock

How Bedrock is reached depends on the language. In Python it has no dedicated SDK — it rides the general boto3 cloud SDK with a bedrock/bedrock-runtime service selector, so xgrep keys on that service signal: boto3.client("bedrock-runtime") is inventoried while boto3.client("s3") is not. In JavaScript/TypeScript (and other languages with a dedicated Bedrock client package — e.g. Java's software.amazon.awssdk.services.bedrockruntime, Go's .../service/bedrockruntime, .NET's Amazon.BedrockRuntime), the import itself is the signal and is matched like any other SDK.

Models

When a call passes a string-literal model id — client.chat.completions.create(model="gpt-4o"), ChatAnthropic(model="claude-3-5-sonnet-20241022") — xgrep promotes it to a machine-learning-model component. This is not limited to chat: embedding, image, and audio model calls (embeddings.create(model="text-embedding-3-small"), images.generate(model="dall-e-3"), audio.speech.create(model="tts-1"), audio.transcriptions.create(model="whisper-1")) are captured the same way, so an inventory reflects the full set of models a codebase requests, not just chat ones. Its provider is inferred from the model name (gpt-* → OpenAI, claude-* → Anthropic, gemini-* → Google, …) rather than the call shape, since API shapes like .messages.create and .chat.completions.create are reused across SDKs; a model whose name matches no known provider is inventoried without a provider link rather than misattributed. A model passed as a variable is not turned into an asset (accuracy over recall).

Model-id capture is available for Python, JavaScript/TypeScript, Go, Java, Kotlin, C#, Rust, Ruby, and PHP. Where a language's SDK sets the model on an AI-specific call node (a params struct, a ModelId("…") wrapper, a new ChatClient(model: …)), any string-literal model is captured. Where it is set by a generic builder method deep in a chain (.model("…") / .modelName("…")), capture is limited to string-literal model ids whose name is a recognized AI model, so an unrelated .model("users") is never mistaken for a model asset.

Some SDKs name a model by a constant, an enum value or a class rather than a string. xgrep resolves those it carries a catalog for, read from the SDK's own source, and records aibom:resolved-via as constant or class:

  • Koog model constants on an agent (llmModel = OpenAIModels.Chat.GPT5Codex is gpt-5-codex, served by OpenAI), for the OpenAI, Anthropic, Google, Mistral AI, DeepSeek, Ollama and OpenRouter catalogs;
  • LangChain4j OpenAI model-name enums, qualified or statically imported (.modelName(GPT_4_O_MINI) is gpt-4o-mini);
  • LangChain4j in-process embedding classes: new AllMiniLmL6V2EmbeddingModel() is the all-MiniLM-L6-v2 model, run inside the JVM, so it reaches no service.

Other SDK constants are not captured.

AWS Bedrock invocations are captured too (Python, JavaScript/TypeScript, Go, Java, and C#): the model id passed to an InvokeModel or Converse call — for example boto3's client.invoke_model(modelId="anthropic.claude-3-5-sonnet-20240620-v1:0") or new InvokeModelCommand({ modelId: "amazon.titan-text-express-v1" }) — is promoted to a model component and attributed to AWS Bedrock, the provider that serves it. Cross-region inference-profile ids (us.anthropic.claude-…) are recognized as well.

Google Gemini / Vertex AI models are captured too (Python, JavaScript/TypeScript, Go, and Java), across Google's overlapping SDKs — the unified google-genai (models.generate_content(model="gemini-2.5-flash") / generateContent({ model })), the legacy google-generativeai and Vertex vertexai (GenerativeModel("gemini-1.5-pro")), and the LangChain adapters (ChatGoogleGenerativeAI / ChatVertexAI). The model resolves by name to Google Gemini; a models/-prefixed id (models/gemini-1.5-pro) is recognized too.

Mistral AI (Python, JavaScript/TypeScript) and Cohere (Python, JavaScript/TypeScript, Go) native SDKs are covered as well — Mistral's chat.complete("mistral-large-latest") / fim.complete("codestral-latest") and Cohere's chat / embed / rerank calls (command-*, embed-*, rerank-*). Mistral's open-mistral-* / open-mixtral-* open-weight models are attributed too.

Embedding / reranking specialists — Voyage AI, Nomic, and Mixedbread (Python, JavaScript/TypeScript) — are inventoried as providers, together with the embedding models they call (embed(model="voyage-3.5"), nomic-embed-text-v1.5, mixedbread-ai/mxbai-embed-large-v1). These managed embedding + reranker APIs are a common RAG building block.

Anthropic (Claude) model capture spans the native SDKs beyond Python/JS/Go — the Ruby anthropic gem (client.messages.create(model: "claude-…")), the Kotlin anthropic-java builder (.model("claude-…")), and the .NET Anthropic.SDK (new MessageParameters { Model = "claude-…" }). The Anthropic SDKs' own model constants (Model.CLAUDE_*) are not captured.

Local / open models are captured too (Python, JavaScript/TypeScript): the model a codebase runs through a self-hosted runtime — Hugging Face Transformers (AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B"), any model class or diffusers pipeline's from_pretrained, pipeline("task", model="…")), Sentence Transformers (SentenceTransformer("all-MiniLM-L6-v2"), CrossEncoder("cross-encoder/ms-marco-MiniLM-L-6-v2")), Hugging Face Hub downloads (hf_hub_download(repo_id="…"), snapshot_download("…"); a dataset or Space download is not a model), vLLM LLM(model="…"), and Ollama ollama.chat(model="llama3.1"). An open model has no single managed provider, so it is listed as a model with no provider link (unless its name matches a known provider); tokenizer/config loads are not mistaken for models.

Agents, tools and MCP servers in code

Agents, the tools they are handed and MCP servers are read from the agent frameworks and MCP SDKs in code (OpenAI Agents SDK, LangGraph, CrewAI, Pydantic AI, Google ADK, Claude Agent SDK, Microsoft Agent Framework, smolagents, Semantic Kernel, Spring AI, LangChain4j, Koog, Genkit, Eino, LangChainGo, Mastra, the Vercel AI SDK, and the official and community MCP SDKs). An agent is an application component with aibom:kind=agent, a tool one with aibom:kind=tool, and an MCP server a service with aibom:kind=mcp-server; the dependency graph links agent → tool, agent → model, and MCP server → tool.

Go agent frameworks

In Go, agents and tools are read from Eino, Genkit and LangChainGo, and MCP clients from mcp-go and the official Go SDK:

  • Eino: adk.NewChatModelAgent, the ReAct agent (react.NewAgent), the DeepAgents prebuilt (deep.New) and the sequential, loop and parallel workflow agents; tools from utils.InferTool, utils.NewTool, an agent handed over as a tool (adk.NewAgentTool), and the eino-ext tool library under the names the library gives them (duckduckgo_text_search, google_search, browser_use, …) unless the config sets ToolName. An eino-ext chat model is the service it calls (OpenAI, Anthropic, DeepSeek, Ollama) when its config is written inline and sets no BaseURL; a literal BaseURL is the endpoint it names. The Model of its config is the model; an Anthropic config routed through Bedrock (ByBedrock: true) lists its model as served by AWS Bedrock.
  • Genkit: genkit.DefineTool, agents from DefineAgent / DefinePromptAgent, and a DefinePrompt handed tools. An agent's tools and model are its ai.WithTools(…) and ai.WithModel(…) / ai.WithModelName(…) options. A Genkit model name is <plugin>/<model> (googleai/gemini-2.5-flash): the model is named without the plugin, which names the host.
  • LangChainGo: the agent's model is its first argument, read through the variable it is assigned in the same function (llm, err := openai.New(openai.WithModel("gpt-4o"))), and the library's DuckDuckGo, Wikipedia, Perplexity, Metaphor and scraper tools are named as the library names them.
  • MCP clients: an mcp-go client (client.NewStdioMCPClient, NewStreamableHttpClient, NewSSEMCPClient) has no name of its own and is named by the variable it is bound to; a Go SDK client by its mcp.Implementation name.

A tool returned from a constructor joins the agent whose tools list calls that constructor, in the same package, or in the package the call's qualifier imports.

Rust agent frameworks

In Rust, agents and tools are read from Rig, and MCP clients from the official SDK (rmcp):

  • Rig agents are builder chains bound to a variable (let or let mut) and built (let agent = client.agent(openai::GPT_4O).tool(Add).build();, or AgentBuilder::new(model)). An agent is named by its .name("…"), else by its variable; each .tool(X) is one tool. Rig's CLI chat loop (ChatBotBuilder) is not an agent.
  • Rig tools are types that implement Rig's Tool trait, named by their NAME constant, and Rig's own tools under the names Rig gives them: .tool(ThinkTool) is think, and a vector store index (.tool(store.index(model)), or a variable holding one) is search_vector_store. An agent handed over as .dynamic_tool(agent.into_tool()?) is a tool named as that agent, or agent_tool when the agent has no .name(…).
  • Models are read from Rig's own provider constants (openai::GPT_4O, anthropic::completion::CLAUDE_SONNET_4_6, or a constant imported from one provider) under the id Rig declares, and from a const MODEL: &str = "…" in the same file. This covers a model handed to .agent(…), .completion(…), .completion_model(…), .embedding_model(…), .embedding(…) or .extractor(…), and an agent built on a completion model held in a variable.
  • rmcp clients (().serve(transport), a client served over TokioChildProcess, StreamableHttpClientTransport or the legacy SseClientTransport) are named by the variable they are bound to, with the transport they use (stdio, streamable-http or sse).

Ruby and PHP agent frameworks

In Ruby, agents, tools and models are read from RubyLLM and LangChain.rb:

  • RubyLLM: a RubyLLM::Agent subclass is an agent named by its class, with its class-level model "…" and tools A, B. A RubyLLM::Tool subclass is a tool, named the way RubyLLM names it: the class name underscored, without a trailing _tool, and with the modules it is declared in (WeatherLookup is weather_lookup). The model of RubyLLM.chat(model: "…"), embed, paint and transcribe is inventoried, on the host its provider: names when one is given, also when the provider is a constant (PROVIDER = :openrouter). On provider: :openrouter the model id is an OpenRouter route ("openai/gpt-5-nano"): the model is named without it and depends on both OpenRouter and the provider the route names; a route naming no provider (meta-llama/…) depends on OpenRouter alone. RubyLLM itself is listed when the code names its constant (RubyLLM.chat(…), RubyLLM::Tool), so a Rails app, where Bundler loads the gem and no file requires it, lists it too.
  • LangChain.rb: Langchain::Assistant.new(llm:, tools: […]) is an agent named by its variable. Its tools are library tools (Langchain::Tool::…) or classes that extend Langchain::ToolDefinition, named as LangChain.rb names them (langchain_tool_news_retriever). Its model is the default_options: { chat_model: "…" } of its LLM client.

In PHP:

  • Neuron AI: a class that extends Agent is an agent named by its class. Its model is the provider its body constructs, and its tools are the tool classes or Tool::make('…') its body builds. An Agent::make() chain bound to a variable is an agent, with the model of its ->setAiProvider(…) and the tools of its ->addTool(…). A variable passed to either (->setAiProvider($provider)) is read through its last assignment before the agent in the same function or method, else at file level; an assignment in another function is not it. A chain that runs the agent (->chat(…)) binds the run's result, so it names no agent. Calls made on the agent's variable in the statements that follow ($agent->addTool(new FileDeleteTool());) count too, up to the end of the block it is created in or the variable's next assignment. A class that extends Tool is named by its $name property. A Neuron AI toolkit handed to an agent (->addTool(CalculatorToolkit::make())) is the tools it provides, by the names Neuron AI gives them: CalculatorToolkit is evaluate, factorial, combinations, permutations, gcd, lcm, mod_pow, is_prime, prime_factors, mean, median, mode, variance and standard_deviation, and TodoPlanningToolkit is write_todos. A toolkit narrowed with ->only(…) or ->exclude(…) is not expanded. The library is listed as neuron-core/neuron-ai, its package's current name; a composer.lock that still names the old package (inspector-apm/neuron-ai) gives it its version.
  • LLPhant: new FunctionInfo('name', …) and FunctionBuilder::buildFunctionInfo($obj, 'method') are tools, and new AutoPHP($objective, [$tools]) is an agent. A $config->model = '…' on an OpenAIConfig, AnthropicConfig, OllamaConfig, MistralAIConfig or GeminiOpenAIConfig is the model, on that provider.
  • Anthropic SDK: use Anthropic\… is the Anthropic SDK (anthropic-ai/sdk, mozex/anthropic-php). The model of $client->messages->create(model: '…') is inventoried.
  • php-mcp: in a file that imports php-mcp (use PhpMcp\Server\…), Server::make()->withServerInfo('Name', …) is an MCP server. Its tools are those registered with ->withTool($handler, 'name'), and the methods with #[McpTool(name: '…')]. The same builder calls in a file that does not import php-mcp are another library's and are not listed.

Tool capability

A tool whose body can reach a dangerous operation records it as aibom:capability, one property per kind:

aibom:capabilityThe tool's body reaches
shellan OS command (subprocess.run, child_process.exec, exec.Command, Runtime.exec, Process.Start)
filethe file system (open, fs.readFile, os.ReadFile, File.ReadAllText)
networkan outbound request (requests.get, fetch, http.Get, HttpClient), or a hosted model API
sqla database query (sqlalchemy.text, new SqlCommand, or a query method called with SQL text)
code-execcode it evaluates (eval, exec, new Function, a script engine, or a module imported by a name held in a variable; importlib.import_module("json") is not)

The operations are the same calls xgrep's security rules treat as command injection, path traversal, SSRF, SQL injection and code injection sinks, so a call those rules recognize is a capability too. Only a call that names what it does counts: os.system(…) or fs.writeFile(…), not a method on an object of unknown type such as x.get(key); a query method on an untyped receiver (conn.execute(…)) counts when its first argument is SQL text.

A hosted model counts as network wherever xgrep finds it in the tool's body, not only at the call that sends the request: a model of a hosted provider named there (say "gpt-4o" in a settings dict the tool builds) marks the tool network, because a tool that names a hosted model is expected to call it. A model loaded and run in the process (a local runtime) is not network.

A capability is claimed only for what the body reaches: a call in the tool's own body, or in a function of the same file it calls (by name, or as self.x(), this.x() or ClassName.x()), followed a few calls deep. A function the tool never calls does not count, and neither does a method called on another value that happens to share a name with one of the file's functions. Code in another file is not followed. A library's built-in tool, whose body is not in the project, takes the capability its library documents: the Claude Agent SDK's Bash is shell and Read/Write/Glob are file, Google ADK's google_search and the OpenAI Agents SDK's hosted web_search are network, Koog's file and shell tools are file and shell.

MCP configuration, instruction and prompt files

Not everything that wires up an AI system is code. xgrep also reads:

  • MCP server configuration — mcp.json, .mcp.json, .vscode/mcp.json (comments and trailing commas allowed), .cursor/mcp.json, claude_desktop_config.json, Cline's settings, Gemini CLI extensions, an MCP Registry server.json and an MCP Bundle (DXT/MCPB) manifest.json. Each declared server is an mcp-server service with its transport (aibom:mcp:transport: stdio, sse or http), command line (aibom:mcp:command) or URL (aibom:mcp:url), and the names of the environment variables it is given (aibom:mcp:env). Values are never recorded: a URL loses its credentials and query string, and an argument that carries a secret is shown as <redacted>.
  • Instruction, skill and prompt files — AGENTS.md, CLAUDE.md, GEMINI.md, SKILL.md, .cursorrules, .clinerules, .windsurfrules, Cursor rules (.cursor/rules/*.mdc), Copilot instructions (copilot-instructions.md, *.instructions.md), VS Code prompt files and chat modes, Claude Code subagents and commands, Copilot custom agents, *.prompty, *.prompt, GitHub Models *.prompt.yml, and text files in a prompts/ directory. Each is a prompt component with its location and a SHA-256 hash; its content is never copied into the BOM.
  • A2A agent cards — an Agent2Agent card at /.well-known/agent-card.json (or the older /.well-known/agent.json) is the agent it describes, with aibom:agent:protocol=a2a, its URL (aibom:a2a:url, without credentials or query string), the protocol version and one aibom:a2a:skill per skill it advertises. A card built in C# code (new AgentCard() { Name = … }) is read the same way.
  • Agents declared in files — a Claude Code subagent, a Copilot custom agent or a VS Code chat mode is an agent, linked to the model its frontmatter names (model: sonnet) and the tools it lists. A model is listed only when the file states one; a Prompty file names its provider service.
  • LangGraph deployments — each graph a langgraph.json registers under graphs ("agent": "./src/agent/graph.py:graph", or {"path": …}) is an agent named by its key, the name clients invoke it by, with the key's line as evidence. An agent the code declares under the same name is the same asset.

Infrastructure as code

A cloud deployment often states what the application code cannot. An Azure OpenAI client names a deployment, and only the Terraform that creates it says which model and version that deployment serves. xgrep reads the scan's Terraform modules and Kubernetes manifests for the AI resources they declare. Every model found this way has aibom:resolved-via=deployment, and its evidence is the line that spells the value (for a variable default, the default).

ResourceRecorded
azurerm_cognitive_account with kind = "OpenAI"the Azure OpenAI service
azurerm_cognitive_deploymentthe model name and version (as the component's version; two deployments of one model at different versions are two components), on Azure OpenAI for format OpenAI, on Azure AI model inference for another format; the deployment's own name is not a model
aws_bedrockagent_agentan agent with an edge to its foundation_model, on AWS Bedrock; a file handed to instruction with file() is a prompt
aws_bedrockagent_agent_action_groupa tool named by action_group_name, attached to its agent
aws_bedrockagent_knowledge_base, aws_bedrock_custom_model, aws_bedrock_provisioned_model_throughput, aws_bedrock_inference_profilethe embedding, base, custom or provisioned model; other aws_bedrock* resources record the service
google_vertex_ai_endpoint_with_model_garden_deploymentthe publisher model or Hugging Face model it deploys; other google_vertex_ai_* resources record the Vertex AI service
KServe InferenceService and LLMInferenceServicethe self-hosted KServe service, and the model its storageUri (or model.uri, or the Hugging Face runtime's --model_id) names, with aibom:model-format
Seldon Core SeldonDeployment and Modelthe self-hosted Seldon Core service, and the model its modelUri/storageUri names
KServe storage initializer containerthe hf:// model it downloads, with no service
Helm chart values.yamla model key (model, modelId, modelName) holding a catalog model id or a Hugging Face org/name, and a storageUri/modelUri

Terraform is read, never planned. A value counts only when Terraform would apply it with nothing overridden: a literal, a variable's literal default, a value in an auto-loaded terraform.tfvars or *.auto.tfvars, a local built from those, an each.value of a for_each over such a list, an aws_bedrock_foundation_model data source's id, or an input a module passes to a local child module (source = "./modules/openai"). A variable with no default, a computed attribute and a registry module's internals name nothing. A resource whose count is 0 by default is not deployed and records nothing. A data source is a lookup, not a deployment. A commented-out block is not read.

A storage URI names a model by its Hugging Face id for hf://org/name, and by the URI as written otherwise (s3://…, gs://…, oci://…), since that is the only identity the manifest gives. A URI holding a placeholder (pvc://${PVC_NAME}) names nothing. The name a server publishes a model under (--model_name) and the resource's own name are deployment names, not models.

Hosting region

A service records aibom:region for each region a site that configures it proves. Azure display names are normalised (West Europe is westeurope).

SourceRegion
azurerm_cognitive_account (Azure OpenAI)its location
azurerm_cognitive_deploymentthe location of the account its cognitive_account_id names
aws_bedrock* and aws_bedrockagent* resourcesthe resource's own region; else the region in a foundation-model or inference-profile ARN it names (arn:aws:bedrock:us-east-1:…); else, when the resource sets no region, the region of the aws provider configuration it uses (provider = aws.<alias>, or the default one)
google_vertex_ai_* resourcesthe resource's region or location; else, when it sets neither, the region of the google provider configuration it uses
Python boto3 Bedrock clienta string literal region_name="…" on the client(...) call (also inside config=Config(...))
Python Vertex AI client: vertexai.init(...), aiplatform.init(...), genai.Client(vertexai=True, ...)a string literal location="…" on the call

A value counts by the same rules as any other Terraform value: a variable with no default proves nothing, and a region or location the resource sets to an unknown value is not replaced by the provider's.

A module that configures no provider of its own uses its caller's: the configuration the module block passes in its providers map (providers = { aws = aws.eu }, aws.primary = aws.us), or, when the block has no providers map, the caller's default configuration. This is followed through every level of local modules. A module called twice records the region of each call; when one call's provider states no literal region, the service also records aibom:unproven: aibom:region. A providers map that does not pass the provider, an aliased configuration nobody passes, or a root module with no provider configuration proves nothing. A region in an environment variable or a shared AWS profile is not read.

A service is reached from many sites. When one site that configures it (a client construction or an IaC resource) states no region while others do, the service also records aibom:unproven: aibom:region: the regions it lists are not all of them. A model call is no such site: it uses a client, it does not configure one.

Not read: Bicep and ARM templates, CloudFormation and CDK, modules fetched from a registry, Helm templates, and which inference server a container image runs. A deployment created by an az cognitiveservices account deployment create command in a script is not infrastructure as code and is not read here.

Model files

Model weights committed to the repository are inventoried as CycloneDX file components (aibom:kind=file), named by their file name, with a SHA-256 hash and the file as evidence. The format is read from the file's own header, never by loading a tensor or unpickling anything, so a Git LFS pointer named model.pt or a SentencePiece tokenizer.model is not mistaken for a model.

aibom:formatFilesAlso recorded
ggufany file with the GGUF magicaibom:architecture (general.architecture), aibom:quantization (from general.file_type, e.g. Q4_0, Q8_0, Q4_K_M; when the header states none, the tensor type all tensors share)
safetensors.safetensorsaibom:tensors, aibom:dtype, aibom:safetensors:metadata:<key>
onnx.onnxaibom:onnx:ir-version, aibom:onnx:producer, aibom:onnx:opset
pickle.pkl, .pickle, .joblib (including gzip, zlib and bzip2 joblib files)aibom:pickle:import for every callable the pickle imports
pytorch.pt, .pth, .bin, .ckpt: a PyTorch zip checkpoint or a legacy torch.save pickleaibom:pickle:import
coreml.mlmodel, including the model.mlmodel inside an .mlpackage (aibom:serialization safe)aibom:coreml:spec-version, aibom:coreml:model-type (mlProgram, neuralNetwork, pipeline, …)

aibom:serialization is unsafe for every pickle-based format (pickle and PyTorch): loading such a file can execute code, whatever this one happens to hold. It is safe for GGUF, safetensors and ONNX. The aibom:pickle:import list is the result of a static opcode scan (GLOBAL, INST, STACK_GLOBAL), so an import such as os.system or builtins.eval in a model file is visible without loading it. A pickle that imports nothing at all holds only plain Python data (dicts, lists, strings), which no model can be, so it is not listed.

The name and architecture a GGUF header states are properties of the file, not a model identity: converters write a default there (llama).

Hashing is bounded: a file over 4 GiB, or one that would take a scan past 16 GiB of hashed model files, is still inventoried with everything its header states, but without a hash, and aibom:hash:skipped says why.

Containers

Dockerfiles (Dockerfile, Containerfile, Dockerfile.*, *.Dockerfile) and compose files (docker-compose*.yml, compose*.yaml) are read for the inference servers a project runs. An image that runs one, in a FROM or a compose image:, is a self-hosted service named by the product, the same one a client of that server in code reaches: aibom:self-hosted=true, trust zone self-hosted, and every image line as evidence.

ServerImagesModel read from
Ollamaollama/ollamaollama pull <model> or ollama run <model> in a RUN, CMD, ENTRYPOINT, compose command or entrypoint, also inside a quoted sh -c "…"
vLLMvllm/vllm-openai--model, or the model after vllm serve
SGLanglmsysorg/sglang--model-path, --model
Text Generation Inferenceghcr.io/huggingface/text-generation-inference--model-id, MODEL_ID
Text Embeddings Inferenceghcr.io/huggingface/text-embeddings-inference--model-id, MODEL_ID
llama.cpp serverghcr.io/ggml-org/llama.cpp with a server tag-hf, --hf-repo
Triton Inference Servernvcr.io/nvidia/tritonserver(a model repository directory, not a model id)
LocalAIlocalai/localai, quay.io/go-skynet/local-ainone

A model the server is told to pull or serve is a machine-learning-model that depends on that service, with aibom:resolved-via=deployment. A Hugging Face id (org/name) carries its pkg:huggingface purl. The flags and MODEL_ID count only in the arguments and environment of the service or build stage that runs the server's image. A stage built FROM an earlier stage runs that stage's server.

Values are read only as the file states them:

  • a variable with a default (${MODEL_NAME:-Qwen/Qwen2.5-1.5B-Instruct}, a Dockerfile ARG default) is that default, recorded as aibom:resolved-via=env-default. An image stated that way counts the same;
  • a bare variable (--model-id ${LLM_MODEL_ID}, image: ${IMAGE}) names nothing;
  • a filesystem path (-m /models/llama.gguf) names a file, not a model.

The image repository is matched whole, after the registry host, the tag and the digest are removed. So myorg/ollama-proxy, a database or vector-store image, or a wrapper image of another product yields nothing. YAML anchors and merge keys (<<: *service-ollama) are followed. Comments are not read, so a commented-out service or FROM declares nothing.

.NET (C#)

The C# pack follows the .NET AI stack from the code to its configuration:

  • Models in configuration. A .NET host loads appsettings.json and appsettings.<Environment>.json (comments allowed), so xgrep reads them: a value whose key names a model (ModelId, ChatModelId, ModelName) and that is a known model is listed with aibom:resolved-via=config. The provider is the nearest section that names one (OpenAI, AzureOpenAI, AzureOpenAIEmbeddings, Ollama); a section whose endpoint is a local server names no hosted provider. An Azure OpenAI deployment name (DeploymentName, ChatDeploymentName) is chosen by its owner and is never read as a model, however much it looks like one.
  • Models through connectors. The model handed to a Semantic Kernel or Microsoft.Extensions.AI connector (AddOpenAIChatClient, AddOllamaChatCompletion, AddGoogleAIGeminiChatCompletion, AddMistralChatCompletion, AddBedrockChatCompletionService, OllamaSharp's new OllamaApiClient(uri, "llama3.1"), an Azure connector's modelId:) is resolved like any other model reference: a literal, a constant, or the fallback of a configuration lookup. The connector names the provider.
  • .NET Aspire. An Aspire app host declares the AI resources an application runs on. A Foundry or Azure OpenAI deployment (foundry.AddDeployment("chat", "gpt-4.1-mini", "2025-04-14", "OpenAI")) lists the model it deploys, with aibom:resolved-via=deployment; an Ollama resource lists the models it pulls (ollama.AddModel("chat", "llama3.1")) and is itself a self-hosted Ollama service. A Foundry resource is the Azure AI Foundry service; a model deployed on it in the "OpenAI" format depends on both Azure AI Foundry and Azure OpenAI, whose endpoint serves it. A service project's client integrations (AddOllamaApiClient, AddAzureOpenAIClient, AddOpenAIClient) name the service it calls. The Azure OpenAI and Ollama integrations, and AddOpenAIClientFromConfiguration, also list their client library (Aspire.Azure.AI.OpenAI, CommunityToolkit.Aspire.OllamaSharp) without a using, since these methods are imported implicitly.
  • Agents and tools. Microsoft Agent Framework agents (chatClient.AsAIAgent(name: "Joker", tools: [...]), new ChatClientAgent(...)) and Semantic Kernel agents are agents; functions built with AIFunctionFactory.Create and Semantic Kernel plugin functions ([KernelFunction] methods, or KernelFunctionFactory.CreateFromMethod inside a plugin or tools list) are tools, named by their name argument or the method they wrap. A kernel function that is only invoked directly is not a tool. A tool built from a method runs that method, so its capability is what the method reaches.

JVM (Java, Kotlin, Scala)

  • Spring AI MCP servers and clients in configuration. With Spring AI's MCP Boot starters, an MCP server or client is declared in application.yml|properties: spring.ai.mcp.server.name makes the application an MCP server (with its transport when stdio or protocol states it), and each spring.ai.mcp.client.<transport>.connections.<name> is an MCP client connection named <name>, with its command or URL and the names of the environment variables it is given (never their values).
  • Spring AI provider services. A Spring AI model starter configured with an API key (spring.ai.openai.api-key, spring.ai.anthropic.api-key) is the provider service it calls; the key's value is never read. A section pointed at another base-url names no provider service.
  • MCP tools. A Spring AI @McpTool method is a tool named by its name, else by the method. It, and a Spring AI @Tool method, are linked to the MCP server declared by the configuration of the same Maven or Gradle module.
  • Scala models. The model named by the Scala OpenAI clients is captured: CreateChatCompletionSettings(model = ModelId.gpt_4o) (openai-scala-client) and ChatBody(model = ChatCompletionModel.GPT4o) (sttp-openai) resolve their library constants to model ids, and a literal or a same-file val resolves as in other languages. Java SDK builders used from Scala (.modelName("gpt-4o")) are read as in Java.
  • Kotlin models resolve through a same-file const val or val, a LangChain4j model-name enum, or openai-kotlin's ModelId(…). A string template ("gpt-$variant") is not a model.
  • Koog. An AIAgent<Input, Output>(…) is an agent, and a @Tool function of a ToolSet is a tool named by its customName, else by the function.

Imported and declared libraries

Each AI library carries aibom:usage:

  • imported: first-party code imports the package. Every library found in code is marked this way.
  • declared: a manifest declares the package, but no code imports it.

Declared packages are part of every AI BOM; xgrep sbom --include aibom . lists them with no further option.

They are read from the manifests that state a project's direct dependencies: requirements*.txt, pyproject.toml, package.json, *.csproj and Cargo.toml are read themselves, and every other ecosystem the dependency scan understands (go.mod, pom.xml, build.gradle(.kts), packages.config, Gemfile.lock, composer.lock, mix.lock, pubspec.lock) contributes its direct packages. Each one points at its manifest line, with the version the manifest states or the lockfile resolves, and carries the scope the manifest gives it in aibom:dependency-scope (runtime, development, test, optional). Development and test declarations, such as npm's devDependencies or a requirements-dev.txt, are listed and marked, never read as production. A declared provider SDK implies no provider service: a declaration proves the package may be installed, not that the code calls the API. A package that the code also imports is listed once, as imported.

Scope: production, dev tooling, test, example, …

Every AI asset carries an aibom:scope property that says where in the repository it sits: production, dev-tooling, example, benchmark, docs, test, generated or vendored. Apart from dev-tooling, the classes are the same ones the CBOM uses (see Cryptography Bill of Materials): each ecosystem's path conventions (_test.go, test_*.py, *.spec.ts, src/test/java, testdata/, examples/, vendor/, …), plus a language's own test markers for code whose path looks like production: a Rust item under #[cfg(test)], a Go file built only for an integration or e2e tag, a Python module that is a unittest or pytest suite. A Go <x>test helper package that only tests use is a test as well.

dev-tooling is AI your developers' own tools use, not AI your project ships. A file is dev tooling by its kind, read from its name or the directory the tool loads it from, never guessed from its content:

  • a coding agent's instruction or rules file: AGENTS.md, CLAUDE.md, GEMINI.md, .cursorrules, .clinerules, .windsurfrules, a Copilot instructions file (copilot-instructions.md, *.instructions.md), a VS Code chat mode, an aider configuration;
  • anything in an editor's or coding agent's configuration directory, at any depth: .vscode/, .cursor/, .claude/, .windsurf/, .gemini/, .clinerules/, .roo/, .continue/, .zed/, .idea/, .kiro/, .amazonq/, .codex/, .junie/. That covers workspace MCP configurations (.vscode/mcp.json, .cursor/mcp.json), subagents and project skills;
  • an MCP client configuration named for a coding agent: Claude Code's .mcp.json, Claude Desktop's and Cline's configuration files;
  • anything under the repository's top-level CI directory (.github/, .gitlab/, .circleci/, .buildkite/): workflows, local actions and the scripts they run.

A generic name stays production: an mcp.json outside an editor directory may be the application's own MCP client configuration, a SKILL.md or *.prompt.md outside one may be loaded by the application, and a composite action's action.yml at the root is the product itself. A dev-tooling file under tests/, examples/ or vendor/ keeps that class: a CLAUDE.md under tests/fixtures/ is a test fixture.

Claude's and Codex's project files can also be loaded by an application: the Claude Agent SDK reads .claude/, CLAUDE.md and .mcp.json from its working directory, and the Codex SDK runs an agent that reads AGENTS.md. When your Python or JavaScript/TypeScript code imports one of these SDKs, that family's files stay production, wherever they are: xgrep cannot tell which of them the application loads, and it never hides AI your application may use.

An asset used in more than one place takes the strongest class, in the order listed above: an SDK used in production code and in a test is a production asset, and so is one your application imports and a CI script also calls. Dev tooling never hides a production use. A service takes the strongest class among the calls that reach it. An agent's instruction, skill or subagent file is configuration, not documentation: only its directories decide its class, so docs/AGENTS.md is docs.

Test and dev-tooling assets are marked, not dropped: an evaluation harness that calls a model, or an MCP server every developer's editor launches, is real information. To keep only production assets, pass --aibom-scope production; to list only what developer tools and CI use, pass --aibom-scope dev-tooling:

xgrep sbom --include aibom --aibom-scope production .
xgrep sbom --include aibom --aibom-scope dev-tooling .

--aibom-scope keeps the occurrences found in that class, and each asset keeps the class of its strongest use anywhere in the repository: an SDK your application imports appears in the dev-tooling view with its CI use as evidence, still marked production.

Checking against a policy

xgrep aibom check builds the same inventory and judges it against an AI policy. Each finding names the rule that gave it and the clause it cites:

xgrep aibom check .
xgrep aibom check --policy aibom-strict .
xgrep aibom check --bom aibom.json --format markdown >> "$GITHUB_STEP_SUMMARY"

A verdict is disallowed, deprecated, review or unknown. review is a risk the inventory shows but cannot prove exploitable in your code, such as a model loaded without a pinned revision. unknown is an asset a rule could not judge because the inventory does not prove what the rule reads, such as a service with no proven hosting region: it is never counted as compliant.

The check exits 1 when a finding reaches the --fail-on verdict: disallowed by default, or deprecated, review, unknown or never.

--format json prints the same check for a script or a dashboard: every finding with all of its locations, and for each rule how many assets of its kinds it passed, gave each verdict, and could not judge. An asset a rule could not judge (not_judged, such as a model with no deprecation record under deprecated-model) is neither a pass nor a finding, and an unknown verdict is counted under unknown, never as passed:

xgrep aibom check --policy aibom-open-weights --format json --fail-on never .
RuleFires onaibom-baseline (default)aibom-strict
unsafe-model-serializationa pickle-based model file (.pkl, .pt, .bin, …)disalloweddisallowed
deprecated-modela model its provider has deprecateddeprecateddeprecated
unpinned-hub-modela Hugging Face model loaded without a commit revision=reviewdisallowed
unpinned-mcp-packagean MCP server launched with npx, uvx, pipx run, docker run, … from a package or image without a version (or @latest)reviewdisallowed
unpinned-ci-actionan AI action a CI workflow uses at a tag or a branch instead of a full commit SHAreviewdisallowed
code-execution-toolan agent tool whose body runs shell commands or codereviewdisallowed

aibom-open-weights is the baseline plus the open-weights-only rule below.

A finding on dev tooling, test, example or other non-production code is labelled with its scope; dev tooling is judged like any other asset, since an unpinned MCP server in .vscode/mcp.json runs on every developer's machine. --aibom-scope production judges only production assets, and --aibom-scope dev-tooling only dev tooling. An asset's scope is the strongest of the places it is used: an SDK imported from both app/ and tests/ is production, so --aibom-scope test leaves it out. The check gives the same answer whether it scans the code or reads a BOM with --bom.

Your own policy

An organisation's own standard is a YAML file passed with --policy-file. Each rule reads a property of the asset, and fires in one of these ways:

  • match: a value matches a regular expression;
  • deny: a value matches one of a list;
  • allow: a value the asset states matches none of the list. Every value must be approved: an unapproved provider beside an approved one fires.

Regular expressions ignore case.

A rule must cite a clause. A rule with the same id as one in the policy it extends replaces that rule:

id: acme-ai
title: ACME AI usage standard 1.2
extends: aibom-baseline
rules:
  - id: approved-providers
    kinds: [service, model] # aibom:kind values; omit for every asset
    property: provider # name, purl, provider, or any aibom:* property
    allow: ['^OpenAI$', '^Anthropic$', '^AWS Bedrock$']
    verdict: disallowed
    clause: 'ACME-AI 2.1: approved providers only'
  - id: approved-mcp-servers
    kinds: [mcp-server]
    property: name
    allow: ['^github$', '^linear$']
    verdict: disallowed
    clause: 'ACME-AI 4.3: MCP servers need security review'
  - id: unpinned-hub-model # replaces the baseline rule
    kinds: [model]
    check: unpinned-hub-revision
    verdict: disallowed
    clause: 'ACME-AI 3.2: pin every model'

An asset that does not state the property is not judged by the rule: a model with no stated provider never fails an allow-list of providers. Unknown keys are refused, so a misspelt key cannot silently weaken the policy.

A rule that must not pass what the inventory cannot prove names a second verdict with unproven, normally unknown. An asset of the rule's kinds then gets that verdict when it does not prove the property: it states no value, or it records aibom:unproven for that property. A value that fires the rule still gets the rule's own verdict.

Hosting region

Allow or deny regions with a rule over aibom:region:

- id: eu-hosting
  kinds: [service]
  property: aibom:region
  allow: ['^eu-', '^europe-', '^(westeurope|northeurope|swedencentral)$']
  verdict: disallowed
  unproven: unknown
  clause: 'ACME-AI 4.2: AI services run in the EU'
ServiceVerdict
every region it records is allowed, and every site that configures it states onepasses
a region it records is not allowed (or is denied)disallowed, even if other sites state none
no region proven, or aibom:unproven: aibom:regionunknown

A provider that is not regional in your code (the OpenAI API) has no proven region, so a region rule over every service reports it as unknown; limit kinds or the providers you judge if that is not what you want.

Open weights only

--policy aibom-open-weights, or check: open-weights in your own rule, judges each model:

ModelVerdict
aibom:open-weights=true, or loaded from a Hugging Face Hub repositorypasses
a catalog line whose creator serves it through its API only (gpt-4o, claude-…, gemini-…, an anthropic.claude-… Bedrock id)disallowed
a model the catalog does not know, or a line whose models are only partly published (mistral-large, command-r, grok, whisper)unknown

A model file in the repository is its weights and is not judged.

- id: open-weights-only
  kinds: [model]
  check: open-weights
  verdict: disallowed
  unproven: unknown
  clause: 'ACME-AI 3.4: self-hostable models only'

While generating the BOM

xgrep sbom --include aibom --aibom-policy <policy> evaluates a policy while it generates the inventory. <policy> is a built-in policy id or a policy YAML file. Every finding is recorded on its asset as aibom:policy:<rule> (the verdict) and aibom:policy:<rule>:clause, the summary aibom check prints goes to stderr, and the run exits 1 when a finding reaches --aibom-fail-on (disallowed by default), as aibom check does. The document is written either way.

xgrep sbom --include aibom --aibom-policy ai-standard.yaml -o aibom.json .

Compliance views

xgrep aibom compliance lists, for each clause of a framework, the AI assets the clause asks about and the policy findings that bear on it:

xgrep aibom compliance .                                   # every framework
xgrep aibom compliance --framework eu-ai-act-annex-iv --format markdown .
Framework--frameworkClauses
OWASP Top 10 for LLM Applications 2025owasp-llm-2025LLM02 Sensitive Information Disclosure, LLM03 Supply Chain, LLM06 Excessive Agency, LLM07 System Prompt Leakage
EU AI Act, Annex IV technical documentationeu-ai-act-annex-iv1(b), 1(c), 2(a)
NIST AI Risk Management Framework 1.0nist-ai-rmfGOVERN 6.1, MAP 4.1, MANAGE 3.1
ISO/IEC 42001:2023, Annex Aiso-42001A.4.3, A.4.4, A.10.3

A view is evidence for an assessment, not a verdict. The inventory shows what the code uses, never the process around it, so whether a clause is met is for your assessor. The findings are those of the AI policy (--policy, --policy-file), as aibom check reports them. A finding of a rule no clause of the framework names, such as a rule of your own policy file, is listed under "Other policy findings" rather than dropped.

CycloneDX 1.7 output

The AIBOM is CycloneDX 1.6 by default. --spec-version 1.7 emits CycloneDX 1.7 instead, alone or merged with the other content:

xgrep sbom --include aibom --spec-version 1.7 -o aibom.cdx.json .
xgrep sbom --include sca,aibom --spec-version 1.7 .

The inventory is the same at both versions, with one addition at 1.7: a model the code proves runs in a service carries "isExternal": true. The model runs there, not in your application, so it is provided by the environment rather than shipped with the project. The proof is in the call: it is a provider-specific API (LangChain's ChatOpenAI(model=…), Cohere's client), or it names its host (a base URL, a Bedrock or Vertex model id, ChatOllama, a gateway route), including a self-hosted inference server such as Ollama.

A call shape several SDKs share (client.messages.create(model=…), client.embed(model=…)) proves the service through its client: in Python, the receiver is traced within its file to the constructor that built it (client = Anthropic(), a self.client set in __init__, a factory function that returns one). The model is marked when that client is the model's own provider's API, or a cloud platform that serves it (Claude through AnthropicBedrock, an OpenAI model through AzureOpenAI). An OpenAI Agents SDK agent's model named by string (Agent(model="gpt-4.1")) runs on the SDK's default OpenAI client, and is marked unless the project installs another client or model provider (set_default_openai_client, model_provider=).

A model is not marked when nothing in the code says where it runs:

  • a model file on disk, or a model loaded from the Hugging Face Hub (its weights are downloaded into the environment);
  • a model loaded in-process, such as vLLM's LLM(model=…), even though the inventory links it to its creator's API by name;
  • a model whose only call is a method shape several SDKs share (client.messages.create(model=…), client.embed(model=…)) on a receiver that is not traced to a client: one built in another file, passed in as a parameter, or built from different constructors on different paths;
  • a model called on a client pointed at another endpoint (OpenAI(base_url="http://localhost:11434/v1"), openai.base_url = …), as for a local Ollama or vLLM server;
  • a model the resolved client's provider does not serve (OpenAI().chat.completions.create(model="mistral-small-latest")): the client is pointed elsewhere by configuration the code does not show, such as OPENAI_BASE_URL.

Nothing else that CycloneDX 1.7 adds has a value a scan of source code knows: its model card is the same as 1.6's, a model id names one model rather than a range of versions (versionRange), and citations, patents and distribution constraints are not stated in code.

SPDX 3.0.1 output

--format spdx3-json writes the AI inventory as an SPDX 3.0.1 document. A model is an ai_AIPackage from the AI profile:

xgrep sbom --include aibom --format spdx3-json -o aibom.spdx3.json .
xgrep sbom --include sca,aibom --format spdx3-json .       # with the dependencies
InventorySPDX 3.0.1
modelai_AIPackage, originatedBy its creator and suppliedBy its provider
AI library, frameworksoftware_Package
agent, toolsoftware_Package, purpose application
prompt, instruction or agent filesoftware_File, purpose configuration, with its SHA-256
model filesoftware_File, purpose model, with its hash
service (a provider API, an MCP server)software_Package, purpose other, its endpoint the home page
dependenciesdependsOn relationships

SPDX has no service class, so a service is a package whose comment says it is a service. Every aibom:* property, such as scope, provider or MCP transport, and each source location are carried in an extension_CdxPropertiesExtension, so the SPDX document states everything the CycloneDX one does. The document claims conformance with the core, software and extension profiles. It does not claim the AI or Dataset profiles: they require a concluded and a declared license, a release time and a download location for every model, which a scan of source code does not know. Crypto assets have no SPDX representation, so --include cbom cannot be combined with spdx3-json.

Language coverage

AI-library detection ships for 20 languages:

Python · JavaScript/TypeScript · Java · Kotlin · Scala · Go · C# · Rust · Ruby · PHP · Dart · Swift · Elixir · R · Julia · C/C++ · Bash · Groovy · Lua · PowerShell

Detection is import/usage-based and precise: a rule matches an AI SDK's import (or, for C/C++, its local-inference header #include) and rejects look-alikes whose name merely shares a prefix. Depth varies with each ecosystem — Python has the widest coverage; custom-endpoint detection ships for Python, JavaScript/TypeScript, Go, Kotlin, C#, Rust, Ruby, and PHP, and model-id capture ships for Python, JavaScript/TypeScript, Go, Java, Kotlin, C#, Rust, Ruby, and PHP; C/C++ covers local-inference runtime headers only (there are no managed-provider SDKs for it); and Bash, Groovy, Lua and PowerShell cover library inventory only. Coverage is inherently a moving target as the AI ecosystem grows, so read the absence of a library as "not yet detected," not "no AI present."

Swift and Dart

On iOS, macOS and Flutter, the AIBOM records the models an app requests and the on-device AI it runs, not only the SDKs it imports:

LibraryWhat is recorded
Firebase AI Logic (Swift FirebaseAILogic/FirebaseAI/FirebaseVertexAI, Dart firebase_ai/firebase_vertexai)the model of generativeModel, imagenModel and liveModel / liveGenerativeModel, also when it is a local constant, a static member of a project type (ExampleModels.flashLite), the default of optional ?? "…", or a ternary on the backend; the Firebase AI Logic service it is reached through, and the backend it is forwarded to (the Gemini Developer API for googleAI(), Vertex AI for agentPlatform()/vertexAI()); the functions declared to it (FunctionDeclaration, Dart's AutoFunctionDeclaration and template declarations) and Gemini's built-in tools (google_search and google_maps, which reach the network, and code_execution)
Google Generative AI (Swift, Dart; deprecated)the model of GenerativeModel(name:) / GenerativeModel(model:)
OpenAI clients (Swift MacPaw OpenAI and SwiftOpenAI; Dart openai_dart and dart_openai)the model of a chat, embeddings or completions request
Anthropic clients (Swift SwiftAnthropic, Dart anthropic_sdk_dart)the model of a message request
Ollama clients (Swift Ollama, Dart ollama_dart)the model, with the Ollama server as its service
LangChain.dartthe model of each provider's options class or embeddings class
MLX Swift LM (MLXLLM, MLXVLM, MLXLMCommon, MLXEmbedders)the Hugging Face model it loads (ModelConfiguration(id:), loadModel(id:), loadModelContainer(id:)), with a pkg:huggingface purl
Apple Foundation Modelsthe framework; each LanguageModelSession given tools: as an agent named by its variable, each type conforming to Tool as a tool named by its name, and the session → tool edges
MCP Swift SDK (import MCP)the server a Server(name:version:) declares and the Tool(name:) values it lists
dart_mcp, mcp_dartthe library
Core ML.mlmodel files (see Model files)

A model is recorded only when the code names it with a string literal (for Firebase AI Logic, also one reached through the constants above). A model held in any other variable, built by string interpolation, or named by an SDK enum case (.gpt4_o, ChatCompletionModels.gpt4o) is not guessed. The system model behind an Apple Foundation Models session has no id in code, so no model component is listed for it.

Elixir, R, Julia and C/C++

These packs record the models a project names, not only the libraries it loads:

LanguageLibraryWhat is recorded
ElixirBumblebee, Nx, EXLAthe library when a script installs it (Mix.install([{:bumblebee, …}, :nx])) or code calls it by its module (Nx.Serving.batched_run(…)), without an alias; the Hugging Face repository of Bumblebee.load_model({:hf, "org/name"}), and of load_tokenizer, load_featurizer and load_generation_config, which often name a different repository than the model, with a pkg:huggingface purl
ElixirLangChainthe model of a chat model (ChatOpenAI.new!(%{model: …}) and the other providers' modules), with the provider the module names
ElixirInstructor, InstructorLite, openai_ex, ex_openai, Anthropix, ollamathe model of a request; an ollama call names the Ollama server as its service
Rellmerthe library when it is loaded or called by its namespace (ellmer::chat_openai(…)); the model of chat_<provider>(model = …) in any argument position, with that provider as its service (a Llama model through chat_groq is served by Groq), and the provider and model of chat("provider/model")
Rragnarthe library, loaded or namespace-qualified; the embedding model of embed_openai(x, model = …) (OpenAI) and embed_ollama(x, model = …) (the Ollama server)
Rreticulatea Python library loaded with reticulate::import("sentence_transformers") (also transformers, openai), recorded as that library
JuliaPromptingTools.jlthe model of an ai* call's model keyword. A short alias whose target is fixed ("gpt4o") is recorded as the model it stands for; an alias whose target has changed between releases ("claudes") names no model. An alias the file adds itself (MODEL_ALIASES["fav"] = "gpt-4o-mini") is recorded as its target; one added with two different targets names no model. A model registered with register_model!(; name = "…") is recorded too, on Ollama when its schema is OllamaSchema()
JuliaOpenAI.jlthe model of create_chat and create_embeddings, in a file that loads OpenAI.jl (using OpenAI or import OpenAI); a create_chat of another package is not read
JuliaRAGTools.jl, FlashRank.jlthe libraries; the ranker of FlashRank's RankerModel(:mini) (:tiny, :mini, :mini12, :mini6, :mini4), recorded as the model FlashRank loads for that name, which is the same in every FlashRank release
C/C++llama.cpp, ONNX Runtime, LibTorchthe model file a runtime loads (llama_model_load_from_file, Ort::Session, declared with parentheses or braces, CreateSession, torch::jit::load), as a file component

A model file a C/C++ call names is matched against the model files in the repository by its trailing path: when exactly one committed file's path ends with it, the call is recorded as another sighting of that file, with the format and hash its header gives. Otherwise (the weights are not committed, the usual case) the file is listed by the path the code names, with aibom:path, and no format or hash is claimed for bytes the scan did not read. The runtime depends on the file either way.

As for every language, only a string literal names a model or a file: a variable, an interpolated string or a path built at run time (argv[1]) does not. An ellmer chat_azure_openai(model = …) names an Azure deployment, not a model, and is not recorded. A model held in a variable and passed on (SentenceTransformer(model_id)) is not recorded either.

Example output

{
  "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
  "bomFormat": "CycloneDX",
  "specVersion": "1.6",
  "components": [
    {
      "type": "library",
      "bom-ref": "ai/provider/openai",
      "name": "openai",
      "group": "OpenAI",
      "properties": [
        { "name": "aibom:kind", "value": "provider" },
        { "name": "aibom:provider", "value": "OpenAI" },
        { "name": "aibom:hosting", "value": "managed-api" },
      ],
      "evidence": { "occurrences": [{ "location": "app.py", "line": 1 }] },
    },
    {
      "type": "machine-learning-model",
      "bom-ref": "ai/model/gpt-4o-2024-08-06",
      "group": "OpenAI",
      "name": "gpt-4o-2024-08-06",
      "version": "2024-08-06",
      "properties": [
        { "name": "aibom:creator", "value": "OpenAI" },
        { "name": "aibom:family", "value": "gpt-4o" },
        { "name": "aibom:kind", "value": "model" },
        { "name": "aibom:modality", "value": "text" },
        { "name": "aibom:provider", "value": "OpenAI" },
      ],
    },
  ],
  "services": [
    {
      "bom-ref": "ai/service/openai",
      "provider": { "name": "OpenAI" },
      "group": "OpenAI",
      "name": "OpenAI",
      "endpoints": ["https://api.openai.com"],
      "x-trust-boundary": true,
      "trustZone": "third-party",
      "properties": [
        { "name": "aibom:evidence", "value": "app.py:1" },
        { "name": "aibom:hosting", "value": "managed-api" },
        { "name": "aibom:kind", "value": "service" },
        { "name": "aibom:provider", "value": "OpenAI" },
      ],
    },
  ],
  "dependencies": [
    {
      "ref": "ai/model/gpt-4o-2024-08-06",
      "dependsOn": ["ai/provider/openai", "ai/service/openai"],
    },
    { "ref": "ai/provider/openai", "provides": ["ai/service/openai"] },
  ],
}

See also

  • Generating an SBOM — the software-dependency bill of materials.
  • AI risk — the security rules that judge how the inventoried models are used.
  • SCA overview — how xgrep inventories and analyzes third-party code.

Last updated on

On this page