You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tasks have no network access on current Agent Substrate because ax never creates an egress policy #449
On Agent Substrate v0.2.0 and later, an actor can't open outbound connections until it has an egress policy. ax never creates one, and there's nothing on a Task or Workspace that would let you ask for one, so every task ends up with no network at all. Anything that calls a model API, clones a repo at runtime, or installs a package just hangs or fails.
Before the September restructure, the Gateway resource took care of this (see #350). Since it was removed there's no way to do it through ax.
Example (Agent Substrate v0.3.0, ax main at ac23328, agentgateway egress dataplane):
$ kubectl ate create egress-policy net-test -a default -f policy.yaml
That works for a one-off test, but it means a second tool, access to the Substrate API, and remembering to do it for every task after its actor exists.
Suggested fix
Add an optional egress section to TaskSpec (or to Workspace, if it's meant to be shared): a list of allowed hostnames and ports. Have the reconciler call CreateActorEgressPolicy right after EnsureActor, before the first resume. Since tasks are immutable, create-only is enough.
Two Substrate details we ran into, in case they help whoever picks this up. On v0.3.0, tlsPassthrough rules are accepted but ignored by the gateway; that's fixed on Substrate main in 6c75a41f. Use https rules on v0.3.0. Also, the default Envoy egress dataplane didn't forward allowed TLS traffic for us, while the agentgateway dataplane did.
It follows the fix suggested above. spec.egress on the Task lists the connections the task may open, as rules with one protocol each, http, https, or tls, with hostnames and optional ports; a rule without ports gets the default port of its protocol. The controller writes the rules to the actor's egress policy right after EnsureActor and before the first resume, which is the window that the suspended-by-default creation already provides, so the policy is in place before the task's first request. Tasks are immutable, so the policy is created once. The API server validates the section at apply time, as it validates names, and a task without spec.egress behaves as before. A refused policy fails the task with EgressPolicyFailed; an unavailable Substrate leaves it pending. Credential injection is left to #475, and the server flag for a default policy is left out so the change stays small; both build on this field.
make test passes with new tests for the validation, the mapping, the order of the calls, and the failures, and go mod tidy is clean. I ran it on a single-node k3s cluster with Agent Substrate v0.4.0. tasks created with spec.egress got their policies before their first resume, including child tasks that a running task created through the API with the same section, and an end-to-end suite that depends on task networking passed on top of it.
Pull requests are limited to collaborators, so I cannot open one. If this is wanted, a maintainer can pick the branch up as is, or grant me access and I will open the pull request. I have already signed a CLA.
Thanks @bdubs00, this is a solid change. #499 is a draft that adds egress to the API too, so let's line the two up before opening a PR, so we land one shape.
Fixed: the Gateway resource configures the actor's EgressPolicy (#567, #585, #588).
We are closing this as part of a cleanup after the significant changes in v0.4.0, because it is probably obsolete or out of scope now. If you think this is a mistake, please reopen it (or leave a comment if you can't reopen it).
Activity
feat: add spec.egress to Task and create the actor's egress policy
bdubs00 commentedon Oct 18, 2026
I have a change for this on my fork, ready for review: main...bdubs00:ax:feat/task-egress-policy
It follows the fix suggested above.
spec.egresson the Task lists the connections the task may open, as rules with one protocol each,http,https, ortls, withhostnamesand optionalports; a rule without ports gets the default port of its protocol. The controller writes the rules to the actor's egress policy right afterEnsureActorand before the first resume, which is the window that the suspended-by-default creation already provides, so the policy is in place before the task's first request. Tasks are immutable, so the policy is created once. The API server validates the section at apply time, as it validates names, and a task withoutspec.egressbehaves as before. A refused policy fails the task withEgressPolicyFailed; an unavailable Substrate leaves it pending. Credential injection is left to #475, and the server flag for a default policy is left out so the change stays small; both build on this field.make testpasses with new tests for the validation, the mapping, the order of the calls, and the failures, andgo mod tidyis clean. I ran it on a single-node k3s cluster with Agent Substrate v0.4.0. tasks created withspec.egressgot their policies before their first resume, including child tasks that a running task created through the API with the same section, and an end-to-end suite that depends on task networking passed on top of it.Pull requests are limited to collaborators, so I cannot open one. If this is wanted, a maintainer can pick the branch up as is, or grant me access and I will open the pull request. I have already signed a CLA.
mayawang commentedon Oct 19, 2026
Thanks @bdubs00, this is a solid change. #499 is a draft that adds egress to the API too, so let's line the two up before opening a PR, so we land one shape.
Apply each atespace's egress policy to its task actors
Apply each atespace's egress policy to its task actors
feat(api): shape spec.egress as a host list, lined up with google#499
feat(api): add egress, secret-backed env vars, and SecretStore to the…
rakyll commentedon Nov 25, 2026
Fixed: the Gateway resource configures the actor's EgressPolicy (#567, #585, #588).
We are closing this as part of a cleanup after the significant changes in v0.4.0, because it is probably obsolete or out of scope now. If you think this is a mistake, please reopen it (or leave a comment if you can't reopen it).