Skip to content

feat: add reusable egress policies for agents and sandboxes - #3177

Draft
EItanya wants to merge 2 commits into
mainfrom
feat/agent-egress-policies
Draft

EItanya wants to merge 2 commits into
mainfrom
feat/agent-egress-policies

Conversation

@EItanya

@EItanya EItanya commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

This PR adds reusable EgressPolicy resources so agents and standalone sandboxes can install dependencies or call APIs beyond their inferred model, MCP, and artifact access.

Agent and SandboxTemplate select policies through spec.egressPolicyRefs in the same namespace. Policies grant HTTP(S) origins, including wildcard reachability. Authentication uses one header, optional literal prefix, and Secret reference:

authentication:
  header: Authorization
  prefix: "Bearer "
  secretKeyRef:
    name: ticket-auth
    key: token

Credential injection requires an exact HTTPS origin. The gateway replaces a client-supplied placeholder header, and Secret values stay out of runtime revisions. Conflicting explicit and inferred credentials fail preparation.

Resolved grants are pinned to each revision and installed before the Actor resumes. Policy edits affect newly prepared revisions; they do not revoke existing sessions or sandboxes. The namespace is the sharing boundary for policies and credentials.

Includes CRDs, clients, Helm packaging, controller dependencies, UI preservation of policy refs, and usage/lifecycle documentation. Stored credential bindings now include scheme and port, so this assumes a clean install; old hostname-only bindings are rejected.

Validation: CRD generation and Kubernetes admission tests, translator/egress/Substrate and controller tests, PostgreSQL and lifecycle race tests, Go lint, UI typecheck, and changed-file ESLint passed. Live E2E coverage is added but has not run because KAGENT_E2E_API_URL is unset.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@github-actions github-actions Bot added the enhancement New feature or request label Oct 13, 2026
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@blacksmith-sh

blacksmith-sh Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
TestSessionEgressPolicyPinsAdditionalDestinations View Logs
github.com/kagent-dev/kagent/go/core/test/e2e/
TestSessionEgressPolicyPinsAdditionalDestinations
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request work-in-progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant