Repository navigation
feat: add reusable egress policies for agents and sandboxes - #3177
Conversation
This comment has been minimized.
This comment has been minimized.
| // validCredentialHeader excludes routing, framing, hop-by-hop and cookie headers. | ||
| func validCredentialHeader(header string) bool { | ||
| if len(header) > 256 || !httpguts.ValidHeaderFieldName(header) { | ||
| return false | ||
| } | ||
| switch strings.ToLower(header) { | ||
| case "host", "connection", "content-length", "transfer-encoding", "te", "trailer", "upgrade", "keep-alive", "proxy-authorization", "proxy-authenticate", "cookie": | ||
| return false | ||
| } | ||
| return true | ||
| } |
There was a problem hiding this comment.
This applies now to the RemoteMCPServer.spec.headersFrom[].name field. Maybe we could add the CEL rule to validate this into the CRD. WDYT?
BTW, this breaks existing RemoteMCPServer objects that use any of the not allowed headers, so let's make sure this is released as a breaking change (PR title, PR description, etc).
d99e039 to
f112f42
Compare
This comment has been minimized.
This comment has been minimized.
codyhartsook
left a comment
There was a problem hiding this comment.
🤖 AI-generated review.
a004c76 to
a1875b6
Compare
a1875b6 to
f0fe942
Compare
|
Thanks, this is what we need for per-agent egress. Would you accept a bare |
Makes sense, let's do a follow-up |
f0fe942 to
5d6a8d1
Compare
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
…edits Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Use a revision-keyed workqueue to serialize publication and replay changes received during an in-flight write. Keep startup actor recovery separate, and require a persisted policy before the store promotes a revision. Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Recover offline Agent deletions through preparation instead of a finalizer. Hash compiled runtime inputs while retaining full source provenance, and keep source actor queries inline in the store. Allow credentials on exact HTTP origins and exercise delivery with a plain HTTP origin, removing shared gateway configuration changes from the e2e fixture. Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Resolve policies independently and retain still-requested last-good grants when additions conflict. Filter only incompatible grants for older revisions, expose EgressPoliciesApplied on Agents and SandboxTemplates, and bound deleted-Agent recovery to retained instances. Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
c8fec1c to
61288e3
Compare
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
This PR adds reusable
EgressPolicyresources for HTTP(S) access beyond an agent's inferred model, MCP, and artifact access.AgentandSandboxTemplateselect policies throughspec.egressPolicyRefsin the same namespace. Authentication uses a header, optional literal prefix, and Secret key reference:The elected Agent and SandboxTemplate reconcilers resolve policies from cached Kubernetes inputs and persist grants on the source definition. Effective policy merges those grants with a revision's pinned integration access when read. Create, resume, and checkpoint forks use that persisted state without translating Kubernetes inputs. Explicit grants stay outside the revision hash.
Every preparation applies persisted policy to the source's running and suspended actors across retained revisions, with at most 16 updates in parallel. Unchanged policies skip the Substrate write. Failures retry through the existing preparation queue, and startup replays every source. Slow actor updates therefore delay that preparation queue. Source finalizers preserve deletion through controller downtime and remain until actor revocation succeeds. Substrate version preconditions order competing applications, and creation rechecks policy after applying it so concurrent updates are not missed. Convergence remains asynchronous.
New instances can use the latest successful runtime revision while edits are pending or failed. Grants continue updating even when a Harness, template, or WorkerPool cannot be resolved. Missing or invalid policies revoke explicit grants while preserving pinned integration access. Recreating a source does not transfer grants to its old instances. Conflicts with pinned credentials, token passthrough origins, or the merged rule limit withhold explicit grants and emit warnings.
Credential injection requires an exact HTTPS origin, and Secret values stay out of runtime revisions. Includes CRDs, clients, Helm packaging, and API and lifecycle documentation.
E2E coverage uses the same OCI skill and shell probe through kagent, Codex, Claude, and BYO Go ADK. It checks live grant/revocation, creation from the last successful revision, resume, and checkpoint forks. A separate HTTPS scenario checks actual Secret header replacement, with and without a prefix. Standalone sandboxes have lifecycle coverage through their process API.
Validation: the full Go test suite with the race detector, PostgreSQL store and migration tests (including inline SQL preparation), and Go lint passed locally. Runtime E2E validation for this refactor is pending CI; the available local cluster uses the old API.