{"slug": "jukebox-os-deterministic-time-travel-replay-and-acid-tool-sandbox-for-ai-agents", "title": "Jukebox-OS: Deterministic time-travel replay and ACID tool sandbox for AI agents", "summary": "Marius Carlsson released Jukebox-OS, an open-source agent runtime written in Rust with Python bindings that records every LLM prompt, token stream, MCP tool call and filesystem mutation to a portable .jbx tape hashed with BLAKE3/BLAKE2b, giving agents BEGIN/COMMIT/ROLLBACK semantics. The runtime claims offline replay of 50-step agent runs in 0.4ms at $0.00 API cost, stages side effects in a copy-on-write WASI sandbox so tool calls only reach production on tx.commit(), and includes a circuit breaker that trips on repeated semantic similarity or a configurable max_cost_usd. Jukebox-OS targets frameworks including LangGraph, AutoGen, CrewAI and the OpenAI Agents SDK, where side effects are otherwise fire-and-forget.", "body_md": "\n\n```\n     ___________________________________________________________________________\n    /                                                                           \\\n   |   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   |\n   |   ░  ██╗██╗   ██╗██╗  ██╗███████╗██████╗  ██████╗ ██╗  ██╗              ░   |\n   |   ░  ██║██║   ██║██║ ██╔╝██╔════╝██╔══██╗██╔═══██╗╚██╗██╔╝              ░   |\n   |   ░  ██║██║   ██║█████╔╝ █████╗  ██████╦╝██║   ██║ ╚███╔╝   [ EST. 76 ] ░   |\n   |   ░██   ██║██║   ██║██╔═██╗ ██╔══╝  ██╔══██╗██║   ██║ ██╔██╗            ░   |\n   |   ░╚█████╔╝╚██████╔╝██║  ██╗███████╗██████╦╝╚██████╔╝██╔╝ ██╗           ░   |\n   |   ░ ╚════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝  ╚═════╝ ╚═╝  ╚═╝           ░   |\n   |   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   |\n   |  =========================================================================  |\n   |   ★  24-HOUR DETERMINISTIC AGENT RUNTIME • ACID SANDBOX • TIME-TRAVEL  ★    |\n    \\___________________________________________________________________________/\n            ||                                                         ||\n      ▄████████████▄             \"DROP THE NEEDLE ON ANY FRAME\"  ▄████████████▄\n```\n\n**[ 🎙️ NOW PLAYING ON TRACK #01 ]**\n*Stop letting autonomous agents trash your production database and burn $400 in runaway loops. **JUKEBOX** records every LLM prompt, token stream, MCP tool call, and filesystem mutation onto a cryptographic vinyl tape (`.jbx`)—giving your agents `BEGIN` / `COMMIT` / `ROLLBACK` semantics and `<1ms` zero-cost time-travel replay.*\n\nModern agent frameworks (**LangGraph**, **AutoGen**, **CrewAI**, **OpenAI Agents SDK**) are great at orchestrating prompts, but they treat side effects as fire-and-forget. When a 15-step agent workflow hallucinates on Step 12 after mutating three SQL tables and five local files on Step 8, \"checkpointing the chat history\" won't save you.\n\n**JUKEBOX** (architected by [**Marius Carlsson**](https://github.com/socrates6969)) is a systems-level runtime written in **Rust** with **Python** bindings that brings **database-grade ACID transactions** and **deterministic vinyl replay** to any AI agent stack:\n\n| Menu Item | What Goes In The Booth | Why Platform Engineers Love It | \n|---|---|---|\n| **💿 Vinyl CAS Flight-Recorder** | Every LLM request, streaming chunk, seed, tool input/output, and clock tick is hashed via `BLAKE3` /`BLAKE2b` into a portable`.jbx` tape. | **Rewind & Replay 50-step agent runs in `0.4ms` offline** at**$0.00 API cost** . Share a failed`.jbx` file in a GitHub Issue like a core dump. | \n| **🛡️ Shadow Booth (ACID Tool Sandbox)** | Intercepts local file writes, shell commands, SQL queries, and **Anthropic MCP** calls inside a Copy-on-Write (CoW) WASI staging layer. | Side effects only hit the real world when your verifier calls `tx.commit()` . If an agent fails a safety check,`tx.rollback()` leaves zero trace. | \n| **🎛️ Time-Travel Forking (`Track B-Side`)** | Drop the needle at Frame #9 of a failed production trace, swap `gpt-4o` for`claude-3-7-sonnet` or tweak a system prompt, and resume. | Steps 1–8 resolve instantaneously from the Merkle tape; only Step 9+ hits the live network. Diff both timelines side-by-side. | \n| **🚨 Anti-Skip Needle (Loop Circuit-Breaker)** | Streaming semantic similarity & AST-diff monitor that watches inter-agent chatter and token burn velocity. | Automatically trips the breaker when two agents enter a polite recursive death spiral—saving your cloud budget before the pager fires. | \n\n```\ngit clone https://github.com/socrates6969/jukebox-os.git\ncd jukebox-os\npip install -e .\npython\nimport asyncio\nfrom jukebox import Jukebox, SandboxPolicy, CircuitBreaker\n\njb = Jukebox(\n    tape_dir=\"./tapes\",\n    sandbox=SandboxPolicy(filesystem=\"copy_on_write\", mcp_mode=\"staged_acid\"),\n    breaker=CircuitBreaker(max_cost_usd=0.50, max_semantic_repeat=3),\n)\n\n@jb.track(name=\"invoice-reconciliation-agent\")\nasync def run_accounting_agent(customer_id: str, amount_usd: float) -> dict:\n    async with jb.transaction(tape_id=\"tr_8f92a1c4\") as tx:\n        tx.record_agent_turn(\n            agent_name=\"planner\",\n            message=f\"Staging refund of ${amount_usd} for {customer_id}\",\n            model=\"gpt-4o\",\n            cost_usd=0.008,\n        )\n        tx.stage_file_write(\n            path=\"./tapes/staged_ledger_demo.json\",\n            content=f'{{\"customer\": \"{customer_id}\", \"refund_usd\": {amount_usd}}}',\n        )\n\n        if amount_usd > 500.0:\n            await tx.rollback(reason=\"Refund exceeds $500 autonomous threshold\")\n            return {\"status\": \"ROLLED_BACK\", \"tape_id\": tx.tape_id}\n\n        await tx.commit()\n        return {\"status\": \"COMMITTED\", \"tape_id\": tx.tape_id}\n\nif __name__ == \"__main__\":\n    print(asyncio.run(run_accounting_agent(\"cust_9981\", 420.00)))\npython\nfrom jukebox import Tape\n\ntape = Tape.load(\"./tapes/tr_8f92a1c4.jbx\")\nb_side = tape.fork(\n    at_frame=3,\n    override_model=\"claude-3-7-sonnet-latest\",\n    override_system_prompt=\"You are a strict SQL auditor. Never issue DELETE without a WHERE clause.\",\n)\nprint(b_side.replay_and_diff().to_markdown())\n+-----------------------------------------------------------------------------------+\n|                        APPLICATION & ORCHESTRATION LAYER                          |\n|     [ LangGraph ]     [ CrewAI ]     [ AutoGen ]     [ OpenAI / Anthropic SDK ]   |\n+-----------------------------------------+-----------------------------------------+\n                                          |  @jukebox.track / MCP Proxy\n                                          v\n+-----------------------------------------------------------------------------------+\n|                    🍒 JUKEBOX RUST CORE RUNTIME (libjukebox) 🔮                   |\n|                                                                                   |\n|  +-------------------------+  +-----------------------+  +---------------------+  |\n|  |   ANTI-SKIP NEEDLE      |  |  BLAKE3 MERKLE CAS    |  |   OTEL GEN_AI       |  |\n|  |  • Cosine Loop Breaker  |  |  • Zero-Cost Replay   |  |   EXPORTER          |  |\n|  |  • Token Budget Gate    |  |  • .jbx Binary Tape   |  |  • Spans & Metrics  |  |\n|  +-------------------------+  +-----------------------+  +---------------------+  |\n|                                                                                   |\n|  +-----------------------------------------------------------------------------+  |\n|  |               SHADOW BOOTH: TRANSACTIONAL WASI & CoW SANDBOX                |  |\n|  |   [ Virtual CoW Filesystem ]   [ SQL Savepoint Proxy ]   [ MCP Stage Gate ] |  |\n|  +--------------------------------------+--------------------------------------+  |\n+-----------------------------------------|-----------------------------------------+\n                                          |\n                     +--------------------+--------------------+\n                     |                                         |\n            [ VERIFIER PASSES ]                       [ VERIFIER FAILS ]\n                     |                                         |\n                     v                                         v\n         ( ATOMIC WORLD COMMIT )                   ( INSTANT ZERO-RESIDUE )\n         Writes flushed to Disk/API                  ROLLBACK & ALERT\nbash\n# List recent agent flight recordings in your local booth\n$ jukebox ls --tape-dir ./tapes\n🍒 JUKEBOX 24-HOUR FLIGHT RECORDER // LOCAL BOOTH TAPES 🔮\n------------------------------------------------------------------------------\nTRACK ID         AGENT NAME                     FRAMES   COST      STATUS      \n------------------------------------------------------------------------------\ntr_8f92a1c4      invoice-reconciliation-agent   5        $0.0080   COMMITTED   \n\n# Replay & cryptographically verify a .jbx Merkle tape in <1ms\n$ jukebox replay ./tapes/tr_8f92a1c4.jbx\n```\n\n| Metric | Raw Framework (No Sandbox) | Docker Container Per Run | **🍒 JUKEBOX Runtime** | \n|---|---|---|---|\n| **Runtime Interception Overhead** | `0.00 ms` (Baseline) | `+1,420.0 ms` (Cold boot) | **`+0.34 ms` per frame** | \n| **Replay Steps 1–15 (Time-Travel)** | `38,400 ms` (Re-runs APIs) | `39,800 ms` (Re-runs APIs) | **`0.41 ms` (`93,000x` faster)** | \n| **API Cost on 10x Debug Replays** | `$1.84` | `$1.84` | **`$0.00` (100% CAS Hit)** | \n| **Side-Effect Rollback Latency** | ❌ Impossible (Manual cleanup) | `640 ms` (Container teardown) | **`0.19 ms` (CoW pointer drop)** | \n| **Runaway Loop Detection** | ❌ Only after `max_iterations` | ❌ Only after `max_iterations` | **`0.18 ms` (Semantic AST trip)** | \n\n1. **Fork the Repo & Pull Up a Stool:**\n\n```\ngit clone https://github.com/socrates6969/jukebox-os.git\ncd jukebox-os\npip install -e . pytest\npytest -v\n```\n\n2. **House Rules (Code of Conduct):** Read our[CODE_OF_CONDUCT.md](https://github.com/socrates6969/jukebox-os/blob/main/CODE_OF_CONDUCT.md) and[CONTRIBUTING.md](https://github.com/socrates6969/jukebox-os/blob/main/CONTRIBUTING.md) .", "url": "https://wpnews.pro/news/jukebox-os-deterministic-time-travel-replay-and-acid-tool-sandbox-for-ai-agents", "canonical_source": "https://github.com/socrates6969/jukebox-os", "published_at": "2026-10-25 16:29:46+00:00", "updated_at": "2026-10-25 16:44:03.891878+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-safety", "developer-tools", "agent-protocols"], "entities": ["Jukebox-OS", "Marius Carlsson", "Rust", "Python", "Anthropic MCP", "LangGraph", "AutoGen", "CrewAI"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/jukebox-os-deterministic-time-travel-replay-and-acid-tool-sandbox-for-ai-agents", "markdown": "https://wpnews.pro/news/jukebox-os-deterministic-time-travel-replay-and-acid-tool-sandbox-for-ai-agents.md", "text": "https://wpnews.pro/news/jukebox-os-deterministic-time-travel-replay-and-acid-tool-sandbox-for-ai-agents.txt", "jsonld": "https://wpnews.pro/news/jukebox-os-deterministic-time-travel-replay-and-acid-tool-sandbox-for-ai-agents.jsonld"}}