{"uid":"cap_CQI6IYz78d6I8zf5qFzBi","slug":"agent-exec-sandboxed-code-execution-5117fbc8","name":"agent-exec Sandboxed Code Execution","description":"Accountless, pay-per-use code execution for software agents: submit source code, get stdout, stderr and exit code back from an isolated, network-less sandbox. No account, no API key -- possession of valid payment is sufficient.","url":"https://agent-exec.448c.org/execute?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["source","runtime"],"properties":{"files":{"type":"object","description":"Extra files seeded alongside the entry file, as relative-path -> content."},"stdin":{"type":"string","description":"Written to the payload's stdin, then stdin is closed."},"limits":{"type":"object","description":"Per-request resource budget. Every field is optional; an omitted field takes its documented default. A field outside [minimum, maximum] is rejected outright, never clamped."},"source":{"type":"string","description":"Program source, written to the runtime's entry file."},"runtime":{"enum":["python3","node"],"type":"string","description":"Must be one of the allowlisted runtimes named here -- this enum (and x-runtimes) is the free way to learn the set. An unsupported value is refused only AFTER a payment attempt, as RUNTIME_UNSUPPORTED, not before."}}},"responseSchema":{"type":"object","required":["outcome","stdout","stderr","exitCode","durationMs","truncated","error","payment","receipt"],"properties":{"error":{"type":["object","null"],"properties":{"code":{"enum":["SANDBOX_INVALID_REQUEST","RUNTIME_RESERVED_FILE_PATH","REQUEST_MALFORMED","PAYMENT_MALFORMED","RUNTIME_UNSUPPORTED","RUNTIME_LIMIT_OUT_OF_RANGE","SANDBOX_TIMEOUT","EXECUTION_MEMORY_LIMIT_EXCEEDED","EXECUTION_OUTPUT_LIMIT_EXCEEDED","SERVICE_BUSY","PAYER_RATE_LIMITED","PAYER_CONCURRENCY_LIMITED","EXECUTE_IP_RATE_LIMITED","EXECUTION_RUNTIME_ERROR","EXECUTION_RUNTIME_ERROR_POSSIBLE_SANDBOX_DENIAL","EXECUTION_RUNTIME_ERROR_NETWORK_DISABLED","PAYMENT_INVALID","PAYMENT_AMOUNT_INSUFFICIENT","PAYMENT_REQUIREMENTS_MISMATCH","PAYMENT_REPLAYED","PAYMENT_SETTLEMENT_FAILED","PAYMENT_SETTLEMENT_INDETERMINATE","SANDBOX_UNAVAILABLE","SANDBOX_SETUP_FAILED","SERVICE_INTERNAL_FAILURE","PAYMENT_FACILITATOR_UNAVAILABLE"],"type":"string"},"message":{"type":"string"},"billable":{"type":"boolean"},"category":{"type":"string"}},"description":"Null when `outcome` is \"completed\"."},"stderr":{"type":"string"},"stdout":{"type":"string"},"outcome":{"enum":["completed","timeout","error"],"type":"string"},"payment":{"type":"object","properties":{"asset":{"type":"string"},"payer":{"type":"string","description":"The paying wallet's address."},"amount":{"type":"string","description":"Atomic units of the settlement asset that were charged."},"network":{"type":"string"},"transaction":{"type":"string","description":"On-chain settlement transaction hash."}},"description":"The payer is surfaced because it is this service's notion of identity (build.md: the wallet is the account) -- per-payer rate limits and standing are built on it."},"receipt":{"type":"object","required":["requestDigest","payment","priceUsd","price","tier","limits","usage","status","outputDigest"],"properties":{"tier":{"type":"string"},"price":{"type":"string","description":"The same amount as `priceUsd`, formatted as an x402 price string (e.g. \"$1.0000\")."},"usage":{"type":"object","required":["outcome","durationMs","exitCode","truncated"],"properties":{"outcome":{"enum":["completed","timeout","error"],"type":"string"},"exitCode":{"type":["integer","null"]},"truncated":{"type":"object","required":["stdout","stderr"],"properties":{"stderr":{"type":"boolean"},"stdout":{"type":"boolean"}}},"durationMs":{"type":"number"}}},"limits":{"type":"object","required":["timeoutMs","maxMemoryBytes","maxOutputBytes","workDirBytes"],"properties":{"timeoutMs":{"type":"number"},"workDirBytes":{"type":"number"},"maxMemoryBytes":{"type":"number"},"maxOutputBytes":{"type":"number"}},"description":"The purchased resource budget, normalized -- every field filled in, omitted request fields resolved to their documented default."},"status":{"type":"object","required":["code","category","billable"],"properties":{"code":{"enum":["SANDBOX_INVALID_REQUEST","RUNTIME_RESERVED_FILE_PATH","REQUEST_MALFORMED","PAYMENT_MALFORMED","RUNTIME_UNSUPPORTED","RUNTIME_LIMIT_OUT_OF_RANGE","SANDBOX_TIMEOUT","EXECUTION_MEMORY_LIMIT_EXCEEDED","EXECUTION_OUTPUT_LIMIT_EXCEEDED","SERVICE_BUSY","PAYER_RATE_LIMITED","PAYER_CONCURRENCY_LIMITED","EXECUTE_IP_RATE_LIMITED","EXECUTION_RUNTIME_ERROR","EXECUTION_RUNTIME_ERROR_POSSIBLE_SANDBOX_DENIAL","EXECUTION_RUNTIME_ERROR_NETWORK_DISABLED","PAYMENT_INVALID","PAYMENT_AMOUNT_INSUFFICIENT","PAYMENT_REQUIREMENTS_MISMATCH","PAYMENT_REPLAYED","PAYMENT_SETTLEMENT_FAILED","PAYMENT_SETTLEMENT_INDETERMINATE","SANDBOX_UNAVAILABLE","SANDBOX_SETUP_FAILED","SERVICE_INTERNAL_FAILURE","PAYMENT_FACILITATOR_UNAVAILABLE",null],"type":["string","null"]},"billable":{"type":"boolean"},"category":{"enum":["invalid_request","unsupported_runtime","limit_out_of_range","timeout","memory_exceeded","output_limit_exceeded","service_busy","runtime_error","payment_required","settlement_failed","settlement_indeterminate","internal_failure","success"],"type":"string"}},"description":"From `classify()` -- the same wire taxonomy every error response already uses, rather than a receipt-local status string that could disagree with `error.category`."},"payment":{"type":"object","required":["payer","amount","asset","network","reference"],"properties":{"asset":{"type":"string"},"payer":{"type":"string","description":"The paying wallet's address."},"amount":{"type":"string","description":"Atomic units of the settlement asset that were charged."},"network":{"type":"string"},"reference":{"type":"string","description":"The facilitator's settlement transaction hash -- the on-chain reference for this payment."}}},"priceUsd":{"type":"number","description":"From `priceForLimits()` -- mechanically equal to what POST /quote returns for `limits`."},"outputDigest":{"type":"string","description":"A hash of exactly the fields returned as the run's result (`outcome`, `stdout`, `stderr`, `exitCode`, `truncated`) -- `durationMs` is deliberately excluded."},"requestDigest":{"type":"string","description":"sha256(rawBody) hex-encoded -- the exact bytes this request sent, hashed with nothing normalized or reinterpreted."}},"description":"Cryptographically binds this exact payment to this exact request and this exact output (src/receipts/receipt.ts) -- so the caller can recompute `requestDigest`/`outputDigest` itself without trusting this service's parsing, rather than a mere echo of what was already charged."},"exitCode":{"type":["integer","null"]},"truncated":{"type":"object","required":["stdout","stderr"],"properties":{"stderr":{"type":"boolean"},"stdout":{"type":"boolean"}}},"durationMs":{"type":"number"}},"description":"This route is paid on every call (POST /execute mounts no free path), so `payment` and `receipt` are always present alongside the run's own fields -- per src/runtime/types.ts's `ExecuteResult` plus what src/app.ts merges in once settlement succeeds."},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_zJudu0RWGd1jCC_-0Ca7I","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes Python or Node.js source code in an isolated, network-less sandbox and returns stdout, stderr, and exit code — pay-per-use via x402, no account required.","exampleAgentPrompt":"Run this Python 3 script for me in a sandboxed environment and give me the stdout and exit code: `import math; print(math.factorial(20))`","exampleUseCases":[{"title":"Agent-driven data transformation script","prompt":"Execute this Python 3 snippet that reads a JSON blob from stdin, transforms it, and prints the result — pass this JSON as stdin: {\"values\": [1, 3, 5, 7]} and the script is: `import json, sys; d=json.load(sys.stdin); print(sum(d['values']))`"},{"title":"On-the-fly algorithm verification","prompt":"Run this Node.js snippet and tell me the output — I want to verify my binary search implementation: `function bs(arr,t){let l=0,r=arr.length-1;while(l<=r){let m=Math.floor((l+r)/2);if(arr[m]===t)return m;arr[m]<t?l=m+1:r=m-1;}return -1;} console.log(bs([1,3,5,7,9],7));`"},{"title":"Automated test case runner for agent pipeline","prompt":"Run this Python 3 unit test script in a sandboxed environment and tell me whether it passes — the source is: `import unittest; class T(unittest.TestCase):\n def test_add(self): self.assertEqual(1+1,2)\nunittest.main()`"}],"resultDescription":"Returns an outcome field ('completed', 'timeout', or 'error'), captured stdout, captured stderr, exit code, execution duration in milliseconds, truncation flags, a structured error object (null on success), payment details (payer wallet, amount, network, transaction hash), and a signed receipt with tier, price, resource limits, and an output digest for auditability.","failureModes":["SANDBOX_TIMEOUT — code ran too long; no refund","EXECUTION_MEMORY_LIMIT_EXCEEDED — script exceeded RAM budget","RUNTIME_UNSUPPORTED — runtime enum value not allowlisted; charged after payment attempt","REQUEST_MALFORMED — missing required fields source or runtime","PAYMENT_INVALID / PAYMENT_AMOUNT_INSUFFICIENT — x402 payment missing or underfunded","PAYER_RATE_LIMITED / PAYER_CONCURRENCY_LIMITED — too many requests from the same wallet","SERVICE_BUSY / SANDBOX_UNAVAILABLE — backend capacity issue; retry","EXECUTION_OUTPUT_LIMIT_EXCEEDED — stdout/stderr too large","PAYMENT_REPLAYED — same payment token submitted twice"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to execute untrusted or dynamically generated code snippets without managing accounts, API keys, or infrastructure. It is ideal for pay-per-use one-off computations, agent pipelines that need on-demand scripting capability, or when the caller holds a USDC wallet (x402) and wants frictionless access. Prefer it over managed cloud functions when there is no persistent state needed and the network-isolated sandbox is a feature rather than a limitation. Not suitable for code that requires internet access, persistent disk storage, or runtimes beyond python3 and node.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T18:38:30.177Z","isFirstParty":false,"canonicalSlug":"agent-exec-sandboxed-code-execution-5117fbc8"}