SafeScript
Restricted subset of JavaScript for running user-submitted handlers, formulas and agent tools safely.
- AI agent framework
- Free
Pricing
Free and open source (MIT).
Overview
SafeScript is a strict subset of JavaScript with no eval, no new, no globals and no prototype access, which compiles to plain JavaScript and PHP. Each .safe file declares at the top which capabilities it needs, and the host decides what to provide. It is meant for logic you don't fully trust, such as user-submitted webhook handlers, plugin scripts, spreadsheet-style formulas and tools for AI agents. The compiler is about 48 KB minified, and the project is early (language version 0.2).
Key features
- No eval, constructors, globals or prototype access
- Compiles to JavaScript and PHP
- Capability declarations in each .safe file
- Deterministic Math.random by default
- About 48 KB minified compiler
Use cases
Show all 8Show fewer
Alternatives
Last updated 2026-11-09