Skip to content
←Back to Open Source

OPEN SOURCE DEEP DIVE

Agent HarnessAgent RuntimeSandboxOrchestration

AX (Agent Executor): Declarative Agent Runtime

Google's Apache-2.0 orchestrator that declares agent work as Task, Workspace, Model and Gateway manifests, runs each task in an Agent Substrate sandbox with checkpoint/resume, and keeps credentials outside the sandbox via egress injection. Reviewed at v0.4.0-rc.2.

google/ax15kGoApache-2.012 min read

AX (Agent Executor) is Google's open agentic orchestration runtime: a declarative control plane that runs autonomous agent workloads as sandboxed cluster tasks. It is written in Go, licensed Apache-2.0, and built on top of Agent Substrate, which supplies the isolation, checkpointing and worker placement underneath. The repository was created on 2026-03-30 and had about 15.1k stars and 832 forks when this review was written on 2026-12-04, at commit 9a59797c23ba3c05b48af401508cc9804b7618a0 and release v0.4.0-rc.2. The README carries an explicit warning that core concepts, protocols and specifications are still being refined and will likely see major breaking changes before a stable release, so everything below describes a moving target.

The pitch is deliberately Kubernetes-shaped. You declare an agentic task with workspaces and model specifications; AX sandboxes it, wires up its workspace, and helps run it at scale — the README's stated ambition is millions of tasks per cluster. If you have used kubectl, the ax CLI will feel familiar: apply, get, describe, delete, plus agent-specific verbs such as suspend, resume, ssh and promote.

Four kinds, one manifest language

Everything is expressed as ax.io/v1alpha1 manifests in four kinds, and every resource lives in an atespace (default default). A Task is the smallest unit of isolated execution: container image, command, compute limits, environment, an optional goal text, and an optional binding to one Workspace. A Workspace makes the tedious part of agent setup declarative and done once — git repositories cloned at named refs, static files such as an AGENTS.md, MCP servers and registries, and skill registries — then binds to as many tasks as need it. A Model declares which provider and model identifier the platform itself uses, with sampling parameters and a reference to a Kubernetes Secret holding the credential; only the google provider is supported for now. A Gateway lists the external traffic a task may send; anything matching no rule is refused.

The README's worked example shows the shape: a Workspace named golang whose profile pins an agent image by digest and whose setup clones golang/go at a branch and writes an AGENTS.md with house rules, then a Task named test that binds that workspace, states a goal in plain text, and sets debug: true so ax ssh can attach. Applying it is one command:

ax apply -f task.yaml
ax resume task test
ax describe task test
ax ssh test -- ls -al /workspace

Names and atespaces become Substrate resource names, so they must be lowercase RFC 1123 labels; ax apply rejects anything else up front. Server-assigned fields (uid, timestamps, status) are ignored in manifests, which means the output of ax get can be re-applied as is.

Why PostgreSQL instead of etcd

DESIGN.md gives the storage rationale plainly: storing millions of short-lived tasks as Kubernetes CRDs pushes etcd past its comfort zone — single-digit gigabyte storage limits, write-rate bottlenecks, control-plane degradation. AX therefore keeps its state in PostgreSQL as protojson documents, alongside the leases that back its distributed locks. Lock waiters poll; nothing depends on LISTEN/NOTIFY, so any connection pooler works. The bundled manifest runs a single-instance StatefulSet with a persistent volume, and ax-server creates missing tables at startup; there are no versioned migrations yet.

The more interesting decision is what AX refuses to store. The store holds only what AX owns: specs, metadata, and the parts of a task's status describing AX's own work such as workspace setup. Everything belonging to the task's actor — its state, the actor reference, the Ready condition, and status.actorUid — is read live from Agent Substrate on every get or list, so AX never keeps a copy that can drift from the actor. Storage sits behind store.Store and lock.Locker interfaces, and the split lives in a handful of helpers in internal/server/server.go so storage implementations never need to know about Substrate.

