Skip to main content
This recipe launches an isolated Linux Sandbox with:
  • Default-deny outbound networking (allowInternetAccess: false) that only permits requests to your allowlisted API domain.
  • Encrypted Vault injection (vault) so a specific command receives API_TOKEN without persisting plaintext secrets to disk.
  • File upload and artifact download using sandbox.files.
Required API key scopes: sandboxes.create, sandboxes.read, sandboxes.stop, secrets.use.

Prerequisites

  • HYPERBROWSER_API_KEY exported in your shell and a pre-created vault named ci-secrets exposing API_TOKEN.
  • @hyperbrowser/sdk (TypeScript), hyperbrowser (Python), or the hx CLI installed.

Run Locked-Down Code in a Sandbox

Expected output

  • Prints Exit code: 0 Output: {"status":200} after the sandboxed Node process reaches https://api.example.com/health using the injected API_TOKEN while all other outbound destinations remain blocked.
  • Stops the sandbox cleanly in finally (or via hx vm stop).

Next Steps

  • Network Policies — live egress updates, CIDR rules, and domain allowlists.
  • Vaults — group secrets and manage customer-managed key wrapping.