Hosted API
AI Governance API
API 1 · 8 operations · 19 named schemas
Overview
HTTP+JSON API for managing Docker governance policies and rules.
Resource model. An organization owns one or more policies. Each policy
contains a list of rules grouped into a single domain: either network or
filesystem. A policy's domain is derived from its rule actions; mixing
domains within a single policy is not permitted.
Lifecycle. Create a policy with CreatePolicy, then add rules with CreateRule. Rules can be updated in place with UpdateRule or removed with DeleteRule. Deleting all rules does not delete the policy itself.
Rule evaluation. All rules in a policy are tested against every request.
deny always wins: if any rule matches with decision: deny, the request
is denied regardless of any allow rules.
Enforcement. Organization policies take precedence over local sandbox policies and cannot be overridden by individual users.
Propagation. Policy changes take up to five minutes to reach developer machines after being written.
See the AI Governance documentation for product documentation.
Connecting to the AI Governance API
bearerAuth
Short-lived JWT obtained by exchanging Docker Hub credentials at
POST https://hub.docker.com/v2/auth/token. Pass the JWT in the
Authorization: Bearer <token> header. Tokens expire after a short
period; request a fresh one when you receive a 401.
The password field of the token request accepts any of the following
credential types:
| Type | Format | Notes |
|---|---|---|
| Password | Plain text | Your Docker Hub account password. |
| Personal Access Token (PAT) | dckr_pat_* | Recommended over passwords. Create one under Account Settings → Security. |
| Organization Access Token (OAT) | dckr_oat_* | Scoped to an organization. Create one under Organization Settings → Access Tokens. |
PAT and OAT strings can't be used directly as a bearer token. They must be exchanged at the token endpoint first.
See Docker Hub authentication for full details.
https://hub.docker.com/v2Policies
Rules
Operations
/orgs/{org_name}/governance/policies List policies
POST/orgs/{org_name}/governance/policies Create policy
GET/orgs/{org_name}/governance/policies/{policy_id} Get policy
DELETE/orgs/{org_name}/governance/policies/{policy_id} Delete policy
PATCH/orgs/{org_name}/governance/policies/{policy_id} Update policy
POST/orgs/{org_name}/governance/policies/{policy_id}/rules Create rule
DELETE/orgs/{org_name}/governance/policies/{policy_id}/rules/{rule_id} Delete rule
PATCH/orgs/{org_name}/governance/policies/{policy_id}/rules/{rule_id} Update rule