Credential Vault is OpenSandbox’s outbound credential broker for sandboxed agents and developer tools. Real credentials are written to the egress sidecar by the host-side SDK, while the sandbox process only receives fake or empty credential values. When tools such as Claude Code, Git, curl, package managers, or model API clients make allowed outbound HTTPS requests, the sidecar matches the request against Credential Vault bindings and injects the required authentication headers on the way out. This keeps real secrets out of the sandbox environment, command line, filesystem, and logs — reducing credential exfiltration risk from prompt injection or untrusted AI-generated code.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/opensandbox-group/OpenSandbox/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
The following minimum versions are required to use Credential Vault:| Component | Minimum Version |
|---|---|
opensandbox-server | >= 0.2.0 |
egress sidecar | >= 1.1.1 |
| Python SDK | >= 0.1.11 |
| JavaScript / TypeScript SDK | >= 0.1.9 |
| Kotlin SDK | >= 1.0.13 |
| Go SDK | >= 1.0.3 |
| C# SDK | >= 0.1.3 |
- The server configuration must set
[egress].imageto a valid egress sidecar image. - The sandbox create request must include an outbound
network_policy. - The sandbox create request must enable Credential Proxy (
credentialProxy.enabled = true). - Sandbox pods must not be running with a transparent service-mesh sidecar (such as Istio/Envoy injection) in the same network namespace. Credential Vault assumes the OpenSandbox egress sidecar is the only transparent outbound interception layer in the pod.
How It Works
Credential Vault is implemented by the egress sidecar. A sandbox must be created with both an outboundnetwork_policy and Credential Proxy enabled. At a high level, the flow is:
Credentials written
The SDK writes credentials and bindings to the sidecar Credential Vault API from the host side. The sandbox process never receives the real values.
Sandbox runs with fake credentials
The sandbox process starts with fake or empty credential environment variables — for example,
ANTHROPIC_API_KEY=fake-key-inside-sandbox.Outbound HTTPS request made
When the sandbox makes an HTTPS request, transparent MITM interception in the sidecar inspects the request metadata (scheme, host, port, method, and path).
Binding matched
If exactly one binding matches the outbound request, the sidecar injects the configured authentication header before the request leaves the pod.
Service Mesh Compatibility
Auth Types
Each Credential Vault binding includes anauth rule that describes how the referenced credential is rendered into the outbound request:
| Type | Injected Header | Notes |
|---|---|---|
bearer | Authorization: Bearer <credential> | Standard OAuth / API bearer tokens |
basic | Authorization: Basic <credential> | Credential must be pre-encoded as base64(username:password) |
apiKey | <header-name>: <credential> | Credential value is placed in the configured header name |
customHeaders | Multiple headers | Each header is backed by its own named credential |
Python SDK Example
The following example creates a sandbox withcredential_proxy enabled and a network_policy that allows only api.anthropic.com and registry.npmjs.org. It then calls sandbox.credential_vault.create() to register the real API key on the sidecar and binds it to outbound requests matching the Anthropic API path.
Additional Auth Type Examples
Egress Sidecar Configuration
The egress sidecar exposes the following environment variable for Credential Vault behavior:| Environment variable | Default | Description |
|---|---|---|
OPENSANDBOX_EGRESS_CREDENTIAL_VAULT_REQUIRE_TLS | off | When enabled (true/1/on), credential vault write operations (create, patch, delete) require the request to arrive over TLS, from a loopback address, or with X-Forwarded-Proto: https. When disabled (default), any authenticated request is accepted regardless of transport. Enable this in deployments where the egress sidecar is directly reachable from untrusted networks without a TLS-terminating reverse proxy. |
Binding Guidance
- Use
defaultAction="deny"and only allow the service hosts required by the tool. - Scope bindings by path whenever possible — for example
/v1/*for Anthropic API calls. - Avoid overlapping bindings at the same precedence; ambiguous matches are rejected by the sidecar.
- Do not put real secrets in sandbox
env, command arguments, files, or metadata. - Keep fake environment variables when a CLI refuses to start without a key — the vault-injected header is what authenticates the actual outbound request.
SDK Quick Reference
All SDKs use the same wire contract. The main differences are naming and language style:| SDK | Enable proxy on sandbox create | Vault entry point | Create / patch methods |
|---|---|---|---|
| Python | credential_proxy=CredentialProxyConfig(enabled=True) | sandbox.credential_vault | create(...), patch(...) |
| JavaScript / TypeScript | credentialProxy: { enabled: true } | sandbox.credentialVault | create(request), patch(request) |
| Kotlin / JVM | .credentialProxyEnabled(true) | sandbox.credentialVault() | create(request), patch(request) |
| Go | CredentialProxy: &opensandbox.CredentialProxyConfig{Enabled: true} | sandbox.CredentialVault(ctx) | CreateCredentialVault(ctx, req), PatchCredentialVault(ctx, req) |
| C# / .NET | CredentialProxy = new CredentialProxyConfig { Enabled = true } | sandbox.CredentialVault | CreateCredentialVaultAsync(...), PatchCredentialVaultAsync(...) |
get, list, or patch responses.