Skip to content

docs(rfc): propose the external network enforcer and native-network mode (RFC 0029) - #6117

Open
Gal-Zaidman wants to merge 1 commit into
ai-openshell:mainfrom
Gal-Zaidman:docs/external-enforcer-rfc/Gal-Zaidman
Open

Gal-Zaidman wants to merge 1 commit into
ai-openshell:mainfrom
Gal-Zaidman:docs/external-enforcer-rfc/Gal-Zaidman

Conversation

@Gal-Zaidman

@Gal-Zaidman Gal-Zaidman commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Propose RFC 0029, which lets an external policy enforcer enforce a Kubernetes sandbox's network policy and inject its provider credentials instead of the supervisor. Sandboxes it serves run in native-network mode, and the gateway keeps the agent from running until the enforcer has accepted the sandbox's configuration.

Related Issue

Closes #6024. The implementation follows in a separate PR, behind the experimental feature.

Changes

  • Define native-network mode, selected by the Kubernetes driver's external_enforcer table: the agent's traffic leaves on the network interface the enforcer owns, without the supervisor's egress proxy or policy DNS.
  • Connect the enforcer to the gateway on the SupervisorHost stream with its own role and token. It reads configuration and provider environment through the existing supervisor RPCs and reports what it enforces with ReportSandboxConfiguration.
  • Keep the supervisor and enforcer in step: hold a generation's agent until the enforcer accepts it, hold credential installs the enforcer hasn't accepted, and make a policy revision current only once both sides apply it.
  • List the deployment guarantees the mode depends on, and optional node shards for enforcers that each serve a subset of nodes.
  • Amend RFC 0012 to admit native-network mode as the one exception to egress mediation, and add an open question about a native-network conformance profile.
  • Lay out an implementation plan that ships the mode behind the experimental feature until it runs end to end, plus risks, alternatives, and prior art.

Release Notes

Testing

  • mise run markdown:lint passes, including Mermaid validation.
  • git diff --check passes.
  • Unit tests added/updated (not applicable: RFC only)
  • E2E tests added/updated (not applicable: RFC only)

Checklist

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

@Gal-Zaidman
Gal-Zaidman force-pushed the docs/external-enforcer-rfc/Gal-Zaidman branch from ee28621 to 5d5d245 Compare December 1, 2026 08:03
@Gal-Zaidman Gal-Zaidman changed the title docs(rfc): propose the external network enforcer and native-network mode docs(rfc): propose the external network enforcer and native-network mode (RFC 0029) Dec 1, 2026
RFC 0029 lets an external enforcer enforce a native-network sandbox's
network policy and inject its credentials. It connects to the gateway as
a supervisor host in an enforcer role, reads configuration and provider
environment through the supervisor RPCs, and acknowledges with
ReportSandboxConfiguration. The gateway holds a generation's agent until
the enforcer accepts it, holds credential rotations until the enforcer
has them, and makes a policy revision current once both sides apply it.

The Kubernetes driver selects the mode with an external_enforcer table,
and RFC 0012 admits it as the one exception to egress mediation.

Signed-off-by: Gal Zaidman <gzaidman@nvidia.com>
that meets the requirements, including a supervisor Pod replacement and the
loss of the replica holding a node's shard.

## Risks

@drew drew Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In this proposal, we offload/circumvent every networking feature that OpenShell provides. I think we need to better articulate the associated risk with this. For example, we lose the following features (and this is just off the top of my head)

  • credential injection
  • ocsf logs
  • sub agents
  • policy proposals
  • middleware

For every new network feature we bring to OpenShell, we also will need to consider if new hooks will need to get built so these external enforcers can integrate (similar to what is being requested for policy). I worry this will make OpenShell hard to maintain.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The external enforcer fulfil the role of the supervisor enforcement layer so it receives everything the supervisor receives in this regard therefore it should have everything it needs without adding additional hooks into openshell - this is why I choose to extend the supervisor service instead of creating an additional one.
So I don't think the would add maintainability issues to openshell, but for sure an external enforce would need to declare compatibility for openshell versions and features.

