# TrollBridge Code Run — Sandboxed JavaScript Executor

> TrollBridge Code Run — Sandboxed JavaScript Executor is a paid API for AI agents from mini-tollbooth.onrender.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-12).

Executes a JavaScript snippet in an isolated sandbox and returns the result plus captured logs, with a 64MB heap cap and no network or filesystem access.

## Facts

- Endpoint: GET https://mini-tollbooth.onrender.com/code-run?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/trollbridge-code-run-sandboxed-javascript-executor-09470451
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UPbr7ZJe1u-e5IWsv-Mdr

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 trollbridge-code-run-sandboxed-javascript-executor-09470451
```

Example prompt: Run this JavaScript snippet for me in a safe sandbox and give me the result: `function fib(n){return n<=1?n:fib(n-1)+fib(n-2);} fib(10);` — use a 5-second timeout.

## When to prefer this

Choose this endpoint when you need to safely evaluate a JavaScript snippet without a local runtime, especially when the code is untrusted or computationally bounded. It is ideal for quick formula evaluation, testing algorithmic logic, or computing derived values on the fly. Prefer it over a general compute service when you need a metered, pay-per-call sandbox with explicit heap and timeout controls and no side effects.

## Known failure modes

- Code exceeds 50KB input limit — rejected before execution
- Execution exceeds timeout_ms wall-clock limit — sandbox killed, timeout error returned
- Code attempts network or filesystem access — blocked silently or returns undefined
- Heap usage exceeds 64MB cap — process killed with memory error
- Syntax errors in submitted JS — returns parse/runtime error in result
- Unsupported language specified (anything other than 'js') — error returned
- Output exceeds max_output_chars cap — response truncated

## How this service works

The insurance booth for AI agents, with Mini's Agent Supply Store on the side of the road. One hundred checkpoints: pre-transaction safety lanes (honeypot, approval-risk, rug-score, receipt-check, tx-dryrun, permit-scan, airdrop-verdict, deployer-history, wallet-watch, secret-scan at $0.02 USDC per call; the protection tier — /contract-check, /approval-screen, /tx-plain-english, /honeypot-check, /tx-simulate, /redteam, /skill-scan, /verdict, /egress-audit, /tool-gate, /airlock, /repo-scan, /prove, /task-scope — at $0.10; the one-call /shield don't-get-rugged screen at $0.25; the full /preflight bundle at $0.05), bounty intel (bounties, fresh, verdicts, deadlines, sweepstakes, opportunities) at $0.02 USDC per call, trader intel (/prices and /quant at $0.02; /enrich and /token-check at $0.05; /contract-check and /honeypot-check at $0.10; /sec-facts at $0.05), market intel (/markets and /search at $0.05; /grants at $0.02), DeFi intel (/yields and /new-pairs at $0.05; /gas and /defi at $0.02), AI intel (/models at $0.02), agent-ops intel (/prompt-cost, /model-picks, /rpc-speed, /terms-tldr, /scrape, /gigs, /retry-verify, /idempotency, /verify-independent at $0.02; /site-watch, /wallet-check, /code-run, /regulatory-pack, /sage, /cron-watch, /caveat-check, /tripwire, /escrow, /trust, /bridge-fees, /dao-votes, /dev-activity, /dex-arb, /dydx-perps, /funding-rates, /gas-predict, /hack-tracker, /long-short-ratio, /lp-yields, /mev-scan, /open-interest, /perp-basis, /polymarket-odds, /rwa-watch, /sentiment, /stablecoin-flows, /tokenomics, /top-movers, /whale-watch, and /yield-stable at $0.05; /approval-screen, /tx-plain-english, /tx-simulate, and /task-scope at $0.10; /scam-scan deep scan at $5.00 or 30-day subscription at $30.00), supply store (/road-pack combo meal at $0.05; curated datasets, the /audit-prep pre-audit review, and the /prove-state symbolic-execution run at $1.00; the /audit AI-agent audit at $25.00). Every lane answers before money moves — heuristic verdicts, not audits. Don't get rugged.

## Output

A JSON object containing: the lane name ('/code-run'), the language used ('js'), any console logs captured during execution, the final result value as a string, a verdict ('ok' or error state), the timeout setting in milliseconds, a human-readable description of the sandbox, and the actual wall-clock execution time in milliseconds.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "code"
     ],
     "properties": {
      "code": {
       "type": "string",
       "description": "JavaScript snippet to run (max 50KB). Synchronous JS only in v1."
      },
      "lang": {
       "type": "string",
       "description": "Language — only \"js\" is supported in v1."
      },
      "timeout_ms": {
       "type": "string",
       "description": "Max wall-clock ms before the sandbox is killed (1000–10000, default 5000)."
      },
      "max_output_chars": {
       "type": "string",
       "description": "Cap for captured logs + result (100–20000, default 4000)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lane": "/code-run",
  "lang": "js",
  "logs": "",
  "result": "7",
  "verdict": "ok",
  "timeout_ms": 5000,
  "description": "Sandboxed JS execution ($0.05) — run a JavaScript snippet in an isolated child process (64MB heap cap, no network, no filesystem) and get the result plus captured logs. Pragmatic sandbox, not a hardened enclave.",
  "execution_ms": 11
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/trollbridge-code-run-sandboxed-javascript-executor-09470451/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mini-tollbooth.onrender.com](https://www.zero.xyz/host/mini-tollbooth.onrender.com/llms.txt)
