Skip to main content
This guide gets Claude Code talking to Anthropic from a Gravix Layer runtime. If you already opened a shell and saw:
you are in the right place. Gravix sandboxes block outbound traffic by default. Claude is installed; it just cannot reach the API until you attach a network policy (and provide ANTHROPIC_API_KEY).

Prerequisites

End-to-end: create, smoke-test, clean up

One script creates an Identity provider, an allowlist for api.anthropic.com, a Claude runtime, runs a headless prompt, then tears down.
Identity secrets are injected for run_cmd / run_code. They are not automatically present in an interactive SSH / runtime shell session. Pass env_vars at create time (as above) or export ANTHROPIC_API_KEY=... inside the shell.

Interactive shell

After create (keep the runtime alive):
Inside the sandbox:
You should get the Claude Code TUI, not ETIMEDOUT.

Extra allowlist hosts (optional)

For a first smoke test only, you can use egress_mode="allow_all" / --egress-mode allow_all, then tighten. See Network policies.

Troubleshooting

Next steps