# OpenClaw-style MCP agents with an X-API-Key header: PASS

Run date: 2026-10-12 (UTC). Endpoint: `https://api.sbx.agent-next.com/mcp/v1`. Client: OpenClaw 2026.10.2, installed with its official installer in a fresh default-template sandbox. Model: GLM 5.3 through the gateway (`openclaw onboard --non-interactive --auth-choice custom-api-key ...`), turns run with `openclaw agent --local`. The key was read in-process and never printed or logged.
Setup text: the live [For agents page](https://sbx.agent-next.com/docs/agents/#client-openclaw), OpenClaw section, header path.
Not covered: the OAuth path and the `sbx` CLI path.

## Flow

| step | result |
| --- | --- |
| `openclaw mcp set sandbox '{...}'` from the page | PASS: saved and probed at once, `sandbox: 9 tools` |
| `openclaw mcp probe sandbox` | PASS |
| `openclaw mcp doctor` | `sandbox: ok`, with the literal-key warning the page mentions |
| session A: create, `echo ok; exit 3`, write and read `/tmp/hello.txt`, `ls -l /tmp`, `python3 -m http.server 8000` in the background, preview URL, no kill | PASS: exit code 3 and `ok`; file content `hi`; an external fetch of the preview URL returned HTTP 200; an independent MCP read returned `hi`; PID 1 is `tini`, 0 zombies |
| session B: `sandbox_kill` twice | PASS: `killed: true`, then `already_gone: true`; the preview URL then returned 502 |

## Residue (zero)

- The key's sandbox list was 0 at the end.
- `openclaw mcp unset sandbox` removes the server, but OpenClaw keeps copies of its config as `~/.openclaw/openclaw.json.bak*` and they held the key. After `rm -f ~/.openclaw/openclaw.json.bak*` a scan of the home directory, `/tmp` and `/dev/shm` found nothing except the test harness's own key file, which went away when the sandbox was destroyed. The page now says so.
