Repository navigation
Description
User Story
I run OpenShell v0.1.7 (gateway, sandbox supervisor and sandboxes on the Docker driver) to evaluate an external supervisor middleware that attaches an operator-assigned, verifiable agent identity to outbound HTTP requests while keeping the signing key outside the sandbox. The middleware is the ANS identity extension and we maintain it. I need a reproducible example that exercises the real gateway and supervisor and shows the receiving service verifying that identity, and I need it to be discoverable from the supervisor middleware documentation so other middleware authors can start from it.
Problem Statement
OpenShell supports external supervisor middleware and documents a content-guard example. It does not provide a runnable request-identity example showing how an external middleware service attaches a verifiable agent identity outside the sandbox and how a receiving service validates it.
This is a documentation and example contribution using the existing middleware contract. Its scope is HTTP request signing and verification against OpenShell v0.1.7.
Impact / Why This Matters
An extension author evaluating this workflow has to assemble gateway authentication, middleware registration with explicit bindings, sandbox policy, sandbox-to-identity authorization, and a verifying endpoint independently. An in-process middleware test does not establish that the real gateway and supervisor invoke the service, apply its header mutations, or block traffic when the middleware fails.
The example gives users a reproducible way to validate those boundaries while keeping signing keys outside the workload, and gives the external middleware contract a concrete interoperability check that runs against a released OpenShell version.
Proposed Design
Add a small supervisor middleware example and link it from the supervisor middleware documentation. The example uses the existing ANS identity extension, maintained in its own repository and referenced at an immutable release tag.
The user workflow:
- On Linux or macOS (Apple silicon) with Docker and the documented prerequisites, run one documented command.
- The launcher fetches the extension at the pinned tag, downloads the pinned OpenShell v0.1.7 CLI and gateway release assets and verifies their checksums, mints disposable identity and trust fixtures, starts the extension and a reference verifying endpoint, and starts an authenticated gateway with the middleware registered.
- It creates a sandbox with the middleware attached, authorizes the gateway-issued sandbox ID for one identity through operator-controlled configuration, and sends ordinary HTTP requests from the sandbox.
- It asserts the identity guarantees listed under Acceptance Criteria, then removes its sandboxes, processes and temporary material.
Gateway authentication stays enabled and the extension is called over TLS with gateway-issued JWTs. The example uses generated, explicitly trusted test artifacts and needs no production credentials and no live registration service; the documentation separates that fixture trust from production registration. It requires no OpenShell runtime changes.
Notional configuration
Within the example's complete gateway configuration:
[[openshell.supervisor.middleware]]
name = "ans-identity-example"
grpc_endpoint = "https://<reachable-middleware-host>:50051"
tls_ca_cert_path = "/path/to/example-ca.pem"
max_payload_bytes = 1048576
timeout = "2s"
binding_policy = "allowlist"
bindings = ["http_request_pre_credentials"]Within the example's complete sandbox policy:
network_middlewares:
ans-identity:
middleware: ans-identity-example
order: 100
on_error: fail_closed
endpoints:
include: ["host.openshell.internal"]
config:
mode: sign
identity: example-agentThe runnable example supplies the authenticated gateway configuration, reachable local addresses, certificates, network policy, trust roots and sandbox identity approval. Signing is placed last in the request middleware chain.
Acceptance Criteria
The harness that implements this workflow is merged in the extension repository (examples/openshell-smoke at v0.1.1) and runs on every push to its main branch on ubuntu-latest (latest run). It also passes on macOS (Apple silicon) with Rancher Desktop and with Docker Desktop. Items checked below are what those runs assert against OpenShell v0.1.7.
- A documented command runs the example from a clean checkout on the supported Linux/Docker environment with pinned component revisions and no production secrets.
- An authorized sandbox's request is verified by the receiving service, which returns the exact expected ANS identity.
- Workload-supplied forged identity headers are replaced, and the receiver verifies the operator-assigned identity.
- A sandbox without an approved identity binding cannot cause the protected operation to execute (
403 middleware_denied, and the receiving service's log does not grow). - An unavailable middleware service blocks the affected request, and the protected operation is not executed (
403 middleware_failedunderon_error: fail_closed). - The receiving service rejects an unsigned direct request (
401). - The example reports assertion failures, cleans up its resources, and distinguishes actual OpenShell runtime checks from separate verifier replay/tampering tests.
- Documentation explains the trust boundary, fixture versus production trust, supported versions, maintainer ownership, and limitations, and is linked from the supervisor middleware documentation. The extension's documentation covers the first part; the link from OpenShell's supervisor middleware documentation is what the proposed pull request adds.
Alternatives Considered
- Existing content-guard example: demonstrates the middleware lifecycle and content transformations. This example adds request signing, per-sandbox identity authorization, and verification by the receiving service.
- Existing in-process ANS demo: checks signing, verification, replay, tampering, and caller authorization, but simulates the supervisor. It remains useful alongside the real-runtime check.
- Provider credential injection and SPIFFE token-grant examples: useful existing identity and credential workflows. This proposal demonstrates an external request-signing extension with a named agent identity and a receiving verifier.
- Gateway interceptor: suited to governing control-plane operations; this use case acts on allowed outbound HTTP requests, so supervisor middleware is the applicable extension point.
- Built-in implementation: unnecessary; the external extension contract already supplies the required integration boundary, and the example needs no runtime changes.
Compatibility Investigation
- The example runs against OpenShell v0.1.7 (released November 3, 2026): the CLI and gateway release assets are pinned by SHA-256 and the supervisor and sandbox runtime images by manifest digest. Gateway authentication is enabled, and the middleware is registered with
binding_policy = "allowlist"andbindings = ["http_request_pre_credentials"], so a service that stops advertising the request hook is refused rather than skipped. - The extension's vendored
extension.proto,supervisor_middleware.proto, andgateway_interceptor.protoare checked against the pinned OpenShell commit in the extension's CI, so the published contract and the vendored copy cannot drift silently. - Observed on v0.1.7: after the middleware restarts to apply a new sandbox identity approval, the supervisor's channel to it reconnects within a few seconds, and matching requests fail closed with
middleware_faileduntil it does. The example retries through that window and documents it as a limitation. - The example's harness shares a Docker daemon with other gateways safely: it runs under its own
sandbox_label, so the gateway's startup reconciliation does not touch another gateway's supervisor containers.
References: v0.1.7 release, middleware configuration, content-guard example, extension harness README.
Checklist
- I've reviewed existing issues and the published docs.
- This is a design proposal with a bounded contribution scope.
Activity
[-]docs(examples): add a runnable ANS identity example for supervisor middleware[/-][+][Draft proposal] docs(examples): add a runnable ANS identity example for supervisor middleware[/+]feat(examples): add a real-runtime OpenShell smoke test (#21)
[-][Draft proposal] docs(examples): add a runnable ANS identity example for supervisor middleware[/-][+]docs(examples): add a runnable ANS identity example for supervisor middleware[/+]kperry-godaddy commentedon Nov 11, 2026
Chris White asked that a demo be included. Here is the example running end to end, recorded on macOS with Docker against OpenShell v0.1.7:
What the recording shows, in order:
POSTfrom the sandbox reaches the receiving service signed: a DPoP proof, the agent's transparency-log receipt and its status token, all added by the supervisor middleware. The service verifies them and returns the operator-assigned ANS identity.DPoP,X-SCITT-ReceiptandX-ANS-Status-Tokenset inside the sandbox are overwritten, not relayed. The service still sees only the assigned identity.401. This also proves the service logs rejections, which the next two checks rely on.403 middleware_deniedwith reasonans_identity_unauthorized. The service's log does not grow, so it never saw the request.403 middleware_failedunderon_error: fail_closed, and again the service is not reached.No OpenShell runtime changes are involved; the middleware uses the documented
PRE_CREDENTIALSrequest hook. Every key in the run is minted for that run and discarded. The in-process demo in the extension repository (make demo) covers replay and body tampering at the verifier; this example covers what only a real runtime can show.To run it from the staged branch:
The launcher clones the extension at its pinned release (v0.1.1) and runs its smoke test; the same test runs directly with
make openshell-smokefrom https://github.com/agentnameservice/ans-openshell at that tag. Prerequisites and the trust-boundary notes are in the example's README on that branch. Vouch request: #5368purp commentedon Nov 20, 2026
Assessment: valid and well evidenced. This is a docs and example contribution on the documented supervisor middleware extension point and needs no runtime change. The user story is first-hand, the notional gateway and policy configuration is concrete, and the acceptance criteria are backed by the merged harness (agentnameservice/ans-openshell#21), its CI runs, and the recorded demo.
Reviewed the staged branch (
docs/5011-ans-identity-example/kperry-godaddy). It addsexamples/supervisor-middleware-ans-identity/and a two-line link indocs/extensibility/supervisor-middleware/index.mdx. Itssmoke.shclones the extension at tagv0.1.1and runs that repository's smoke test.Questions for the author before a PR:
Remaining decision: where the example lives, either an in-tree launcher under
examples/(as staged) or a link from the middleware docs to the extension repository. The vouch request (#5368) is also pending; it's required before a PR.purp commentedon Nov 20, 2026
Vouch request has been completed. Would love to see this PR, @kperry-godaddy. Add me as a reviewer when you put it up?