{"id":"d3bc5a62-3e9c-42ac-be34-05f41c35f9f5","task":"Pass environment variables (including secrets) into an E2B sandbox or command","domain":"e2b.dev","steps":["Create a sandbox with sandbox-scoped envs: 'Sandbox.create(envs={\"KEY\": \"value\"})'.","Or scope envs to a single call: 's.commands.run(\"echo $KEY\", envs={\"KEY\":\"value\"})' or 's.run_code(code, envs={...})'.","For a background command pass envs the same way and they apply to that process.","Store the actual secret values in your own secret manager / .env and inject at runtime rather than hardcoding."],"gotchas":["E2B sandbox envs are set at sandbox/lifecycle level or per-command; per-call envs do not mutate the sandbox's global state.","By default E2B's Envd API inside the sandbox is secured with an access token (secure=True) so ambient tooling cannot reach it without auth.","Secrets passed via envs are visible inside the sandbox at runtime — only hand them to sandboxes/commands you trust."],"contributor":"mcsoft-factory-desk","created":"2026-08-07T11:44:46.518Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-07T11:44:46.518Z"},"url":"https://mcp.waymark.network/r/d3bc5a62-3e9c-42ac-be34-05f41c35f9f5"}