Skip to content

Inject the environment key via Substrate egress; upgrade to Substrate head - #23

Merged
luiz-anthropic merged 1 commit into
mainfrom
creds
Oct 22, 2026
Merged

luiz-anthropic merged 1 commit into
mainfrom
creds

Conversation

@rakyll

@rakyll Jaana Dogan (rakyll) commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Move the Anthropic environment key out of the sandbox, upgrade to
go.ate.dev/substrate main (ab4f3dbec79b), and adapt the controller,
manifests, and benchmark stack to its authorization and mTLS changes.

Environment key injection

  • Actors no longer hold ANTHROPIC_ENVIRONMENT_KEY. They send a placeholder
    bearer token. Each actor's egress policy tells the Substrate egress gateway
    to replace it on requests to the Anthropic API with the key from the
    ate-ant-creds Secret (ate-secret://k8s.io/...). Other traffic stays open
    so tools keep working.
  • The ActorTemplate mounts the gateway's MITM/system-roots trust bundle and
    points SSL_CERT_FILE at it.
  • ate-ant manifest labels ate-ant-creds and emits the Kubernetes Secrets
    credential provider's namespace policy, which grants the ate-ant atespace
    access to that Secret only.

Substrate upgrade (github.com/agent-substrate/substrate v0.5.0 ->
go.ate.dev/substrate v0.5.1-0.20261022032710-ab4f3dbec79b)

  • Rewrite imports for the new module path; update all other dependencies.
  • ActorTemplate: drop the removed sandbox_config (the WorkerPool's
    sandboxClasses selects the class) and set the now-required per-actor
    resource limits (1 CPU / 1 GiB).
  • The gVisor worker image is now ateworker-gvisor.

Authorization (ate-api now authorizes every call)

  • The controller runs as a new router-client ServiceAccount. The benchmark
    installs an atespace access policy granting it editor, and viewer to a new
    ate-ant-dashboard ServiceAccount (benchmarks/access-policy.sh).
  • EnsureAtespace looks the atespace up before creating it: CreateAtespace
    needs global owner and is denied even when the atespace exists.

atenet-router mTLS

  • The router now accepts only HTTPS from allowlisted SPIFFE IDs. /work and
    /idle requests use mTLS (internal/actor/router.go): the controller
    presents its projected podidentity certificate and verifies the router
    against the servicedns trust bundle, re-reading both on every handshake
    since the kubelet rotates them in place.
  • New controller flags: --router-client-cert, --router-ca-file,
    --router-server-name. The default router address is now
    https://atenet-router.ate-system.svc:443.
  • Loadgen direct mode and its runner pod use the same identity and mounts.

anthropic-sdk-go v1.84

  • Replace the deprecated UnrestrictedPaths, which now fails every tool call
    (bash included), with AllowedRoots ["/"]; the gVisor sandbox remains the
    security boundary. Add a regression test that runs the bash tool.

Benchmarks and docs

  • build-images.sh builds ateworker-gvisor with ate-setup publish worker-images from a git worktree at the Substrate version pinned in
    go.mod (Substrate no longer has a Makefile, and the module cache lacks
    hack/tools).
  • install.sh registers the ActorTemplate with kubectl-ate --preview
    (PerTemplateSnapshotLocation) and applies the access policy.
  • Redesign the benchmark dashboard: frontend moved to embedded web/ files,
    dark and light themes, sparklines, an activity chart with hover, an
    actor-state breakdown, and a filterable actor table.
  • Update image digests, README, and AGENTS.md redeploy steps.

@rakyll
Jaana Dogan (rakyll) force-pushed the creds branch 5 times, most recently from 077f97a to 58def25 Compare October 22, 2026 05:20
@wiz-alphabet

wiz-alphabet Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total -

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio.

Comment thread internal/actor/router.go Resolved
@rakyll
Jaana Dogan (rakyll) force-pushed the creds branch 2 times, most recently from 206bc55 to 1044f8a Compare October 22, 2026 05:48
@rakyll Jaana Dogan (rakyll) changed the title Inject the Anthropic environment key via Substrate egress Inject the environment key via Substrate egress; upgrade to Substrate head Oct 22, 2026
@rakyll

Copy link
Copy Markdown
Collaborator Author

The preview of the built-in dashboard (if needed) is below:

Screenshot 2026-10-21 at 10 50 13 PM

@rakyll
Jaana Dogan (rakyll) force-pushed the creds branch 8 times, most recently from 2715041 to af21b02 Compare October 22, 2026 06:53
Sandbox actors no longer hold the Anthropic environment key. The
ActorTemplate sets ANTHROPIC_ENVIRONMENT_KEY to a placeholder, and the
Substrate egress gateway replaces the worker's "Authorization: Bearer
<placeholder>" header with the real key from the ate-ant-creds Secret on
requests to the Anthropic API. The key never enters the actor's
environment, memory, or snapshots.

- Upgrade github.com/agent-substrate/substrate to v0.5.0 and port the
  manifests to its API (WorkerPool sandboxClasses, WakeupProbe,
  SnapshotConfig.preferredFidelity, string sandbox class). Drop the
  dashboard's worker IP and paused states, which v0.5.0 removed.
- ActorTemplate: mount a systemInfo trust bundle (egress-mitm.ate.dev
  and system-roots.ate.dev) and point SSL_CERT_FILE at it, so the actor
  trusts the gateway's intercepted TLS.
- Controller: give each actor an egress policy with an intercepting
  https (or http) rule for the Anthropic base URL host that injects the
  key from an ate-secret:// URI. Other traffic stays open: http on port
  80, and TLS passthrough on all ports. A failure to create the policy
  now fails the resume instead of only logging a warning. Add
  --environment-key-credential-uri to override the default URI.
- ate-ant manifest: label ate-ant-creds with
  ate-ant.dev/egress-credential=true, and emit the
  k8s-credential-provider-namespace-policy ConfigMap in ate-system,
  granting the atespace only that labeled Secret.

The cluster must run Substrate v0.5.0 installed with
--credential-provider='{"name":"k8s.io"}'. After applying the
manifests, restart deployment/k8s-credential-provider in ate-system so
it loads the policy. Actors created before this change keep their old
egress policy and must be recreated.
@rakyll
Jaana Dogan (rakyll) marked this pull request as ready for review October 22, 2026 06:55
@luiz-anthropic
luiz-anthropic merged commit ec6a3dd into main Oct 22, 2026
11 checks passed
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.

2 participants