Skip to content

sbx: restructure governance docs and add API reference#25162

Draft
dvdksn wants to merge 11 commits into
docker:mainfrom
dvdksn:sbx/governance-docs
Draft

sbx: restructure governance docs and add API reference#25162
dvdksn wants to merge 11 commits into
docker:mainfrom
dvdksn:sbx/governance-docs

Conversation

@dvdksn
Copy link
Copy Markdown
Contributor

@dvdksn dvdksn commented May 25, 2026

Summary

Restructures the Docker AI Governance documentation under `/ai/sandboxes/governance/` and adds the supporting API reference.

Preview links:

Information architecture

The existing `security/governance` and `security/policy` pages are merged into a new top-level `governance` section so local-policy and org-policy sit side by side instead of being split across unrelated parents:

  • `/ai/sandboxes/governance/` — section landing; explains local + org as layered enforcement
  • `/ai/sandboxes/governance/concepts/` — resource model, rule syntax, evaluation, precedence
  • `/ai/sandboxes/governance/local/` — `sbx policy` CLI for individual machines
  • `/ai/sandboxes/governance/org/` — Admin Console flow (was `security/governance.md`)
  • `/ai/sandboxes/governance/monitoring/` — `sbx policy ls` / `sbx policy log`

API reference

`/reference/api/ai-governance/` renders the Governance OpenAPI spec vendored at `content/reference/api/ai-governance/api.yaml` from `docker/governor-services`. Operations, schemas, examples, and status codes are fully driven by the spec — future updates land via re-vendor, not in-repo edits. Anything wrong in the rendered reference should be fixed upstream and re-vendored here.

The spec has been re-vendored to the latest upstream version, which updated the server URL to `hub.docker.com/v2` and added the `/governance/` prefix to all API paths.

Review focus

  1. The `/ai/sandboxes/governance/` landing — does the local + org framing match how the product is positioned?
  2. `/reference/api/ai-governance/` — does the rendered spec match the source of truth, and is anything important missing?

Generated by Claude Code

@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 3862ba2
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a19a2553a6d490008c69319
😎 Deploy Preview https://deploy-preview-25162--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added hugo Updates related to hugo area/ai labels May 25, 2026
Copy link
Copy Markdown

@docker-agent docker-agent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

This PR restructures sandbox governance docs into a clean multi-page hierarchy and adds an OpenAPI-rendered API reference page. The redirect aliases on local.md and org.md correctly cover the old security/policy and security/governance URLs. Two issues found in the newly added content.

Comment thread content/manuals/ai/sandboxes/governance/_index.md Outdated
Comment thread content/reference/api/ai-governance/api.yaml Outdated
@github-actions github-actions Bot added the area/api Relates to Docker API docs label May 26, 2026
@dvdksn
Copy link
Copy Markdown
Contributor Author

dvdksn commented May 28, 2026

Endpoints will get a new shape, waiting on the new OAS reflecting this to land.

@dvdksn dvdksn force-pushed the sbx/governance-docs branch from 5d453f3 to 32c124d Compare May 29, 2026 14:10
@github-actions github-actions Bot added area/engine Issue affects Docker engine/daemon area/compose Relates to docker-compose.yml spec or docker-compose binary area/hub Issue affects Docker Hub area/build Relates to Dockerfiles or docker build command area/desktop Issue affects a desktop edition of Docker. E.g docker for mac area/cli Relates to the CLI client area/security area/get-started Relates to get started and onboarding docs area/subscription Relates to Docker pricing and subscription area/storage Relates to storage, volumes area/extensions Relates to Docker Extensions area/release Relates to CI or deployment area/admin Relates to Docker Admin area/scout Relates to Docker Scout dependencies Vendoring, packaging updates area/billing area/accounts Relates to Docker accounts area/config area/tests area/guides area/dhi area/offload ci ci updates labels May 29, 2026
lacatoire and others added 9 commits May 29, 2026 16:12
The "Data source Discovery" heading in
`content/guides/grafana-mcp-server-gemini.md` has two spaces after the
`###`, which trips markdownlint (MD019). Since the lint job runs over
the whole `content/**/*.md` tree, this currently fails CI on every open
PR. This removes the extra space.
Splits the existing security/governance and security/policy pages into a
new governance section with concepts, local, organization, monitoring,
and API reference sub-pages, and adds a custom api-reference Hugo layout
that renders the colocated OpenAPI 3 spec directly from the spec file.

The layout reads the spec via transform.Unmarshal, resolves $ref nodes
through a small returning partial, and overrides baseof's main block to
take the full content width. The built-in right-rail TOC is replaced
with a sticky endpoint navigator that groups operations by tag with
method-colored pills.

Each operation card shows method/path, summary, description, parameters,
request body, and responses. Responses use native <details> elements so
the list of status codes stays scannable; 2xx defaults to open. JSON
examples are wrapped in the site's syntax-light/dark utility so Chroma
classes pick up the theme. Each operation also exposes a copy-as-cURL
button that assembles a ready-to-paste command from the spec's path and
query parameter examples, the bearer-auth scheme (with $TOKEN as a
literal placeholder), and the request body's default JSON example.

