ConfigHub · Durable config for coding agents
Docs / examples/walkthroughs/story-34-google-ax-durable-config.md Source on GitHub →

Durable Config & Cloud Hub Gateway Fencing for Google AX Sandboxes

Google AX (google/ax) runs autonomous coding agents inside sandboxed Workspace pods with snapshot/suspend/resume/fork and an egress-fencing Gateway. ConfigHub plugs underneath AX with zero forks to google/ax across four progressive layers: pre-warm the ~4.8 MB MIT Zero-Hub Linux plugin during Workspace.spec.setup so snapshots keep hooks across ax suspend → ax resume, keep live secrets off /workspace via Gateway header injection to a Cloud/VPC Hub, capture diffs on teardown via cub env exec --mode test --capture, and govern ax.io/v1alpha1 manifests themselves as a ConfigHub Component.

Quick start

You need: the MIT ConfigHub plugin (Zero Hub v0.99.48+) and the four ax.io/v1alpha1 reference manifests (no google/ax fork required).

By handAsk your agent
Layer A: Pre-warm Zero Hub in WorkspaceAdd Workspace.spec.setup.files (.claude/settings.json) + setup.commands downloading SHA-256-verified confighub-linux-<arch>.gz (step 1)"Write an ax.io/v1alpha1 Workspace manifest that pre-warms ConfigHub Zero Hub (v0.99.48) in /workspace with zero Postgres per pod."
Layer B: Host sandbox captureRun cub env exec --mode test --capture with GOOGLE_AX_HANDOFF_CAPTURE=true (step 2)"Wrap the AX sandbox launch in cub env exec --mode test --capture so live keys stay out and winning config diffs flush on SIGTERM."
Layer C: Cloud Hub Gateway fencingAllow egress only to hub.confighub.com and inject the scoped token via effects.replaceHeaders (step 3)"Create an AX Gateway manifest that injects the scoped ConfigHub token outside /workspace and blocks all other egress."
Layer D: Govern AX manifests as a ComponentPackage Workspace, Gateway, and Model under base → staging → live (step 4)"Put our ax.io/v1alpha1 Workspace, Gateway, and Model manifests under ConfigHub so widening egress or changing a model requires cub inbox approve."

Without ConfigHub: AX owns ephemeral task and trajectory memory inside a workspace, while operational config across base/staging/live, host drift, and cryptographic human production approvals need a durable control plane that outlives tasks and clusters.

Deeper dive

Show the full walkthrough

Human

What you need

  • The MIT ConfigHub plugin (Zero Hub v0.99.48+)
  • Optional: ax CLI + a Kubernetes/kind cluster for live Workspace/Gateway execution, and a Cloud or VPC Hub (hub.confighub.com or self-hosted Helm)

Steps

  1. Layer A — Pre-warm Zero Hub inside Workspace.spec.setup (persists across ax suspend → ax resume → ax fork): Because AX snapshots /workspace after Workspace.spec.setup, downloading and SHA-256-verifying the ~4.8 MB MIT Linux binary once during setup means runtime Tasks need zero GitHub egress and zero Postgres per pod:
    mkdir -p ~/ax-confighub-demo && cd ~/ax-confighub-demo
    cat > workspace-zero-hub.yaml <<'EOF'
    apiVersion: ax.io/v1alpha1
    kind: Workspace
    metadata:
      name: checkout-zero-hub
    spec:
      image: ghcr.io/google/ax-workspace-base:latest
      setup:
        gatewayRef: setup-github-only
        files:
          - path: .claude/settings.json
            content: |
              {
                "env": {
                  "CUB_MINI_MODE": "team",
                  "CUB_MINI_RECORD_IN_REPO": "1",
                  "CUB_MINI_CHANGES_DIR": "/workspace/.confighub/agent-changes"
                }
              }
        commands:
          - |
            set -euo pipefail
            ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
            BASE="https://github.com/confighubai/confighub-mini-plugin/releases/download/v0.99.48"
            mkdir -p /workspace/.confighub/bin
            curl -fsSL "$BASE/SHA256SUMS" -o /tmp/SHA256SUMS
            curl -fsSL "$BASE/confighub-linux-${ARCH}.gz" -o "/workspace/.confighub/bin/confighub-linux-${ARCH}.gz"
            (cd /workspace/.confighub/bin && grep "confighub-linux-${ARCH}.gz" /tmp/SHA256SUMS | sha256sum -c -)
            rm -f /tmp/SHA256SUMS
    EOF
    cat workspace-zero-hub.yaml
  2. Layer B — Launch with cub env exec --mode test --capture: When driving disposable AX runs from a developer laptop or CI runner, wrap execution with cub env exec so live credentials never enter the sandbox and tuned config diffs capture cleanly before teardown:
    cd ~/ax-confighub-demo
    printf 'GOOGLE_AX_SANDBOX_MODE=test\nGOOGLE_AX_MAX_STEPS=50\nGOOGLE_AX_TIMEOUT_SECONDS=300\nGOOGLE_AX_HANDOFF_CAPTURE=true\n' > .env.ax
    cub env exec --mode test --no-pull --file .env.ax -- sh -c 'cat .env.ax'
  3. Layer C — Fence Cloud / VPC Hub access through an AX Gateway (zero tokens on /workspace): The agent sends a placeholder Authorization header; the AX Gateway replaces it outside the sandbox from credentialUri, allowing egress only to your ConfigHub hostname:
    cd ~/ax-confighub-demo
    cat > gateway-cloud-hub.yaml <<'EOF'
    apiVersion: ax.io/v1alpha1
    kind: Gateway
    metadata:
      name: confighub-cloud-hub
    spec:
      defaultAction: deny
      rules:
        - name: allow-confighub-api
          match:
            hosts: ["hub.confighub.com"]
            ports: [443]
          action: allow
          effects:
            replaceHeaders:
              Authorization:
                credentialUri: "secret://confighub/ax-worker-nonprod-token"
    EOF
    cat gateway-cloud-hub.yaml
  4. Layer D — Package Workspace, Gateway, and Model as a ConfigHub Component (base → staging → live): When platform engineers update the base workspace image digest, every team keeps its own resource limits automatically, while widening a Gateway egress host list or changing a Model in live triggers a ConfigHub ChangeOrder requiring cub inbox approve.
  5. Verify both ax.io/v1alpha1 manifests are ready before applying to an AX cluster:
    cd ~/ax-confighub-demo
    grep -q "sha256sum -c" workspace-zero-hub.yaml && grep -q "replaceHeaders" gateway-cloud-hub.yaml && echo "Google AX Zero-Hub + Gateway manifests verified"

Undo it

Delete ~/ax-confighub-demo. Nothing was applied to a cluster or remote hub.

Agent

When running inside or configuring Google AX with ConfigHub:

  • Never embed Local Hub (cub-server, Apple Silicon macOS only) or PostgreSQL inside a Linux AX Workspace pod; use the MIT Zero-Hub binary in /workspace and connect to a Cloud or VPC Hub through an AX Gateway.
  • Keep the memory boundary explicit: AX owns ephemeral task and trajectory memory; ConfigHub owns structured base/staging/live operational config, per-value reasons, OCI bundles, and human approvals.
  • Never place live ConfigHub admin tokens inside Workspace.spec.setup.files; inject scoped worker tokens exclusively via Gateway replaceHeaders.

Testing

Author the Google AX Workspace (pre-warmed Zero Hub v0.99.48) and Gateway (Cloud Hub replaceHeaders fencing) manifests in ~/ax-confighub-demo and verify cub env exec --mode test executes with test-mode AX env variables.

This proves: Google AX workspaces pre-warm Zero Hub once in spec.setup, preserve config hooks across suspend/resume/fork with zero Postgres per pod, and reach Cloud/VPC Hub through Gateway header injection with no live token on /workspace.