SafeScript: a Turing-incomplete JS subset lets agent policies replace code review
uriwa · reddit · 2026-09-27
The author argues code review is broken for AI agents: they pull in third-party skills or synthesize code at runtime, and sandboxes only contain the OS — they can't stop prompt injection or poisoned packages from exfiltrating credentials.
His answer is SafeScript, a Turing-incomplete subset of JavaScript with no unbounded loops, no recursion, and a closed instruction set. Every program compiles to a static DAG, and the compiler extracts a full mathematical proof before execution: every external host contacted, every env var read, worst-case memory bounds, and complete data flow from inputs to hosts. You never review code — you review and approve a policy (e.g., GITHUBTOKEN may only reach api.github.com); violations halt before a single line runs.
Since programs provably terminate and lack dangerous primitives (no eval, filesystem, or shell), it runs directly in your process with zero VM overhead, zero cold starts, and sub-millisecond execution. Open-source repo and playground linked in comments.
More from coding & agent
- Building a workload-specific inference engine fast by standing on FOSS giants — charles_irl · 2026-09-27
- Every's Vibe Check: Opus 5.5 wins back Codex converts at ~60% less than Fable — every · 2026-09-27
- Team ships workload-specific inference engine fast with agent help, on a deep FOSS stack — charles_irl · 2026-09-27
- Opus 5.5 for motion graphics: dev builds a full template app, shares Midjourney prompts — techhalla · 2026-09-27
- Besa adds exact-action admission gates for MCP tool calls with signed capability grants — MostHat2980 · 2026-09-27
- Devs Are Just Yes Machines Now: Complaining About Claude Extension's Constant Prompts in VS Code — ThePeterMick · 2026-09-27