Skip to content

feat: add AGX microVM SSH-lease provider#351

Open
zozo123 wants to merge 2 commits into
openclaw:mainfrom
zozo123:feat/agx-provider
Open

feat: add AGX microVM SSH-lease provider#351
zozo123 wants to merge 2 commits into
openclaw:mainfrom
zozo123:feat/agx-provider

Conversation

@zozo123

@zozo123 zozo123 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds provider: agx for direct AGX Linux microVM leases, closing #341.

AGX exposes fast-booting microVMs over a workspace SSH gateway — ssh <user>+<instance>@workspace.agx.so ("if it can ssh, it can work on AGX"). That maps to an SSH-lease backend (ProviderKindSSHLease), so core keeps ownership of slugs, per-repo claims, per-lease SSH keys, rsync sync, command streaming, and list/status rendering, while the adapter owns only the AGX control-plane instance lifecycle and per-lease key registration.

Built to mirror the existing self-contained SSH-lease sandbox providers (Sprites/Morph): in-package API client, core helper reuse, and label-based ownership.

What's included

  • internal/providers/agx/: provider.go (registration + Spec), backend.go (Acquire/Resolve/List/Doctor/ReleaseLease/Touch/Cleanup + flags), client.go (control-plane client), core.go (core helper wrappers), and backend_test.go.
  • Registration in internal/providers/all/all.go.
  • AGXConfig config surface (env → file → flags). The API key is read only from the environment (CRABBOX_AGX_API_KEY / AGX_API_KEY / AGX_TOKEN), never persisted to config or placed on argv, per AGENTS.md.
  • Docs: docs/providers/agx.md, docs/providers/provider-metadata.json, regenerated docs/providers/README.md matrix, root README provider table, docs/source-map.md, and a CHANGELOG entry.

Capabilities

FeatureSSH, FeatureCrabboxSync, FeatureCleanup; Linux only; CoordinatorNever. --class, --type, and --tailscale are rejected. Conservative feature set on purpose — no over-claimed native checkpoint/fork surfaces.

Config / secret implications

Var Purpose
CRABBOX_AGX_API_KEY / AGX_API_KEY / AGX_TOKEN control-plane API key (env only)
--agx-api-url / --agx-workspace / --agx-user / --agx-work-root / --agx-region / --agx-image provider flags

Early-access caveat

AGX ships Summer 2026 and does not publish a stable control-plane contract yet. The /v1/instances lifecycle API modeled here is provisional and overridable via --agx-api-url / --agx-workspace; the SSH transport follows AGX's documented <user>+<instance>@<workspace> shape. Flagging for maintainer review since the original issue is tagged needs-product-decision — happy to adjust the auth/lifecycle contract to whatever AGX publishes.

Verification

gofmt -l internal/providers/agx
go vet ./...
go test -count=1 ./internal/cli ./internal/providers/...
go test -race ./internal/providers/agx ./internal/providers/all
bash scripts/check-docs.sh   # command docs, provider matrix, links, docs site

All pass; tests use a stubbed HTTP transport and run without live credentials.

🤖 Generated with Claude Code

Add `provider: agx` for direct AGX (https://www.agx.so) Linux microVM
leases. AGX exposes fast-booting microVMs over a workspace SSH gateway
(ssh <user>+<instance>@workspace.agx.so), so this is an SSH-lease backend:
core keeps ownership of slugs, per-repo claims, per-lease keys, rsync sync,
command streaming, and list/status rendering, while the adapter owns the
AGX control-plane instance lifecycle and key registration.

- internal/providers/agx: provider.go (registration + Spec), backend.go
  (Acquire/Resolve/List/Doctor/ReleaseLease/Touch/Cleanup + flags), client.go
  (provisional /v1/instances control-plane client), core.go (core helper
  wrappers), and fake-client tests that run without live credentials.
- Register in internal/providers/all and add an AGXConfig surface
  (env/file/flags) with the API key read only from the environment.
- Docs: docs/providers/agx.md, provider-metadata.json, regenerated provider
  matrix, README provider table, source-map, and a CHANGELOG entry.

AGX is early access (ships Summer 2026) and does not publish a stable
control-plane contract yet, so the /v1/instances API modeled here is
provisional and overridable via --agx-api-url / --agx-workspace.

Closes openclaw#341

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 14, 2026, 11:19 AM ET / 15:19 UTC.

Summary
The PR adds a built-in SSH-only AGX provider with local-claim lease tracking, AGX config/flags, provider registration, tests, and provider documentation.

Reproducibility: yes. for the review finding: source inspection of the PR head shows agxSSHTarget always sets DisableHostKeyChecking: true for the AGX workspace host. The broader provider feature still lacks live AGX reproduction evidence.

Review metrics: 3 noteworthy metrics.

  • Diff surface: 12 files changed, +815/-3. This is a full provider addition spanning code, config, docs, metadata, and tests, so proof and trust checks matter before merge.
  • New provider surface: 1 provider, 3 AGX config fields, 3 AGX flags. The PR creates a new user-selectable provider and persistent configuration surface.
  • SSH trust change: 1 new SSH target disables host-key checking. The provider’s main runtime path changes SSH trust behavior for the AGX workspace gateway.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Remove or explicitly justify the AGX host-key bypass with maintainer-approved trust handling.
  • Attach redacted terminal output, logs, screenshot, or recording from a real AGX warmup/status/run/stop flow.
  • Update the PR body so it matches the SSH-only current head instead of the removed REST/API-key design.

Proof guidance:

  • [P1] Needs real behavior proof before merge: No after-fix live AGX proof is present; add redacted terminal output, logs, screenshot, or recording for warmup/status/run/stop, then update the PR body so ClawSweeper re-reviews or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] No redacted live AGX proof is present for the real workspace SSH gateway, BYO-key authentication, provisioning-on-connect, command execution, or local-only release flow.
  • [P1] The linked provider request is still labeled as needing product decision, and the current PR comment says provisioning lifecycle/key registration remains inferred until AGX early access opens.
  • [P1] The PR body still describes the removed REST/API-key/Cleanup implementation, so maintainers could review or release against stale provider-contract claims unless it is updated before merge.

