Skip to content

feat(substrate): the compiled ActorTemplate carries the revision's egress policy as its default - #2942

Draft
QuentinBisson wants to merge 1 commit into
kagent-dev:mainfrom
giantswarm:upstream/actortemplate-default-egress-policy
Draft

QuentinBisson wants to merge 1 commit into
kagent-dev:mainfrom
giantswarm:upstream/actortemplate-default-egress-policy

Conversation

@QuentinBisson

@QuentinBisson QuentinBisson commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A golden Actor is created by Substrate's template reconciler, so the AgentInstance workflow never gets to create its EgressPolicy before it boots. atenet denies every request of an Actor without a policy: a template whose harness fetches Git, OCI or S3 skills or plugins during the golden boot fails with 403 and never gets its snapshot (#2604).

Change

ActorTemplateForRevision sets default_egress_policy on the compiled ActorTemplate from the revision's egress destinations and credentials, the same allowlist the workflow creates per actor; Substrate copies it onto every Actor of the template, the golden one included. The policy builder moves to the substrate package so both callers share it, and the revision digest carries an actorTemplateFormat marker so templates compiled before this change are re-created rather than conflicting. Draft until agent-substrate/substrate ships ActorTemplate.default_egress_policy (agent-substrate/substrate#1868, design agent-substrate/substrate#1324); the build fails on that field until then.

…ress policy as its default

ActorTemplateForRevision sets default_egress_policy from the revision's
egress destinations and credentials, the same allowlist the AgentInstance
workflow creates for each actor. Substrate copies it onto every actor it
creates from the template, including the golden actor the template
reconciler creates, which no client call could give a policy before it
boots: without one the golden boot is denied all egress (403) and a
workload that fetches skills or plugins before readyz never gets its
snapshot. The policy builder moves to the substrate package so both
callers share it; the workflow's EnsureActorEgressPolicy stays as the
idempotent check. The revision digest carries an actorTemplateFormat
marker so templates compiled before this change are re-created instead
of conflicting.

Depends on ActorTemplate.default_egress_policy in agent-substrate/substrate
(agent-substrate/substrate#1324).

Fixes kagent-dev#2604

Signed-off-by: QuentinBisson <quentin@giantswarm.io>
@QuentinBisson

Copy link
Copy Markdown
Contributor Author

One gap this does not close: Substrate's credential provider resolves Secrets per atespace, and the golden Actor boots in the reconciler's atespace (ate-golden), not the AgentTemplate's namespace. Until Substrate lets the template name the atespace its golden Actor inherits from, an installation must grant ate-golden the same namespaces as the agents' atespace, or the injected credentials do not resolve during the golden boot.

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant