v2 egress: default-allow mitmproxy gateway + account-level managed deploy keys + auth-token/provider reconcile - #345
Conversation
Keep the smart runtimeManifestUrlEnv() (controlPlane.manifestUrl -> sourcePath -> env) from the auth-token fix; drop the gateway branch's env-only duplicate that shadowed it and tripped TS1117. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Paired hosted PR: Clawdi-AI/clawdi-hosted#722 (invisible gateway image + single-key mint + launch alerting). Merge coordinated — deploy image + CLI together, after the integrated-code dev-CVM e2e is green. |
Self code-review (final integrated form) — no blocking findingsReviewed the merged diff (not just sub-branches), risk-weighted on the security core: invisible-gateway.ts — fail-closed verified: egress boot (clawdi-runtime-egress-common) — early-drop guard and the full gateway use the SAME table name → the CLI's full apply atomically upgrades the boot drop-all-agent table into the full ruleset. No coexistence (no double-drop of redirected traffic), no window: fail-closed from t=0 through converge. UID derived from Prior review coverage (holds in final form): managed key sidecar-only (root:600, out of agent env — placeholder only), sidecar verifies upstream TLS + never logs the key, proxy-env removed from the hosted path (local Verification: biome ci (598 files) clean; turbo typecheck 4/4; 201 CLI tests; adversarial security review (1 critical + 2 high fixed, Residual (non-blocking): DNS→resolver is an accepted+documented exfil path (fast-follow allowlist for untrusted signup). Verdict: approve — merge after the in-flight integrated-code dev-CVM e2e is green (BYOK rebind + both-runtime matrix + Telegram pairing), coordinated with clawdi-hosted#722. |
Reworked: fail-closed invisible gateway → default-allow mitmproxy (validated end-to-end)The egress interception was over-engineered (nftables fail-closed default-DROP + hand-rolled Go MITM sidecar). Owner redesigned it to default-allow + profile-driven transparent MITM via runtime-fetched mitmproxy, plus a corrected deploy-key model. What changed here (clawdi = CLI + cloud-api):
Validated (full live e2e, correct harness — local cloud-api + cloudflared tunnel, dev CVM runs only the agent pod, managed AI → faraday TEST): managed AI OpenClaw+Hermes (Faraday usage 301/303), channels {OpenClaw,Hermes}×{Telegram,Discord} + Telegram+Discord concurrent, Discord WSS passthrough, default-allow (real upstream cert), BYOK passthrough, security (secrets absent from agent env; sidecar secret+CA unreadable by clawdi; logs redacted), degraded (kill mitmdump → default-allow, no billing bypass), restart resume, CLI self-upgrade reconcile, account-level managed key (managed=true env_id=NULL; user can't list/revoke; admin can), perf ~50MB/s. All PASS. 🤖 Generated with Claude Code |
The account-level managed deploy-key work added an environment_id query param to list_channels + the managed key field; regenerate the committed TS client so the generated-api CI gate + downstream typecheck pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Go MITM sidecar was deleted; remove the setup-go / go test / sidecar bundle build + verify steps from client-ci and cli-publish so the CLI test + publish jobs stop referencing packages/cli/native/mitm-sidecar/go.mod. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 2026-07-08 transport research doc still described the deleted Go-sidecar + forward-proxy-env model (9 dead file:line cites to native/mitm-sidecar/*). Mark it SUPERSEDED with a banner pointing at the current source of truth (mitmproxy addon + transparent-mitm.ts) and fix managed-runtime.md's stale native-sidecar row + proxy-env paragraph to the default-allow transparent nft-redirect model (CA-trust env only, no proxy env injection). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
clawdi's doc convention is plain kebab-case, no date in the filename (designs/, plans/, scenarios/, top-level arch docs; ADRs use a numeric prefix). Three docs used a trailing date (one also ALL-CAPS) — the anomaly. Drop the date suffix + lowercase; switch the transport doc banner to the guide's documented HISTORICAL form (agent-docs-guide.md). No inbound links referenced the old names. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 'keeps hosted managed provider key out of the agent env' test predated the managed_by classifier (isClawdiManagedProviderProjection = managed_by === 'clawdi', emitted by cloud-api as n:'clawdi'). Its inline provider omitted the field, so the fixture was classified BYOK instead of managed and never exercised the placeholder path — OPENAI_API_KEY came out undefined. Add managed_by:'clawdi' so the fixture matches the real cloud-api contract: the agent env gets the placeholder while the real key stays out. Prior CI runs on this branch were cancelled mid-flight, so this real failure only surfaced on the first uninterrupted run. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ships the default-allow transparent mitmproxy egress gateway + account-level managed provider key handling merged in #345. beta.37 predates that merge, so v2 hosted runtimes tracking the clawdi@beta dist-tag need a new beta to pick up the gateway at runtime (the image stays stable; the CLI is runtime-installed). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
CLI-side of the v2 hosted Invisible Gateway launch batch, plus the clean auth-token lifecycle and provider-projection reconcile. Pairs with the clawdi-hosted PR (invisible gateway image + single-key mint + launch alerting) — merge coordinated.
What's in it
invisible-gateway.ts(nftablesmeta skuidREDIRECT, default-DROP fail-closed, atomicnft -f, ct-mark matched redirect), transparent sidecar (mitm-sidecar/main.go: SO_ORIGINAL_DST, upstream TLS verified, secret by-ref, no key logging). Removes proxy-env from the hosted path (localclawdi runkeeps its per-run forward proxy). Managed key is sidecar-only (agent env gets a placeholder; real key never in agent env).<runRoot>/secrets/auth-token, env-first-then-file; watch unit bound to the manifest URL fromcontrolPlane.manifestUrl.source.authretained (tolerated) for CLI self-upgrade version-skew.net.isIPfor address validation.Validation
bun run check(biome ci, 598 files): cleanbun run typecheck(turbo, all packages): 4/4 passbun testruntime + invisible-gateway + mitm-env + mitm-profiles + ai-provider + run: 201 pass / 0 failflush rulesetscope), 1 test-bug; re-validated on dev CVM (direct_leaks=0across bypass / sidecar-restart / CLI-self-upgrade)In-flight (not blocking review)
Full integrated-code prod-shape e2e on dev CVM is running (BYOK rebind resolution + both-runtime function matrix + Telegram pairing). Recommend merge after that e2e is green.
Owner-decided: ONE deploy key per compute (single-key), aligns with the single canonical CLAWDI_AUTH_TOKEN.
🤖 Generated with Claude Code