Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.universalbench.dev/llms.txt

Use this file to discover all available pages before exploring further.

These are the patterns that turn UniversalBench from a remote sandbox into a real execution platform. Each one is built into the workbench and costs nothing extra to use.

Persistent sessions

By default every call is independent. Pass a session_id and Python state, imports, and cached connections persist across calls.
{
  "session_id": "my_pipeline_001",
  "code": "import pandas as pd; df = pd.read_csv('/tmp/data.csv'); print(len(df))"
}
The next call with the same session_id can reference df without reimporting or rereading. To clear state:
{ "session_id": "my_pipeline_001", "clear_session": true }

Adaptive caching

Repeated identical reads return instantly from a 30 second TTL cache. Control this per call.
{
  "db_select": {
    "table": "customers",
    "filters": [["status", "eq", "active"]],
    "limit": 100,
    "cache_control": "skip"
  }
}
cache_controlBehaviour
auto (default)Use cache normally, store fresh results
skipBypass cache for this call only
refreshBypass read, store fresh result
clearClear all caches before the call
clear_dbClear database caches only
clear_queryClear query result cache only
To clear caches without running anything else, send a standalone request:
{ "cache_op": "all" }

Validated code pushes

For Python files, validate_and_push runs a five gate pipeline before anything reaches GitHub.
{
  "validate_and_push": {
    "owner": "your-org",
    "repo": "your-repo",
    "path": "app/main.py",
    "content": "your code here",
    "message": "deploy: new feature",
    "branch": "main",
    "sha": "current-file-sha"
  }
}
The gates: ruff lint, AST syntax check, runtime dry run, auto install on missing imports, and rollback SHA capture. If any gate fails, nothing pushes and you receive a structured error pointing at the failing line.

Safe deploy with auto rollback

safe_deploy adds a smoke test on top of validate_and_push. After the push, it hits a URL you specify and checks the response. If the response does not contain your expected string, it automatically reverts to the previous commit.
{
  "safe_deploy": {
    "owner": "your-org",
    "repo": "your-repo",
    "path": "app/main.py",
    "content": "your code here",
    "message": "deploy: bump to v2",
    "smoke_test_url": "https://your-app.com/health",
    "smoke_test_expect": "version 2.0.0",
    "wait_seconds": 30
  }
}

Encrypted secrets vault

Store API keys, tokens, and other secrets once. Your AI injects them at runtime by name without ever seeing the values.
{
  "secrets_vault": {
    "action": "save",
    "customer_id": "cust_001",
    "secret_name": "STRIPE_SECRET_KEY",
    "secret_value": "sk_live_xxx"
  }
}
AES 256 GCM encryption at rest. The master key never appears in any response or log.

Parallel execution

Run up to eight code blocks concurrently. Results return in order.
{
  "parallel_blocks": [
    { "code": "import time; time.sleep(2); print('A done')" },
    { "code": "import time; time.sleep(2); print('B done')" },
    { "code": "import time; time.sleep(2); print('C done')" }
  ]
}
Total wall time is roughly two seconds instead of six.

Where to next

The complete capability list with descriptions and live playground is in the API Reference tab. The Quickstart covers the basic connect and call flow.