Skip to content

docs(examples): add an ANS identity example for supervisor middleware - #6243

Open
kperry-godaddy wants to merge 1 commit into
ai-openshell:mainfrom
kperry-godaddy:docs/5011-supervisor-middleware-ans-identity/kperry-godaddy
Open

kperry-godaddy wants to merge 1 commit into
ai-openshell:mainfrom
kperry-godaddy:docs/5011-supervisor-middleware-ans-identity/kperry-godaddy

Conversation

@kperry-godaddy

Copy link
Copy Markdown

Summary

Adds a runnable supervisor middleware example in which an external service signs each allowed request from a sandbox with an agent identity, while the signing key stays outside the sandbox. A receiving service verifies the identity. The example changes no OpenShell runtime code.

Related Issue

Closes #5011

Changes

  • examples/supervisor-middleware-ans-identity/smoke.sh: a launcher that fetches the extension at a full commit SHA, checks the fetched commit, and runs that repository's smoke test.
  • examples/supervisor-middleware-ans-identity/README.md: the trust boundary, prerequisites, the five checks, fixture trust and production trust, validated versions, limitations, and ownership.
  • examples/supervisor-middleware-ans-identity/gateway.toml and policy.yaml: reference copies of the middleware registration and sandbox policy the test renders.
  • docs/extensibility/supervisor-middleware/index.mdx: one paragraph that links the example.

Answers to the two questions in the issue's triage comment:

  1. The launcher pins the extension by full commit SHA and stops if the fetched commit differs. The tag is named in a comment and in the README for readers.
  2. No OpenShell CI job runs the example. The extension's CI runs the same test against the OpenShell release it pins. The pin moves by pull request to this directory after that test passes against a newer OpenShell release. The README has a "Validated versions" table with the last OpenShell version verified.

Two things reviewers should know:

  • The extension implements the legacy EvaluateHttpRequest RPC, which is removed in 0.2.0, and its test pins OpenShell v0.1.7. The README says so at the top and points new middleware at the content guard example. The docs paragraph says so too.
  • The example does not run on v0.1.11. That release ships the Docker driver as a separate binary, and the test downloads only the CLI and gateway assets. I tried it and the gateway does not start. Moving the extension to HTTP hooks and to a current release is work in the extension repository. A later pull request here would then move the pin.

The triage comment left one decision open: an in-tree launcher under examples/, or a link from the middleware docs to the extension repository. This pull request is the in-tree launcher. If maintainers prefer the link, I will cut it down to the docs paragraph.

@purp, you asked to review this.

Testing

  • Checks appropriate to the affected code and behavior pass
  • Unit tests added/updated (if applicable)
  • E2E tests added/updated (if applicable)

Ran on macOS (Apple silicon) with Rancher Desktop:

  • ./examples/supervisor-middleware-ans-identity/smoke.sh, five passing runs. Each ended with ALL PASS 5 checks against OpenShell v0.1.7 (5d25211) and left no containers, volumes, or processes behind. The first run of the day, started right after the container runtime booted, timed out waiting for the gateway. It did not recur.
  • Interrupted a run three ways: Ctrl-C to the process group, TERM to the launcher, and TERM to the process group. Each time the test finished its own cleanup before the launcher removed the checkout.
  • ./examples/supervisor-middleware-ans-identity/smoke.sh --print-config. The registration it renders matches gateway.toml apart from the per-run address and CA path, and policy.yaml matches the test's policy template.
  • shellcheck and bash -n on smoke.sh.
  • uv run python scripts/update_license_headers.py --check
  • markdownlint-cli2 with the repository configuration
  • uv run tasks/scripts/check_docs_nav.py
  • fern check

Not run here: the example on Linux. The extension's CI runs the same test on ubuntu-latest at the pinned commit.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Add examples/supervisor-middleware-ans-identity. An external middleware
service signs each allowed request from a sandbox with an agent identity
while the signing key stays outside the sandbox, and a receiving service
verifies the identity. The example runs a real gateway, supervisor, and
sandbox on the Docker driver and asserts five outcomes: an authorized
sandbox's request arrives signed, forged identity headers are replaced,
an unsigned direct request is rejected, an unapproved sandbox is denied
before the request leaves, and a stopped middleware blocks the request
under fail_closed.

The directory holds a launcher, reference copies of the middleware
registration and sandbox policy the test renders, and a walkthrough. The
launcher fetches the extension at a full commit SHA, checks the fetched
commit, and runs that repository's smoke test.

The extension implements the legacy request hook and its test pins
OpenShell v0.1.7. The README says so and points new middleware at the
content guard example, which implements HTTP hooks.

Link the example from the supervisor middleware page. No runtime code
changes.

Closes ai-openshell#5011

Signed-off-by: kperry <kperry@godaddy.com>
@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Dec 4, 2026

This branch has not been deployed

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

Labels

state:accepted A maintainer decided OpenShell should pursue this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(examples): add a runnable ANS identity example for supervisor middleware

1 participant