Skip to content

feat(agents): egressPolicyRefs and list_egress_policies - #242

Merged
teemow merged 2 commits into
mainfrom
egress-policy-refs
Oct 22, 2026
Merged

teemow merged 2 commits into
mainfrom
egress-policy-refs

Conversation

@teemow

@teemow teemow commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Problem

An agent can select kagent's namespaced EgressPolicy objects through Agent.spec.egressPolicyRefs, and the agent chart 2.3.0 renders agent.egressPolicyRefs into it (giantswarm/agent#104), but agent-manager's create_agent, update_agent, validate_agent and get_agent take and return only egress origins, so neither the portal nor an MCP caller can pick a policy (giantswarm/giantswarm#38744).

Proposed solution

  • egressPolicyRefs (a list of names) on create_agent, update_agent (replaces the list, [] clears it) and validate_agent, and the REST API; written to agent.egressPolicyRefs; get_agent returns them from the Agent's spec.egressPolicyRefs (the values while nothing is rendered).
  • Two checks of agent-manager's own: a name with no EgressPolicy in the agent's namespace, read as the caller, is refused (naming the entry and the valid ones); any entry on a coding Harness is refused beside the origin guard, also on a move to a coding Harness. The CRD's limits (at most 16, unique, non-empty) are the dry-run's answer.
  • New read-only list_egress_policies (GET /api/v1/egresspolicies): a namespace's EgressPolicies as the caller, each origin with its credential header's name; never the Secret. get_info reports the capability egressPolicies.
  • The embedded fallback chart is the agent chart 2.3.0. The ServiceAccount's Role (serviceAccount identity only) reads egresspolicies.

Acceptance criteria

  • Unit tests: create, validate, update and get carry the refs; the rendered Agent carries spec.egressPolicyRefs; unknown names, a namespace without policies and a coding Harness are refused; list_egress_policies reports origins and header names and no Secret; REST route.
  • agentlab proof (agentlab-2, agent-platform 4.157.1, dev image of this branch through platform.devImages, the agent chart 2.3.1 from the registry), as Organization-namespace users, neither a platform admin: in org-eg38744, dev@lab.local bound agent-platform:editor, the tenant-a group (alice@lab.local) agent-platform:user.
    • alice: list_egress_policies lists example (https://example.com) and iana (https://www.iana.org, credentialHeader: X-Api-Key), no Secret name.
    • dev: validate_agent and create_agent with egressPolicyRefs: [example, npm] refused: EgressPolicy "npm" does not exist in namespace org-eg38744; valid: example, iana; with [example] valid (schema 2.3.1) and created; the rendered Agent carries spec.egressPolicyRefs: [{name: example}], no spec.egress, and is Ready. update_agent to [example, iana] (changed agent.egressPolicyRefs, rendered as both refs), to [nope] refused; get_agent returns both. iana names a Secret that does not exist, and get_agent_status reports failed … EgressPolicy "org-eg38744/iana": Secret "tenant-credential-iana" not found.
    • In kagent, an agent created through agent-manager with a ref to a policy holding https://example.com: from its bash tool, https://example.com answers 200 and https://www.wikipedia.org answers 403 actor egress policy denied. Once https://www.wikipedia.org is added to the policy (the Agent's generation stays 1), a new Session reaches it with 200.
    • validate_agent on the claude Harness with a ref refused: egressPolicyRefs eg38744-example: an agent on coding Harness claude reaches its Harness's origins only ….
    • The lab was restored afterwards and platform-test was run.

@teemow
teemow requested a review from a team as a code owner October 22, 2026 12:27
@circleci-architect

circleci-architect Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Published Helm chart agent-manager

2.11.1-r7812d4fet20261022123817hfe0a372
Chart agent-manager
Version 2.11.1-r7812d4fet20261022123817hfe0a372
OCI reference oci://gsoci.azurecr.io/charts/giantswarm/agent-manager:2.11.1-r7812d4fet20261022123817hfe0a372
Digest sha256:f87275081d2d91dd27878dc32bea52d7b9fb64f905d5c38dd3549c3604ba9136
Registry public — gsoci.azurecr.io
Git catalog giantswarm-test-catalog (index)
Pull this chart
helm pull oci://gsoci.azurecr.io/charts/giantswarm/agent-manager --version 2.11.1-r7812d4fet20261022123817hfe0a372

Posted by architect-orb · build 5264 · commit fe0a372 · updated in place on every push

@teemow teemow changed the title feat(agents): pick the namespace's EgressPolicies with egressPolicyRefs, list them with list_egress_policies feat(agents): egressPolicyRefs and list_egress_policies Oct 22, 2026
@teemow
teemow merged commit 2863b0f into main Oct 22, 2026
18 checks passed
@teemow
teemow deleted the egress-policy-refs branch October 22, 2026 13:35
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.

1 participant