# verify402 — Sandbox Code Verification

> verify402 — Sandbox Code Verification is a paid API for AI agents from verify402-production.up.railway.app, paid per call via x402, $0.03/call, status unknown (last checked 2026-10-13).

Executes submitted code and test assertions in an isolated sandbox and returns a pass/fail verdict with stdout, stderr, and exit code evidence.

## Facts

- Endpoint: POST https://verify402-production.up.railway.app/verify?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/verify402-sandbox-code-verification-4743eda6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tdAYE22yjEQGxLJW-tOhY

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 verify402-sandbox-code-verification-4743eda6 -d '<json body>'
```

Example prompt: Run this Python function and its pytest assertions in a sandbox and tell me if they pass — here's the code: `def add(a, b): return a + b` and the test: `from code import add; assert add(2, 3) == 5`.

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call code execution and test verification service without managing your own sandbox infrastructure. It is ideal for agents that generate code and need immediate correctness feedback, for grading pipelines, or for CI-style checks on small snippets in Python or Node.js. Prefer it over full CI/CD systems when you need a single fast verdict on a discrete code+test pair without setting up runners or credentials.

## Known failure modes

- Code syntax errors cause a non-zero exit code and 'fail' verdict with stderr details
- Test assertions that exit non-zero (e.g. AssertionError) return 'fail' with traceback in stderr
- Unsupported language value returns validation error
- Execution timeout for long-running code may return fail with timeout message
- Missing required fields (code, tests, language) return HTTP 400
- Payment failure via x402 (insufficient USDC balance) blocks the request before execution

## How this service works

Sandbox verification for AI agents: submit code + tests, get an executed pass/fail verdict with evidence. Pay per call via x402 (USDC on Base).

## Output

A JSON object containing: `verdict` ('pass' or 'fail'), `reason` (human-readable explanation), `stdout` (captured standard output), `stderr` (captured error output), `exitCode` (process exit code, 0 for pass), and `durationMs` (execution time in milliseconds).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "code": {
   "type": "string",
   "description": "The module under test (saved as code.py / code.js)"
  },
  "tests": {
   "type": "string",
   "description": "Assertions importing the module; must exit non-zero on failure"
  },
  "language": {
   "enum": [
    "python",
    "node"
   ],
   "type": "string",
   "description": "Runtime for code + tests"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "reason": "Alle Tests bestanden.",
  "stderr": "",
  "stdout": "OK\n",
  "verdict": "pass",
  "exitCode": 0,
  "durationMs": 250
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/verify402-sandbox-code-verification-4743eda6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from verify402-production.up.railway.app](https://www.zero.xyz/host/verify402-production.up.railway.app/llms.txt)
