{"uid":"cap_cP4k5IcdILJV3AvFR7es2","slug":"isolated-python-execution-for-autonomous-agents-c02cca86","name":"Isolated Python Execution for Autonomous Agents","description":"Run bounded Python 3.11 code in an ephemeral isolated sandbox with one x402 payment. This service creates the sandbox, executes the code, captures stdout, stderr, and return code, terminates the sandbox, and returns supplier settlements plus a signed receipt.","url":"https://evidence.regulavita.com/v1/compute/python-run","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"code":{"type":"string","maxLength":6000,"minLength":1,"description":"Python 3.11 source code to execute."},"timeout_seconds":{"type":"integer","default":10,"maximum":30,"minimum":1}}},"responseSchema":{"type":"json","example":{"product":"ISOLATED_PYTHON_RUN","receipt":{"algorithm":"Ed25519"},"request":{"code_sha256":"sha256:0000000000000000000000000000000000000000000000000000000000000000","code_characters":61,"timeout_seconds":10},"sandbox":{"runtime":"python:3.11","memory_mb":512,"maximum_cpu":1,"termination":"FULFILLED","isolated_from_service_host":true},"decision":"PYTHON_EXECUTION_COMPLETED","execution":{"stderr":"","stdout":"{\"answer\": 55}\n","timed_out":false,"returncode":0},"provenance":{"engine_version":"isolated-python-run/0.1.0"},"request_id":"isolated_python_run_example","supplier_execution":[]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.03","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.03/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_fTGyc1MGotdYrzmFtEQAc","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.03","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs arbitrary Python code in an isolated sandbox and returns stdout/stderr, exit code, and a cryptographic receipt — payable per-call with no account required.","exampleAgentPrompt":"Run this Python snippet in an isolated sandbox with a 10-second timeout and return whatever it prints: `import json; print(json.dumps({'answer': sum(range(11))}))`","exampleUseCases":[{"title":"Agent-side math verification","prompt":"I need you to verify this calculation by actually running it in Python — compute the Fibonacci sequence up to index 20 and print the result as JSON. Use an isolated sandbox with a 15-second timeout so I can trust the output."},{"title":"Data transformation in agent pipeline","prompt":"Take this CSV string I'm passing you and run Python code to parse it, compute the mean of the second column, and return the result as JSON — execute it in an isolated environment so nothing leaks."},{"title":"Generated code safety check","prompt":"I just wrote a Python function to validate IBAN checksums — can you run it in a sandboxed environment with a 5-second timeout so I can see if it returns the right True/False for my test cases before I trust it?"}],"resultDescription":"Returns a JSON object containing: the stdout and stderr strings from the execution, the process return code, a timed_out boolean, sandbox metadata (runtime version, memory limit, CPU cap, isolation flag), a SHA-256 hash and character count of the submitted code, an Ed25519-signed receipt, a decision field (e.g. PYTHON_EXECUTION_COMPLETED), a unique request_id, and provenance including the engine version.","failureModes":["Code exceeds timeout_seconds — timed_out is true, execution is terminated, returncode may be non-zero","Syntax or runtime error in submitted code — returncode non-zero, stderr contains traceback, stdout empty","Code attempts to access network or filesystem beyond sandbox limits — isolated_from_service_host enforced, execution may fail","Malformed request body (missing code field) — HTTP 4xx error returned","Payment not settled via x402 protocol — request rejected before execution begins","Memory limit exceeded (512 MB) — process terminated, returncode non-zero"],"whenToPreferThis":"Choose this endpoint when an autonomous agent needs to execute dynamic or generated Python code without managing infrastructure, API keys, or accounts. It is ideal for per-call, pay-as-you-go compute with cryptographic receipts proving execution integrity — especially useful when the agent cannot trust its own environment or needs isolated, reproducible computation. Prefer it over self-hosted runners when auditability (Ed25519 receipts), isolation guarantees, and zero-setup are priorities.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:39:46.891Z","isFirstParty":false}