Maintainer options:

  1. Fix SSH trust and prove live AGX (recommended)
    Remove the unconditional host-key bypass or replace it with a maintainer-approved trust model, update the stale PR body, and attach redacted live AGX warmup/status/run/stop proof before merge.
  2. Pause for provider-contract approval
    Maintainers can pause this PR until AGX early access confirms the SSH provisioning, key-registration, and local-only release contract.
  3. Accept the provisional provider knowingly
    Maintainers may intentionally accept the early-access AGX limitations, but the SSH trust issue and missing live proof should be explicitly owned first.

Next step before merge

  • [P1] Human follow-up is needed because the PR requires contributor-provided live AGX proof and maintainer approval for the provider contract, even though the host-key finding itself is mechanically fixable.

Security
Needs attention: The current diff disables SSH host-key checking for the AGX gateway while relying on user-managed SSH credentials.

Review findings

  • [P1] Preserve host-key verification for AGX SSH — internal/providers/agx/backend.go:272
Review details

Best possible solution:

Land AGX only after maintainers approve the built-in SSH-only provider contract, host-key handling is safe, the PR body matches the current head, and redacted live AGX proof shows the real lease flow.

Do we have a high-confidence way to reproduce the issue?

Yes for the review finding: source inspection of the PR head shows agxSSHTarget always sets DisableHostKeyChecking: true for the AGX workspace host. The broader provider feature still lacks live AGX reproduction evidence.

Is this the best way to solve the issue?

No, not yet. The SSH-only provider shape is plausible, but merge-ready implementation should preserve normal SSH host-key protections or use an explicit maintainer-approved trust model, plus product approval and live provider proof.

Full review comments:

  • [P1] Preserve host-key verification for AGX SSH — internal/providers/agx/backend.go:272
    agxSSHTarget always disables host-key checking for workspace.agx.so, but this provider authenticates with the operator's own AGX-registered SSH key and has no per-lease gateway trust bootstrap. That makes the first real AGX connection accept any host claiming to be the workspace gateway, so the provider should use normal known-host verification or an explicit, reviewed trust model before merge.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d3d1891aafa7.

Label changes

Label changes:

  • add merge-risk: 🚨 security-boundary: The new provider disables SSH host-key checking for the AGX gateway while using the operator's own SSH key.

Label justifications:

  • P2: This is a substantive new provider integration with limited blast radius and no existing-user regression shown.
  • merge-risk: 🚨 auth-provider: The PR adds provider authentication and routing behavior for AGX that remains unproven against the real service.
  • merge-risk: 🚨 security-boundary: The new provider disables SSH host-key checking for the AGX gateway while using the operator's own SSH key.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: No after-fix live AGX proof is present; add redacted terminal output, logs, screenshot, or recording for warmup/status/run/stop, then update the PR body so ClawSweeper re-reviews or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

Security concerns:

  • [medium] AGX SSH gateway skips host-key verification — internal/providers/agx/backend.go:272
    The provider sets DisableHostKeyChecking: true for the workspace gateway, so users cannot rely on standard SSH known-host verification when using their AGX-registered key.
    Confidence: 0.86

What I checked:

  • AGENTS policy read and applied: AGENTS.md was read fully; its provider-neutral architecture, secret-handling, generated-output, and full-reference guidance affected this provider review. (AGENTS.md:11, d3d1891aafa7)
  • AGX target disables SSH host-key checks: The PR-head AGX SSH target sets DisableHostKeyChecking to true for the workspace gateway. (internal/providers/agx/backend.go:272, 9101cd51d253)
  • Core SSH behavior for that flag: When DisableHostKeyChecking is true, Crabbox passes StrictHostKeyChecking=no and UserKnownHostsFile=/dev/null instead of accept-new with a known_hosts file. (internal/cli/ssh.go:535, d3d1891aafa7)
  • AGX docs describe BYO SSH key auth: The PR-head docs say AGX uses the operator's own AGX-registered SSH key and no API token, making the gateway trust decision security-sensitive. (docs/providers/agx.md:56, 9101cd51d253)
  • No live proof in PR discussion: The PR body and latest contributor comment report local/unit/docs checks only; the latest comment says live lifecycle/key-registration details remain inferred and pending product decision. (9101cd51d253)
  • Linked provider request is still product-gated: The linked AGX issue remains open and labeled needs-product-decision / needs-maintainer-review.

Likely related people:

  • steipete: Recent history touches provider registration, claim handling, coordinator/provider-adjacent work, and current release state that this PR depends on. (role: recent area contributor and merger; confidence: high; commits: d3d1891aafa7, f6b4a9765285, 71896637009c; files: internal/providers/all/all.go, internal/cli/claim.go, internal/cli/config.go)
  • coygeek: GitHub history shows many recent built-in provider additions and hardening passes across registration, config, docs, lifecycle, ownership, and live-smoke surfaces similar to AGX. (role: recent provider lifecycle contributor; confidence: high; commits: 4003a3000972, 460e241d1b71, a71c8a3a29aa; files: internal/providers/all/all.go, internal/cli/config.go, internal/providers/morph/backend.go)
  • vincentkoc: History shows claim serialization and Sprites ownership/key fixes, relevant because AGX mirrors a claim-backed SSH-lease provider shape. (role: adjacent claim and Sprites contributor; confidence: medium; commits: 3c1ca6a5311a, addb3b2dcc84, 0cfb42f3ba39; files: internal/cli/claim.go, internal/providers/sprites/backend.go)
  • zozo123: Although they authored this PR, they also appear in current-main history for prior provider work including OpenComputer, Islo, Windows Sandbox, and smolvm. (role: prior provider contributor; confidence: medium; commits: 3b92643ab361, f6ad6f84ca33, 973efedd2c87; files: internal/providers/opencomputer, internal/cli/config.go, internal/providers/smolvm)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. labels Jun 14, 2026
Research against AGX's published material (agx.so + Loophole Labs) found no
control-plane API, auth contract, or CLI — only the SSH connection shape
`ssh <user>+<instance>@workspace.agx.so` and the explicit stance "no SDK
required, no custom client — if it can ssh, it can work on AGX." The first
draft's invented /v1/instances REST client + API key contradicted that, so
this reworks the provider to commit only to the documented interface:

- Remove the REST control-plane client and API-key requirement; authenticate
  with the operator's own SSH key (cfg.SSHKey), as AGX onboarding registers it.
- Provision on connect: build the `<user>+<instance>` SSH target and wait for
  readiness; the slug is the stable instance name.
- Back List/Resolve with local lease claims and make release local-only (AGX
  reclaims idle sandboxes); drop FeatureCleanup since there is no inventory API.
- Trim AGXConfig to workspace/user/workRoot (no token/apiUrl/region/image).
- Update tests (no fake HTTP client), docs, provider metadata, and the
  regenerated matrix; document the early-access unknowns and cite Drafter.

Closes openclaw#341

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zozo123

zozo123 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Updated the provider to match AGX's published interface after checking their docs.

Research finding: AGX (agx.so) currently publishes no control-plane API, auth contract, or CLI — only the SSH connection shape ssh <user>+<instance>@workspace.agx.so and an explicit stance: "No SDK required, no custom client — if it can ssh, it can work on AGX." It ships Summer 2026 and is built on Loophole Labs' Firecracker/CRIU/Drafter stack.

Change: the first draft invented a /v1/instances REST control plane + API key, which contradicts that "no SDK / no custom client" model. This revision commits only to the documented SSH interface:

  • Removed the REST client and API-key requirement; auth uses the operator's own SSH key (cfg.SSHKey, registered with AGX during onboarding), like the Static SSH provider.
  • Provision-on-connect: build the <user>+<instance> target and wait for SSH readiness; the slug is the stable instance name.
  • List/Resolve are backed by local lease claims; release is local-only (AGX reclaims idle sandboxes). Dropped FeatureCleanup since there's no inventory API.
  • AGXConfig trimmed to workspace / user / workRoot.

Still pending a maintainer/product decision (the original issue is tagged needs-product-decision): provisioning lifecycle, key-registration, and any future management API remain inferred from the homepage because AGX hasn't published them. Happy to align to whatever AGX ships once early access opens.

Verified: gofmt, go vet ./..., go test ./internal/cli ./internal/providers/..., go test -race ./internal/providers/agx, and scripts/check-docs.sh all pass. Tests need no live credentials.

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. label Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant