Repository navigation
docs(examples): add an ANS identity example for supervisor middleware - #6243
Open
kperry-godaddy wants to merge 1 commit into
Conversation
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>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tomlandpolicy.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:
Two things reviewers should know:
EvaluateHttpRequestRPC, 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 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
Ran on macOS (Apple silicon) with Rancher Desktop:
./examples/supervisor-middleware-ans-identity/smoke.sh, five passing runs. Each ended withALL 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.TERMto the launcher, andTERMto 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 matchesgateway.tomlapart from the per-run address and CA path, andpolicy.yamlmatches the test's policy template.shellcheckandbash -nonsmoke.sh.uv run python scripts/update_license_headers.py --checkmarkdownlint-cli2with the repository configurationuv run tasks/scripts/check_docs_nav.pyfern checkNot run here: the example on Linux. The extension's CI runs the same test on
ubuntu-latestat the pinned commit.Checklist