A companion api-reference.markdown.md template renders the same spec as
a clean markdown document so the page's "Copy Markdown" / "View
Markdown" actions and the .md alternate link return real content
instead of just the page title.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Relocates the OpenAPI reference page bundle out of the product manual
tree and into the canonical /reference/api/ section. The old URL keeps
working via a Hugo alias on the new page.

Under /ai/sandboxes/governance the sidebar still shows an "API
reference" entry: a non-rendered stub page (build.render: never) with
sidebar.goto pointing at the new location, so the link in the
governance sidebar cross-references the reference section directly
without bouncing through a placeholder page. The duplicate
static/manuals/ai/sandboxes/governance/api.yaml is dropped now that
the page resource is the single source of the spec.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The sidebar stub at content/manuals/ai/sandboxes/governance/api.md has
build.render: never, so relative (api.md) links from sibling files
resolved to an empty href once the bundle moved to the reference
section. Updates org.md, local.md, concepts.md, and _index.md to link
directly at the new URL.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Picks up upstream style fixes (drops "currently", removes meta "Note:"
prefix) and overrides the doc-URL line that upstream regressed to the
pre-restructure /security/governance/ path. Will be fixed upstream so
the next re-vendor stays clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Re-vendors the OpenAPI spec from upstream, which now exposes UpdateRule
with application/merge-patch+json (RFC 7396) instead of application/json.
The layout, the curl-command builder, and the markdown template all
previously hardcoded index .content "application/json", which would have
silently dropped the new content. They now iterate the content map and
pick the first declared media type, surface it as a small "Content
type:" label, and use the same value in the generated curl Content-Type
header.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Updates api.yaml to the latest spec from docker/governor-services:
- server URL changed to hub.docker.com/v2
- all paths now include /governance/ prefix
- routing note added to info description
- permission_denied descriptions updated to mention org entitlement

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dvdksn dvdksn force-pushed the sbx/governance-docs branch from 32c124d to addcf27 Compare May 29, 2026 14:16
dvdksn and others added 2 commits May 29, 2026 16:24
- defaults.md: rewrite the network-defaults outro to consolidate the
  two-sentence local/org split into one paragraph pointing at the
  governance section, and fix the stale governance.md link (was
  security/governance.md, now governance/org.md)
- get-started.md next-steps: change [Policies]→[Governance] pointing
  at the section landing instead of local.md
- faq.md: point the "network policies" overview link at the section
  landing rather than local.md

Inline links that are specifically about sbx policy CLI usage
(get-started.md:117, :236; isolation.md; architecture.md) stay at
local.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
architecture.md and isolation.md describe the proxy mechanism that
enforces network policy — this applies equally to local and org-level
rules, so local.md was too narrow. Switch both to governance/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@briandai-docker briandai-docker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is amazing! Thanks for documenting 🙏 🙏 , left a small comments mainly pointing out delegation as something that is still TBD

**Organization policy** is configured centrally in the Docker Admin Console or
via the [Governance API](/reference/api/ai-governance/). Rules defined at the org level apply
uniformly across every sandbox in the organization and take precedence over
local rules. Admins can optionally delegate specific rule types back to local
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not supporting delegation for now until there's some more product-shaping. cc @smnovick

Comment on lines +100 to +103
- Admins can [delegate](org.md#delegate-rules-to-local-policy) specific rule
types back to local control. Delegated local rules can expand access for
targets the organization hasn't explicitly denied, but can't override
organization-level deny rules.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not supporting delegation for the time being


**Enforcement and delegation.** Organization policies take precedence over
local sandbox policies and cannot be overridden by individual users. When
an administrator enables delegation for a rule type, users may supplement
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delegation again

**Routing.** This is the public-facing API. Requests are received by the
Docker Hub gateway and forwarded to the governance service; the paths
documented here (`/v2/orgs/{org_name}/governance/...`) are the public
routes, which differ from the internal service routes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stupid question, who are these docs for? 😅 Are they public facing?

default:
value:
name: "Security Research — hardened"
scope:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we should add some examples in here of teams as well. Also profiles is only enabled for Nvidia and the future shape of it is tbd.


| Type | Format | Notes |
|------|--------|-------|
| Password | Plain text | Your Docker Hub account password. |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building familiarity with our APIs still - need to personally check if this form of authn also works.

value:
error:
code: invalid_argument
message: "name is required"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious does this need quotes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/accounts Relates to Docker accounts area/admin Relates to Docker Admin area/ai area/api Relates to Docker API docs area/billing area/build Relates to Dockerfiles or docker build command area/cli Relates to the CLI client area/compose Relates to docker-compose.yml spec or docker-compose binary area/config area/desktop Issue affects a desktop edition of Docker. E.g docker for mac area/dhi area/engine Issue affects Docker engine/daemon area/extensions Relates to Docker Extensions area/get-started Relates to get started and onboarding docs area/guides area/hub Issue affects Docker Hub area/offload area/release Relates to CI or deployment area/scout Relates to Docker Scout area/security area/storage Relates to storage, volumes area/subscription Relates to Docker pricing and subscription area/tests ci ci updates dependencies Vendoring, packaging updates hugo Updates related to hugo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants