Repository navigation
Support native OpenShell policy evaluation with an Envoy-owned HTTP data plane #4975
DahuK
started this conversation in
Design Discussion
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
User Story
We are evaluating OpenShell's native policies for agent sandboxes in an environment where Envoy must remain responsible for HTTP/TLS processing, routing, and upstream connections.
We want to author and review policies in OpenShell's existing format, and reuse its native evaluation semantics rather than translate them into a separate policy language or maintain a second evaluator in Go. We are prepared to use a trusted workload-side backend for process attribution and isolation; we are not asking an HTTP filter to replace those controls.
The workflow we need is: apply an OpenShell policy, associate it with an authenticated sandbox, and have Envoy enforce decisions produced by OpenShell's native implementation for the supported HTTP traffic.
Problem Statement
OpenShell exposes useful policy and L7 evaluation APIs, but the complete request-processing behavior remains coupled to the supervisor's proxy path. That behavior includes normalization, hard denials, trusted identity/TOFU checks, policy generation, and the ordering of request transformations and credential handling.
It is not clear how an external HTTP data plane can reuse this behavior as a supported integration without either reproducing parts of it or delegating business proxy ownership back to the supervisor. A bare allow/deny call does not describe the transport checks the external data plane must still perform.
Impact / Why This Matters
An independently implemented evaluator can drift on defaults, overlapping rules, path normalization, audit versus hard-deny behavior, or policy updates. Sharing only policy types or Rego text does not eliminate those risks.
Keeping the standard supervisor in the business traffic path is a valid alternative, but it retains proxy and upstream-connection responsibilities that this use case needs Envoy to own. The issue is that ownership split, not simply the cost of running another service.
A supported reuse path could let OpenShell retain one policy implementation while integrators take responsibility for the external transport and its enforcement guarantees.
Proposed Design
We would like to agree on a supported boundary for native policy execution with an external HTTP transport. A shared Rust execution interface, also consumed by the standard supervisor, is one possible approach. We are open to an existing extension point or another shape if it provides the same guarantees.
The intended user workflow is:
ext_procadapter is one candidate for this integration; the supported interface should be agreed with maintainers.An illustrative existing policy for the first integration slice would be:
This is not new syntax and has not been executed as an Envoy integration. Expected decisions would preserve native identity and ancestor-matching semantics: admitted identities may use the native read-only methods; writes and identities with no matching executable or ancestor are denied.
Two boundaries need explicit agreement:
ext_procalone does not prove the actual resolved upstream address or TLS peer. The integration must bind checks to the actual connection attempt, including retries and connection reuse, rather than perform an unrelated DNS lookup.For an initial slice, bounded REST/HTTP requests would be sufficient. Unsupported upgrades, arbitrary TCP, unbounded streaming, and unsupported middleware/provider requirements should be explicitly rejected. We are not requesting complete protocol parity in the first change, changes to native policy semantics, or relaxation of sandbox confirmation requirements.
Acceptance Criteria
Alternatives Considered
Related Work and Agent Investigation
The source investigation used commit
c4688aa8715ea75d6c39fe468361dbbc16c691fa; current main should be rechecked before implementation.OpaEngine::authorize_egressandevaluate_l7_requestare public entry points. Surrounding hard-deny handling and supplied-identity validation show why calling a matcher alone is insufficient.No complete native-versus-Envoy integration has been tested in this investigation, and no acceptance criterion above is claimed as completed.
Questions for Maintainers
If the direction is supported, a next step could be a bounded prototype and a thin Rust adapter with shared tests, rather than a large refactor or a new general-purpose policy service in the first PR.
All reactions