canonical: https://jentic.com/apis/googleapis.com/containeranalysis

# Google Container Analysis API

Google Container Analysis API stores and serves vulnerability, build, deployment, and SBOM metadata produced by Artifact Registry scanning, Advanced Vulnerability Insights, and other producers. It exposes notes (the metadata definitions, e.g. a CVE) and occurrences (instances of those notes against a specific resource URL such as a container image). Consumers can list occurrences for an image, attach custom notes, manage IAM on notes, and trigger an SBOM export for a scanned artifact. It is the metadata backbone for image-supply-chain security on Google Cloud.

## For AI agents

Query vulnerability findings and build provenance for Artifact Registry images, attach custom security notes, and export SBOMs so an agent can gate deployments on supply-chain risk.

## Scope

Does not run vulnerability scans, store images, or enforce deploy policy - use only to query and author finding metadata stored as notes and occurrences.

## Capabilities

- List vulnerability and other occurrences for a specific container image URL
- Create custom notes describing vulnerabilities, attestations, or build provenance
- Attach occurrences linking a note to a specific image or other resource
- Manage IAM policies on notes to control who can author findings
- Trigger an SBOM export for a scanned image stored in Artifact Registry
- Aggregate occurrence summaries across all images in a project
- Filter findings by severity, CVE ID, or fixable status

## Use cases

### Deployment Gate on Critical Vulnerabilities

A CI/CD pipeline calls Container Analysis after each Artifact Registry push to list occurrences of vulnerability notes against the new image. If any CRITICAL severity finding is unfixed, the pipeline aborts the deploy. The Container Analysis API surfaces the full occurrence list including CVE IDs, fixed package versions, and effective severity.

Example prompt: List occurrences for resourceUrl 'https://us-docker.pkg.dev/proj/repo/api@sha256:abc' and return any with severity CRITICAL and fixAvailable false.

### SBOM Export for Compliance

A regulated team needs an SPDX or CycloneDX SBOM for every production image. Container Analysis exposes exportSBOM, which writes the artifact's component graph to Cloud Storage. Compliance auditors download SBOMs from a known bucket without needing to install scanning tooling.

Example prompt: Trigger exportSBOM for the image 'https://us-docker.pkg.dev/proj/repo/web@sha256:def' and return the resulting Cloud Storage URI.

### Custom Attestation Authoring

A security team writes attestations (signed assertions about a build) as Container Analysis notes and links them to images via occurrences. Binary Authorization at deploy time references those attestations to enforce that only trusted builds run on GKE. The API exposes notes.create, occurrences.create, and IAM management to gatekeep authoring.

Example prompt: Create a note of kind ATTESTATION named 'prod-signoff', attach an occurrence linking it to image digest sha256:abc, and set its IAM policy to restrict writes to securityteam@example.com.

### Cross-Project Vulnerability Dashboard

A security analytics dashboard pulls occurrence summaries from Container Analysis across every project to plot fixable critical CVEs by team. The API's filtered occurrence list, combined with note metadata, gives the dashboard severity, CVSS, and remediation hints without scraping logs.

Example prompt: List all occurrences in project 'shared-security' filtered to vulnerability kind and severity CRITICAL, and group results by image repository.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /v1/{+name}/occurrences | List occurrences in a project |
| GET | /v1/{+name}/notes | List notes in a project |
| POST | /v1/{+name}:exportSBOM | Export the SBOM for a scanned image |
| GET | /v1/{+name} | Get a specific note or occurrence |

## Key resources

- **Notes** — Definitions of vulnerabilities, attestations, builds, deployments, or other findings
- **Occurrences** — Instances of notes linked to a specific resource such as a container image
- **IAM Policies** — Per-note bindings restricting who can author or read finding metadata
- **Operations** — Long-running operations such as SBOM exports

## Why Jentic

- **Setup:** Wiring Container Analysis by hand means setting up Google OAuth, minting short-lived cloud-platform tokens from a service account instead of a raw JSON key, and addressing note and occurrence resources on containeranalysis.googleapis.com. Through Jentic you install once, import the Container Analysis API from the API Directory, store the Google credential once, and your agent calls it.
- **Permission scoping:** The API carries the project and resource name in the URL path (/v1/{name}/occurrences and /v1/{name}/notes), so a rule can pin your agent to one project's finding metadata. You choose the operations it may call, so it can list occurrences and notes and export an SBOM while anything you leave out stays unavailable.
- **Credential handling:** Your Google service account credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list vulnerabilities for a container image', and Jentic returns the matching Container Analysis occurrences operation with its filter syntax and input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Artifact Registry API** — Stores the images that Container Analysis scans and indexes
- **Binary Authorization API** — Enforces deploy-time policy using attestation notes stored in Container Analysis
- **Kubernetes Engine API** — Runs the workloads whose images Container Analysis evaluates

## FAQ

### What authentication does the Container Analysis API use?

The Container Analysis API uses Google OAuth 2.0 with the cloud-platform scope. Through Jentic the service account credentials are stored encrypted in your Jentic One instance, and agents receive scoped access tokens minted per request.

### Can I list vulnerabilities for a single container image with the Container Analysis API?

Yes. Call occurrences.list with a filter on resourceUrl matching your image's full digest URL and on kind=VULNERABILITY. Each returned occurrence contains the linked note (CVE), severity, package, fix version when available, and effective severity.

### What are the rate limits for the Container Analysis API?

Container Analysis applies per-project read and write quotas, with stricter limits on exportSBOM because it triggers a long-running operation. Inspect the Cloud Console Quotas page for the precise per-method limits in your project.

### How do I export an SBOM for a deployed image through Jentic?

Run pip install jentic, search Jentic for 'export sbom for container image', load the schema for the exportSBOM operation on containeranalysis.googleapis.com, and execute it with the image's full resource URL.

### Does the Container Analysis API perform the vulnerability scanning itself?

No. Scans are produced by Artifact Registry and Advanced Vulnerability Insights and written into Container Analysis as occurrences. This API stores, filters, and serves those findings; it does not execute the scanners.

### Can I limit what my agent is allowed to do with the Container Analysis API?

Yes. Because Jentic One is self-hosted, your own rules decide which Container Analysis operations and credentials the agent may use. The API carries the project and resource name in the URL path, so you can pin the agent to one project's finding metadata and grant only the operations you want, such as listing occurrences and notes or triggering an SBOM export while anything you leave out stays unavailable. The Google service account credential stays with your instance and is injected at execution time, never reaching the agent's context.
