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
- Sydney Codex Community Buildathon set for Nov 14 with Cerebras-backed ultrafast compute track — paw_lean · 2026-11-11
- shadcn's improve hits 10k stars: let top models plan, cheap models execute code fixes — shadcn · 2026-11-11
- OpenAI open-sources Codex Security CLI and SDK for AI-driven vulnerability scanning and fixing — openai · 2026-11-11
- Claude Opus 5.5 runs an architecture search and finds AttnRes-Canon, a new top Transformer design — SonglinYang4 · 2026-11-11
- 5 research habits worth knowing: read papers backwards, reproduce first, wire coding agents via MCP — cneuralnetwork · 2026-11-11
- 'Adam can now do CAE': AI agent showcase in engineering simulation draws buzz — burhop · 2026-11-11