SecureEnvVar markers that prevent secrets from being returned in get_info() responses.
For the strongest isolation, use the Credential Vault instead. With env secrets the real value still lives inside the VM (these mechanisms only keep it out of logs and API responses). With the vault, the value never enters the VM at all — the sandbox sees only a
declaw:vault-managed placeholder and the real credential is injected at the egress proxy, per allowed domain. Reach for env secrets when a process genuinely needs the value in-process; reach for the vault when the agent only needs to make authenticated requests.Passing environment variables
EnvSecurityConfig
EnvSecurityConfig controls how secrets behave in logs and API responses.
EnvSecurityConfig model
Default masked patterns
Declaw automatically masks variables matching these patterns in audit logs, even without explicit configuration:*_KEY*_SECRET*_TOKEN*_PASSWORD
OPENAI_API_KEY, DATABASE_PASSWORD, and similar variables will not appear in audit log entries in plaintext.
SecureEnvVar
SecureEnvVar marks specific variables as secrets. Secret variables are passed to the sandbox but:
- Never returned in
get_info()orlist()responses - Never logged in plaintext in audit entries
- Not visible through the API after creation
SecureEnvVar model
Per-command environment variables
You can pass additional environment variables at the command level. These are also subject to masking rules.Preventing credential exfiltration
Environment variables alone cannot prevent a compromised agent from exfiltrating secrets via outbound traffic. Use network policies and transformation rules to add defense-in-depth:- The sandbox can only reach
api.openai.com - Any
sk-*pattern in outbound request bodies is stripped before transmission - Audit logs mask the key name
- All blocked connections are logged