It is true that with great power comes great responsibility, as the first risk in the list say "external policy enforcer is trusted. OpenShell trusts it to implement the network controls the supervisor implements in stock mode", and since the external enforcer is not shipped by openshell core, but from an external 3rd party, the 3rd party should document to its users any limitations it has, compatibility for openshell versions and feature and so on.

Gateway interceptors[1] can be a means for an external enforcer to "Block" capabilities he doesn't support.
I tried to outline the requirements from the external enforcer here[2] to make it clear it now has the responsibility, but feel free to suggest additions if you think it is too minimal.

I can rephrase section[2] to indicate responsibility list.
I can also add in the implementation PR or a follow up one, a dedicated doc for entorcer integration

[1] https://github.com/ai-openshell/openshell/pull/6117/changes#diff-c7bf652934dd9164c3b6d723b9ffb4f69a9cee02a67bd34b53cdb6f27d12746dR71
[2] https://github.com/ai-openshell/openshell/pull/6117/changes#diff-c7bf652934dd9164c3b6d723b9ffb4f69a9cee02a67bd34b53cdb6f27d12746dR260

fails launches until the recovery timeout. The debug guide shows how to
check a Pod's network status.

## Alternatives

@drew drew Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not consider middleware? Middleware is exactly intended to provide a hook for external network enforcement systems.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Middleware was considered, and middleware should still work with external policy enforcer (it should declare middleware which were registered to it), but it cannot be the mechanics to integrate an external enforcer.

The main reasons it doesn't fit is that the goal is to have a different enforcement point on the wire to enforce the policy on, not an additional one, the traffic need to go directly to the enforcer and not through the openshell supervisor.
As the first sentence states "Let an external policy enforcer, instead of the supervisor, enforce a sandbox's network policy and inject its credentials."

A detailed list of reasons:
1.Middleware require the agent traffic to first flow through the supervisor, not directly to the external enforcer interface, meaning:
1.1. Every connection would still leave from the supervisor's address, the motivation is that an enforcer on the wire then sees one source for every sandbox on a node
1.2. Breaks the “native network mode”, the sandbox process still need to pass all the traffic to the supervisor instead of the traffic going natively out of an interface the external enforcer controls and monitors without the kernel hooks which exist today to force the traffic to go in a certain way.
2.Middlewares come on top of supervisor enforcement, not instead of it:
2.1 The supervisor calls middleware after its own policy check and before forwarding
2.2. The enforcer would be duplicating the supervisor's enforcement, which is what deployments want to avoid
3.Middlewares are called by the supervisor not the gateway, if the policy is enforced by a non openshell component, it is better to have the policy and credentials to come a component which doesn’t have interaction with the sandbox - this creates a true Zero Trust use case
4.It only covers part of the traffic, Middleware sees only HTTP requests, HTTP responses and outgoing WebSocket text messages that the proxy has TLS-terminated and parsed, it can't see L4 connection decisions, DNS, UDP, raw TCP, tls: skip, h2c or passthrough - an enforcer has to see every packet of every protocol and drop everything else;

sandbox's effective policy and credentials, and OpenShell needs to know the
external policy enforcer applied them before the agent runs, to prevent the
agent from running unenforced. OpenShell has no way to hand either to an
external component today.

@drew drew Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we give some concrete examples of these product that would offload? Today, we can offload policy enforcement to external providers using middleware.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can add a section on NVIDIA Senty as a concrete example


The mode requires a shared supervisor topology of [RFC
0018](../0018-multi-sandbox-ha-supervisors/README.md) and
`config_delivery_mode = "poll"`; the gateway refuses to start otherwise. In

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we'll be deprecating the polling configuration delivery mode in 0.2.0.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can modify it to push, just wanted to define one way of doing things and personally poll seems easier to me :)
thanks for the feedback

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(k8s): propose the external network enforcer and native-network mode (RFC 0029)

2 participants