AX control plane: ax CLI talks to ax-server over gRPC; ax-server persists specs and locks in PostgreSQL and reconciles with Agent Substrate, which runs each task actor in a sandbox containing ax-runner, the workspace, a loopback metadata server, probes and optional guest services
Three binaries, two stores of truth. ax-server owns specs and locks in PostgreSQL; actor state is read live from Agent Substrate. Inside each sandbox, ax-runner is PID 1 and prepares the workspace before the agent command starts.

The task lifecycle: suspended by default

A newly applied task does not run. ax apply provisions the Substrate ActorTemplate and Actor in the Suspended phase (Ready=False, reason Suspended) without executing spec.commands; ax resume starts or restores the sandbox and waits for WorkspaceReady and then Ready. The first resume also waits for workspace initialization — cloning git repos — so it can take a while, and if the CLI gives up first the task keeps coming up in the background. ax suspend checkpoints the sandbox back to Suspended; the /workspace volume is what survives, restored into a fresh container with a new process tree on the next resume. ax delete tears the sandbox down and blocks until that completes. A task whose actor no longer exists has no state at all: its Ready condition explains why, and it cannot be suspended or resumed — delete it and create it again.

Two profile rules deserve attention because they change both cost and security posture. Images must be pinned by digest; a tag-only reference is rejected when the ActorTemplate is created, because a moving tag would silently invalidate the actor's snapshots. And profile selection operates on the whole Profile object, not field-by-field merging: a task that omits spec.profile inherits the Workspace's profile and starts from its pre-warmed snapshot, while a task that sets its own profile uses it as-is and cold-boots its own workspace setup if it differs from the Workspace's. Unset limits in an explicit profile default to 1 CPU and 512Mi, never to the Workspace's values.

Task lifecycle: ax apply creates a Suspended task; ax resume moves it to Running once the workspace is ready; ax suspend checkpoints it back to Suspended; resuming restores the snapshot into a fresh container
Suspend and resume are checkpoint operations, not process signals. ax ssh requires spec.debug: true; a crashed or missing actor leaves no state, only a Ready condition explaining why.

The runner contract inside the sandbox

AX never runs spec.commands as the container entrypoint. Every task container starts /opt/ax/ax-runner, mounted read-only from a runner volume image, so the image you name needs no AX binaries. The control plane then pushes the work over HTTP on port 80: POST /runner/v1alpha1/task carries the Task YAML plus the bound Workspace YAML on every resume, and POST /runner/v1alpha1/setup carries the Workspace to setup actors that prepare a snapshot once and are then suspended. The runner answers 202 when it accepts work, 200 when it already holds the same object, 409 for different work, 400 for an undecodable body; anything else is retried until timeout, because a task that was never pushed is not running.

The default runner bootstraps the workspace, starts and supervises the command, and keeps serving after the command exits so the metadata server and ax ssh stay available; the exit code is logged. On stop or suspend it sends the command's process group SIGTERM, waits ten seconds, then kills what remains. Readiness is explicit: /readyz?check=workspace returns 503 while setup runs, 200 once clones, MCP config and skills are in place and the command has started, and 500 with the reason when setup failed. The agent can introspect its own configuration without any SDK through a loopback-only metadata server at $AX_METADATA_URL (default 127.0.0.1:8099), and reads AX_WORKSPACE and AX_SESSION_ID from its environment. Outbound TLS trust is handled for it: the runner points SSL_CERT_FILE, CURL_CA_BUNDLE, REQUESTS_CA_BUNDLE, NODE_EXTRA_CA_CERTS and GIT_SSL_CAINFO at the egress trust bundle when present, and gives git a placeholder askpass program so a Gateway rule can supply real credentials. It deliberately sets no API-key variables, because many tools choose a provider by which key variable happens to be set.

Customization has three levels, and the docs advise picking the shallowest one that solves the problem: extend the default image with your tools; embed the public runner Go package in your own image; or replace the runner entirely behind your own Substrate ActorTemplate, honoring the same port-80 contract. Runner-specific settings travel in spec.config, a free-form object the control plane passes through unchanged, bounded at 16 KiB with the whole encoded task bounded at 31 KiB.

