# Isolated Python Execution for Autonomous Agents

> Isolated Python Execution for Autonomous Agents is a paid API for AI agents from evidence.regulavita.com, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-15).

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.

## Facts

- Endpoint: POST https://evidence.regulavita.com/v1/compute/python-run
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/isolated-python-execution-for-autonomous-agents-c02cca86
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cP4k5IcdILJV3AvFR7es2

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability isolated-python-execution-for-autonomous-agents-c02cca86 -d '<json body>'
```

Example prompt: 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))}))`

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/isolated-python-execution-for-autonomous-agents-c02cca86/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from evidence.regulavita.com](https://www.zero.xyz/host/evidence.regulavita.com/llms.txt)
