You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 174c2e5
Browse filesBrowse the repository at this point in the historyBrowse files
docs(extensibility): restructure middleware guides and share extension auth
Merge the middleware configure and operate guides, move extension caller
authentication to a shared page used by middleware and interceptors, and
trim protocol pages to the service-author contract. Pin page slugs to fix
broken WebSocket, negotiation, and interceptor links.
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Copy file name to clipboardExpand all lines: docs/about/overview.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ position: 1
11
11
NVIDIA OpenShell is an open-source runtime for executing autonomous AI agents in sandboxed environments with kernel-level isolation. It combines sandbox runtime controls and a declarative YAML policy so teams can run agents without giving them unrestricted access to local files, credentials, and external networks.
12
12
13
13
<Note>
14
-
New in OpenShell 0.1.0 is a [stable release cadence](/about/installation#release-cadence), a stronger [security model](/about/how-it-works), and an expanded [extension surface](/extensibility/extension-negotiation), along with much more.
14
+
New in OpenShell 0.1.0 is a [stable release cadence](/about/installation#release-cadence), a stronger [security model](/about/how-it-works), and an expanded [extension surface](/extensibility/overview), along with much more.
15
15
16
16
See our [upgrade guide](/upgrade/0-1-0) for everything that's changed.
When the gateway has JWT signing configured, OpenShell attaches a short-lived bearer token to every call it makes to a [gateway interceptor](/extensibility/gateway-interceptors) or [supervisor middleware](/extensibility/supervisor-middleware) service. Your service validates this token to confirm that the call comes from your gateway or one of its sandboxes.
12
+
13
+
## Tokens OpenShell Sends
14
+
15
+
Each token is an EdDSA-signed JWT scoped to one service registration:
16
+
17
+
| Claim | Value |
18
+
| --- | --- |
19
+
|`iss`|`openshell-gateway:<gateway_id>`. |
20
+
|`aud`| The registration's `audience`. Defaults to `urn:openshell:extension:interceptor:<name>` or `urn:openshell:extension:middleware:<name>`. |
21
+
|`caller_kind`|`gateway` for calls from the gateway, or `supervisor` for middleware calls from a sandbox supervisor. |
22
+
|`sandbox_id`| The calling sandbox, present only when `caller_kind` is `supervisor`. |
23
+
24
+
Authenticated network services use `https://` endpoints. OpenShell verifies the service certificate against platform trust roots, or against the private CA in the registration's `tls_ca_cert_path`, and always checks the hostname.
25
+
26
+
## Establish Trust in the Gateway
27
+
28
+
Provision your service with the trusted gateway URL, the expected gateway ID, and the gateway's public key or JWKS. This operator-provisioned material is the trust anchor. Fetching keys from the gateway does not establish its identity by itself.
29
+
30
+
After initial trust is established, your service can refresh keys from `GET /.well-known/openid-configuration` and its `jwks_uri` on the trusted gateway URL. Fetch updates only over authenticated TLS. The document is shaped like OIDC discovery, but its `issuer` is the gateway identity rather than the URL that serves it, so compare `iss` with your configured value.
31
+
32
+
## Validate Each Token
33
+
34
+
Cache keys by `kid` and check that:
35
+
36
+
-`typ` is exactly `openshell-ext+jwt`.
37
+
-`alg` is `EdDSA`. Pin the algorithm instead of reading it from the token.
38
+
- The signature, issuer, exact audience, and expiry are valid.
39
+
-`caller_kind` is one your service accepts, and `sandbox_id` matches your expectations when your service scopes behavior per sandbox.
40
+
41
+
OpenShell reuses a token until it rotates, so do not reject a repeated `jti` as a replay.
42
+
43
+
## Confirm the Audience at Startup
44
+
45
+
Return the audience your service expects in the `expected_audience` field of its `Describe` manifest. After authentication succeeds, the gateway compares this value with the operator-configured `audience` and refuses to start when they differ. A strict service may reject a token with the wrong audience before returning its manifest, in which case gateway startup reports an authentication failure. Leave the field empty to skip this check.
46
+
47
+
## Run Without Authentication
48
+
49
+
Set `allow_insecure_transport = true` on a registration to use a plaintext `http://` endpoint. OpenShell then sends no token, and your service cannot distinguish OpenShell from any other client that can reach it. The gateway logs a warning for the registration at every startup.
50
+
51
+
Use this setting for local development, or on a network that already authenticates callers.
52
+
53
+
## Current Limitations
54
+
55
+
- Tokens are bearer credentials. A captured token remains valid until it expires unless your service adds proof of possession or request binding.
56
+
- Extension tokens share a signing key with other tokens the gateway issues, so you cannot rotate or revoke extension credentials independently.
57
+
- mTLS client authentication and overlapping signing-key rotation are not available.
Copy file name to clipboardExpand all lines: docs/extensibility/gateway-interceptors.mdx
+6-13Lines changed: 6 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,16 @@
2
2
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
3
# SPDX-License-Identifier: Apache-2.0
4
4
title: "Gateway Interceptors"
5
-
sidebar-title: "Gateway Interceptors"
5
+
sidebar-title: "Interceptors"
6
+
slug: "extensibility/gateway-interceptors"
6
7
description: "Extend OpenShell gateway operations with deployment-specific governance and business logic."
7
8
keywords: "Generative AI, Cybersecurity, AI Agents, Gateway Interceptors, Extensibility, Governance"
8
-
position: 2
9
9
---
10
10
Gateway interceptors let operators add deployment-specific governance to OpenShell control-plane operations without modifying the gateway. An external gRPC service can modify or validate selected API writes before the gateway handles them, then observe successful responses after commit.
11
11
12
12
See the [governance interceptor example](https://github.com/NVIDIA/OpenShell/tree/main/examples/governance-interceptor) for a complete service that vends provider profiles, applies a signed policy to new sandboxes, and rejects attempts to weaken that policy.
13
13
14
-
## Choose Gateway Interceptors
14
+
## When to Use Gateway Interceptors
15
15
16
16
Use a gateway interceptor when an external service needs to govern gateway API operations. For example, an interceptor can:
17
17
@@ -77,7 +77,7 @@ Start the interceptor before the gateway, then register it in gateway TOML:
The gateway supports `http://`, `https://`, and `unix://` interceptor endpoints. When gateway JWT signing is configured, authenticated network interceptors use `https://`; Unix sockets remain available for local integrations. HTTPS uses platform trust roots unless `tls_ca_cert_path` supplies a private CA, and normal hostname verification remains enabled. The gateway calls `Describe` and builds an immutable execution plan during startup. An unavailable service, invalid manifest, missing credential, or unauthorized configured binding prevents the gateway from starting.
99
99
100
-
The gateway attaches a short-lived EdDSA bearer token to `Describe`, `Evaluate`, and provider-profile snapshot calls. The token uses the configured `audience` (defaulting to `urn:openshell:extension:interceptor:<name>`) and `caller_kind: gateway`.
101
-
102
-
Return your expected audience in the `expected_audience` field of your `Describe` manifest. After authenticated `Describe` succeeds, the gateway compares the advertised value with its operator-configured audience and refuses to start when they differ. This is a post-authentication consistency assertion, not audience discovery: a strict verifier may reject an incorrect audience before returning the manifest, in which case startup reports an authentication failure. Leave the field empty to skip the consistency check.
103
-
104
-
Provision the trusted gateway URL, expected gateway ID, and public key or JWKS through the deployment. This operator-provisioned key material is the authoritative cold-start trust anchor. The expected issuer is exactly `openshell-gateway:<gateway_id>`; fetching JWKS does not establish that identity by itself. After initial trust is established, `GET /.well-known/openid-configuration` and its `jwks_uri` provide steady-state key refresh and operational convenience. The document is OIDC-shaped rather than OIDC-compliant because `issuer` is the gateway identity rather than the serving URL; compare `iss` against the configured value and fetch updates only over authenticated TLS at the trusted gateway URL. Pin `alg` to `EdDSA`, require `typ` to be exactly `openshell-ext+jwt`, and validate `kid`, signature, expected issuer, exact audience, positive expiry, and caller kind.
105
-
106
-
Set `allow_insecure_transport = true` on an interceptor to keep a plaintext `http://` endpoint working with no credential attached. The gateway logs a warning naming the interceptor at every startup, and the service cannot distinguish the gateway from any other client that can reach it.
100
+
When gateway JWT signing is configured, the gateway authenticates every call to the interceptor with a short-lived token. [Extension Authentication](/extensibility/extension-authentication) describes how your service validates it. Set `allow_insecure_transport = true` to use a plaintext `http://` endpoint without authentication, for local development or on a network that already authenticates callers.
107
101
108
102
Registration is static. Restart the gateway after adding, removing, or changing an interceptor. See [Gateway Configuration](/reference/gateway-config#gateway-interceptors) for the complete field reference.
109
103
@@ -176,6 +170,5 @@ The gateway emits structured evaluation logs containing the interceptor name, bi
176
170
- Only explicitly allowlisted unary write RPCs are interceptable. New gateway RPCs are non-interceptable until added to the allowlist.
177
171
-`current_state` is available only in the `validate` contract. The gateway does not yet populate it with method-specific state.
178
172
- Registration changes require a gateway restart.
179
-
- mTLS client authentication, service health checks, runtime registration, and overlapping signing-key rotation are not available.
180
-
- Extension tokens and sandbox-to-gateway tokens are signed by the same key, separated by audience and `typ`. The extension credential path cannot yet be rotated or revoked independently of sandbox admission.
173
+
- Service health checks and runtime registration are not available. [Extension Authentication](/extensibility/extension-authentication#current-limitations) lists authentication limitations.
181
174
- Interceptors cannot receive or mutate protobuf fields marked secret.
OpenShell lets you add custom checks and transformations to sandbox traffic and gateway API operations. You can use these extensions to connect your organization's content checks, policy rules, or audit services to OpenShell.
11
+
OpenShell has several extension points that let you connect your own services and runtimes without changing OpenShell. Choose an extension point based on what you need to control, then implement the shared extension protocol that every extension service uses.
12
12
13
-
Choose an extension based on what you need to control. Supervisor middleware handles network traffic between an agent and external services. Gateway interceptors handle selected API operations that create or change OpenShell resources. You can use both in the same deployment.
13
+
## Extension Protocol
14
14
15
-
## Supervisor middleware
15
+
Before OpenShell uses an extension service, both peers exchange their protocol version and supported capabilities. This lets OpenShell and your service detect incompatible versions at startup instead of failing on live traffic. [Extension Protocol Negotiation](/extensibility/extension-negotiation) describes the metadata to exchange and the version-skew policy.
16
16
17
-
Use supervisor middleware when you need to check the content an agent sends or receives. For example, you might redact recognized API tokens from outgoing requests, block prohibited content, or remove sensitive content from an HTTP response before the agent sees it.
17
+
Extension services reachable over the network also need to know that a call comes from your OpenShell gateway. [Extension Authentication](/extensibility/extension-authentication) describes the tokens OpenShell attaches and how your service validates them.
18
18
19
-
Middleware runs in the sandbox's network request and response flow. You select destination hosts in sandbox policy and choose a built-in implementation or a service you operate.
19
+
## Extension Points
20
20
21
-
Start with [Supervisor Middleware](/extensibility/supervisor-middleware) to learn how it works and choose a setup or protocol guide.
Use gateway interceptors when you need to enforce rules on how people and applications manage OpenShell resources. For example, you might apply an approved policy to new sandboxes, reject unauthorized policy changes, or report completed operations to an audit service.
25
+
Check or change the content an agent sends and receives over the network, such as redacting API tokens from outgoing requests or blocking prohibited content.
26
+
</Card>
26
27
27
-
Interceptors run as external services that the gateway calls for selected API operations. They can modify or reject an operation before it takes effect, or observe it after it succeeds.
Start with [Gateway Interceptors](/extensibility/gateway-interceptors) to choose operations and connect an interceptor service.
30
+
Enforce rules on how people and applications manage OpenShell resources, such as applying an approved policy to new sandboxes or auditing completed operations.
0 commit comments