Egress default-deny, and credentials the agent never sees

A Gateway is an allowlist. Each spec.egress entry is a Substrate EgressRule setting exactly one of http, https or tlsPassthrough, with lowercase DNS hostnames where a wildcard stands for the whole leftmost label only. ax apply rejects a bare *, IP addresses, and localhost names; tlsPassthrough requires explicit ports and forwards TLS without decryption, so a protocol that starts in cleartext and upgrades (PostgreSQL's, for instance) does not match. HTTPS rules are intercepted by the egress gateway so effects can be applied per request.

The effect that matters for agent safety is replaceHeaders. The task sends a header with any placeholder value — the docs' example sets ANTHROPIC_API_KEY=placeholder in spec.env so the tool bothers to send the header at all — and the gateway, outside the sandbox, replaces that value with the credential named by credentialUri. The agent never holds the key. Credentials resolve through a provider registered with Substrate; the bundled Kubernetes provider reads ate-secret://k8s.io/<namespace>/<secret>/<key> and denies by default until a cluster admin grants the task's atespace that namespace in the k8s-credential-provider-namespace-policy ConfigMap, optionally limited to Secrets carrying given labels. A header can instead take actorJwt, injecting a short-lived JWT that identifies the task. Two caveats are stated rather than hidden: every host a wildcard matches receives the credential, and on a cleartext http rule the credential leaves the gateway unencrypted.

Credential injection: the agent inside the sandbox sends a placeholder header; the egress gateway matches the hostname rule and replaces the header with a credential resolved from a Kubernetes Secret; the destination receives the real key while the agent never sees it
Secrets stay outside the sandbox. The egress gateway swaps placeholder headers for real credentials per hostname rule; unmatched traffic is refused outright.

From a local Kind cluster to GKE, unchanged

ax local start brings up a Kind cluster named ax-local with Agent Substrate and AX in about three minutes, downloading kind and kubectl into ~/.ax/bin if absent. It needs a rootful Docker or Podman whose host runs Linux kernel 6.8+ with at least 4 GiB RAM (6 recommended); on macOS the docs point at OrbStack, Docker Desktop or Colima. Local task images must be public because the local cluster has no registry credentials. The same manifests then apply unchanged to a remote cluster via ax ctx and ax install, which expects Kubernetes 1.36+ (GKE 1.37+) with ClusterTrustBundle and PodCertificateRequest enabled, Substrate v1.0.0 in ate-system with a gVisor WorkerPool and a snapshot location, and a default StorageClass. ax promote task <name> --to <context> copies a task and its bindings to another cluster and resumes it there; it does not copy sandbox state or the Secrets a Gateway names, and --preflight-only shows what it would do.

The CLI follows your active Kubernetes context, so kubectx switches work as-is, and it maintains background tunnels per context under ~/.ax/tunnels. Tasks get no Service or Ingress of their own: every request reaches them through Substrate's atenet router via a single ate-target-actor: <atespace>/<task> header, which resumes a suspended actor before proxying. For people who prefer a UI, AX Studio is a separate local app, and prebuilt agent images such as Antigravity are published from agentexecutor/images with complete Gateway and Task manifests in each README.

What AX deliberately does not do yet

The boundaries are as informative as the features. A session in AX is only a correlation ID: spec.sessionId defaults to the task's server-assigned uid, travels to the runner as AX_SESSION_ID, and is never validated for relatedness or ordering. AX stores no session history or state — bringing session storage is up to you, and the roadmap lists persisted sessions and cross-task memory as future work. Likewise on the roadmap rather than in the tree: token/timeout budgets and approval policies on Task, an Agent specification and mid-run steering protocols, SPIFFE workload identities with mutual TLS, idleness detection with automatic suspension for cluster density, shared warm workspaces, and task forking that copies checkpointed memory and filesystem state for speculative execution. Telemetry today covers ax-server logs, metrics, traces and events with OpenTelemetry export; automatic agent-trajectory collection at the runner layer is still planned.

The division of labor with Substrate is stated as orthogonality: Substrate is low-opinion about agentic abstractions and owns isolation, checkpoint/restore, worker placement, routing and egress; AX owns the declarative layer and aims to grow into a portable agentic platform covering session management, memory, multi-task coordination, input steering, registries, models and trajectory collection — running the same way inside Google, on customer clusters, and on-prem. Whether that platform arrives is exactly what the pre-stable warning says is not yet promised.

Reading the repo

The layout matches the architecture: cmd/ax, cmd/ax-server and cmd/ax-runner for the three binaries; pkg/apis/v1alpha1 holding the proto sources, generated Go types and the YAML codec; internal/substrate as the only client of the Substrate Control API; internal/store with memory and PostgreSQL backends; internal/workspace for setup; internal/metadata and internal/guest for the in-sandbox surfaces; and a public Go client under client/, still alpha. CI runs make verify (generate, tidy, fmt, golangci-lint — any diff fails), builds the three binaries and runs go test ./..., with Kind-based E2E tiers that self-skip unless AX_E2E=true. The repo even ships an agent skill, skills/substrate/SKILL.md, documenting module pins and the Control API wrapper for agents working on the code. Code is Apache-2.0; the axolotl mascot "axel" in assets/ is dual-licensed Apache-2.0 or CC-BY-4.0 and designed by Nan Hockin.

Related Projects

NousResearch/hermes-agentMIT

Hermes Agent: the open-source agent that turns self-improvement into a closed learning loop

The self-improving agent from Nous Research (248k+ stars). Its learning loop has five mechanisms: periodic memory nudges, autonomous skill creation after tasks, skills that self-improve in use, FTS5 session search with LLM summarization, and Honcho user modeling. One TUI, seven terminal backends (local/Docker/SSH/Singularity/Modal/Daytona/Vercel Sandbox), six chat platforms from a single gateway, no model lock-in. It doubles as a trajectory data-production apparatus. Self-improvement is falsifiable and no controlled experiment has been run, so this is graded as needing reproduction.

Agent HarnessSelf-Improving Agents
deepseek-ai/deepseek-harnessMIT

DeepSeek Harness: the open-source agent runtime where everything is a plugin

DeepSeek AI's open-source agent harness (CLI dsh, MIT, 233k+ stars). The kernel provides only plugin-system semantics; tools, surfaces and model access all attach as plugins, on top of Cordis' paradigm for spatiotemporal composability (arXiv:2608.25512). It is in developer preview with an explicit warning about compatibility-breaking changes, and SAFETY.md is required reading before you run it. Not benchmarked yet, so this entry is graded as needing reproduction.

Agent HarnessPlugin Architecture
earendil-works/piMIT

Pi: a layered agent harness monorepo

Pi Agent Harness (formerly badlogic/pi-mono; 108k+ stars, MIT/TypeScript). Not one CLI but layered packages usable on their own: pi-coding-agent (interactive coding agent), pi-agent-core (runtime with tool calling and state), pi-ai (unified multi-provider LLM API), plus chord composition runtime, pi-telemetry contracts, pi-durable persistence and pi-tui differential terminal rendering. The README states plainly that there is no built-in permission system and offers micro-VM / Docker / sandbox paths instead. Not independently benchmarked; graded needs-reproduction.

Agent HarnessCoding Agent
JuliusBrussee/cavemanNOASSERTION

Caveman: The Token-Cutting Skill, Proxy and Middleware for Coding Agents

A MIT rule file makes agents talk like cavemen (code and errors never shortened), a local Go proxy compresses what agents read before each call with byte-exact originals recoverable, and middleware brings the same to your own app. JetBrains' 86-task A/B: -8.5% output tokens, quality flat; the repo's pinned 54-run suite: -33.2% input tokens, 18/18 checks passed.

Token OptimizationAgent Harness

As an Amazon Associate, we earn from qualifying purchases.