Overview
This example creates a Daytona sandbox with Claude Code pre-installed using the declarative image builder, and uses Oshu Vault to securely inject your Anthropic API key.Prerequisites
- Daytona account and
DAYTONA_KEYset - Oshu Vault instance running
SECRETS_PROXY_API_KEY— your proxy management API keyANTHROPIC_API_KEY— your real Anthropic key
Install Dependencies
Full Example
Declarative Image Builder
The key difference from E2B is Daytona’s declarative image builder. Instead of installing tools and uploading certificates at runtime, everything is baked into the image — including the proxy’s CA certificate:update-ca-certificates adds it to the system trust store (used by curl, wget, etc.). Node.js ignores the system store, so you still need NODE_EXTRA_CA_CERTS in envVars — but it can point to the system bundle that already contains the cert.
Daytona caches this image for 24 hours, so subsequent sandbox creations skip the build step entirely. You can also pre-build it as a named snapshot:
What’s Happening
Session created
The SDK sends your real
ANTHROPIC_API_KEY to the proxy and gets back a sealed token like SEALED_7f3a9b2c....Image built with Claude Code + trusted CA
Daytona builds a Docker image from
node:22-slim with curl, Claude Code, and the proxy CA certificate pre-installed. The cert is fetched from /v1/ca.pem and added to the system trust store via update-ca-certificates. This image is cached for reuse.Sandbox configured
The sandbox receives
ANTHROPIC_API_KEY=SEALED_7f3a9b2c... and the proxy env vars. Everything looks normal to code running inside.The sandbox never sees your real API key. The declarative image builder runs before any secrets are configured, so even the build process has no access to sensitive values.