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

# Google On-Demand Scanning API

The On-Demand Scanning API scans container images for OS package and language ecosystem vulnerabilities outside the standard Artifact Registry auto-scan path. It exposes an analyzePackages operation that submits an image (typically resolved by digest) for scanning, then returns a long-running operation whose result lists vulnerability occurrences and their severity. Use it from CI pipelines, ad-hoc security checks, or air-gapped environments where you want explicit control over when an image is scanned. The spec exposes 7 endpoints.

## For AI agents

Trigger on-demand vulnerability scans of container images and read back the resulting vulnerability occurrences and severity ratings.

## Scope

Does not enforce admission policies, sign images, or store vulnerability metadata long-term - use for triggering image scans and reading their results only.

## Capabilities

- Submit a container image for vulnerability analysis via analyzePackages
- Poll long-running scan operations until results are ready
- List vulnerability occurrences detected for a scanned resource
- Cancel a scan operation that is no longer needed
- Wait synchronously on an operation to simplify CI integration

## Use cases

### Pre-deployment image scanning in CI

Run an on-demand scan against a container image as the final gate before promoting it from staging to production. The CI step submits the image via analyzePackages, waits on the resulting operation, and fails the build if any vulnerability above a chosen severity threshold is reported. Pairs well with Binary Authorization for enforcement at admission time.

Example prompt: Submit image us-docker.pkg.dev/proj/repo/api@sha256:abc123 to /v1/{+parent}/scans:analyzePackages, wait on the operation, and fail the pipeline if any HIGH or CRITICAL vulnerability appears in the result.

### Air-gapped or scheduled rescans

Re-scan production images on a schedule to catch newly disclosed vulnerabilities, especially for images that no longer trigger Artifact Registry auto-scan because the auto-scan window has lapsed. The on-demand path lets a security automation hit any image you have access to and capture the up-to-date vulnerability list. Works well as a daily cron driven by Cloud Scheduler.

Example prompt: For every image in production-allowlist.json, submit a scan, wait on the operation, and write all vulnerabilities of severity HIGH or above into a Cloud Storage bucket.

### Triage and reporting on vulnerability occurrences

Pull the list of vulnerability occurrences for a previously scanned image and feed them into a triage workflow - Jira tickets, Slack messages, or a security dashboard. The API returns CVE IDs, fix versions, severity, and affected packages so the downstream automation can deduplicate and prioritise.

Example prompt: Call GET /v1/{+parent}/vulnerabilities for image digest sha256:abc123 and create a Jira ticket for every vulnerability whose severity is CRITICAL and that has a fix available.

### Agent-driven container security checks via Jentic

A security agent can use Jentic to scan an image referenced in a chat or ticket - issue an intent like scan this image for cves and Jentic returns the matching On-Demand Scanning operation. Credentials stay in your Jentic One instance, so the agent runs scans under a scoped service-account token with full audit trail.

Example prompt: Use Jentic to find the analyzePackages operation, load its schema, execute it for the image referenced in a triage ticket, and reply with a count of HIGH and CRITICAL findings.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v1/{+parent}/scans:analyzePackages | Submit an image for vulnerability scanning |
| GET | /v1/{+parent}/vulnerabilities | List vulnerability occurrences for a parent |
| GET | /v1/{+name} | Get a long-running operation |
| POST | /v1/{+name}:cancel | Cancel a scan operation |
| POST | /v1/{+name}:wait | Wait synchronously on an operation |

## Key resources

- **scans** — Scan request resource that drives package analysis
- **vulnerabilities** — Vulnerability occurrences detected on a scanned resource
- **operations** — Long-running operations representing in-flight scans

## Why Jentic

- **Setup:** Wiring the On-Demand Scanning API by hand means setting up Google OAuth 2.0 from a service account, minting scoped tokens, and polling the long-running analyze operation against ondemandscanning.googleapis.com yourself. Through Jentic you install once, import the On-Demand Scanning API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** The On-Demand Scanning API puts the scan resource in the URL path (/v1/{+parent}/scans:analyzePackages, /v1/{+name}), so a rule can pin your agent to one parent location: it can start scans and read their vulnerabilities there and nothing else. You choose the operations it may call, so you can allow analysis and result reads while leaving scan cancellation out of the allowed set.
- **Credential handling:** Your Google OAuth credential for the On-Demand Scanning API 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 'scan a container image for CVEs' or 'read scan vulnerabilities', and Jentic returns the matching On-Demand Scanning operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Container Analysis API** — Container Analysis stores notes and occurrences and runs auto-scan on Artifact Registry
- **Binary Authorization API** — Binary Authorization enforces deployment policies based on scan results
- **Artifact Registry API** — Artifact Registry hosts the images that On-Demand Scanning analyses

## FAQ

### What authentication does the On-Demand Scanning API use?

The API uses Google OAuth 2.0 with the cloud-platform scope. Through Jentic, tokens are minted from a service account stored in your Jentic One instance so agents never see raw credentials.

### Can I scan an image hosted outside Artifact Registry?

Yes - analyzePackages accepts a resource URI for any image you have read access to, including Container Registry and properly-credentialled third-party registries. The scanner pulls package metadata and matches against Google's vulnerability feeds.

### What are the rate limits for the On-Demand Scanning API?

Google Cloud meters scan operations as long-running operations under per-project quotas. Treat scans as asynchronous - submit, then poll /v1/{+name} or use :wait, rather than retrying on failure.

### How do I scan a container image through Jentic?

Search Jentic for scan container image, load the schema for POST /v1/{+parent}/scans:analyzePackages, and execute it with the image resource URI. The Jentic SDK returns the operation handle so the agent can poll for vulnerabilities.

### Does this API also enforce admission policy?

No - admission enforcement happens in Binary Authorization, which can consume the attestations or vulnerability data this API produces. Use this API to discover vulnerabilities, then Binary Authorization to block deployments.

### How do I read the result of a finished scan?

Once the operation is done, the result includes a list of vulnerability occurrences, or you can call GET /v1/{+parent}/vulnerabilities filtered by the scanned resource URI.

### Can I limit what my agent is allowed to do with the On-Demand Scanning API?

Yes. Because you run Jentic One yourself, your own rules decide which On-Demand Scanning operations and credentials the agent may use. Since this API carries the scan resource in the URL path (/v1/{+parent}/scans:analyzePackages and /v1/{+name}), you can pin the agent to a single parent location so it can only start scans and read vulnerabilities there. You also choose the exact operations it may call, so you can allow analyzePackages and vulnerability reads while keeping scan cancellation out of the allowed set.
