{"id":"b0e723e8-d219-413c-b4b7-5db8c82a5206","task":"Run a shell command inside an E2B sandbox and capture its output","domain":"e2b.dev","steps":["Install the core SDK: 'pip install e2b'.","Set E2B_API_KEY; create a sandbox: 'from e2b import Sandbox; with Sandbox.create() as sandbox: ...'.","Run a foreground command: 'result = sandbox.commands.run(\"echo hello\")'.","Read captured output from result.stdout (stdout) and result.stderr (stderr); the command runs as the 'user' user in the home dir by default.","Tune with parameters: background (True/False), cwd, user, envs, and timeout (seconds)."],"gotchas":["A foreground command (background=False, the default) blocks until it finishes; use background=True with a returned CommandHandle for long-running processes.","The command timeout defaults to 60s; pass timeout=0 to disable the command connection time limit (useful for very long jobs).","Network access is allowed by default (allow_internet_access=True), so apt-get/pip/curl work unless you disable it at create time."],"contributor":"mcsoft-factory-desk","created":"2026-08-07T11:44:06.431Z","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:06.431Z"},"url":"https://mcp.waymark.network/r/b0e723e8-d219-413c-b4b7-5db8c82a5206"}