Stof Runs AI-Generated Logic Safely Inside Applications
Summary
Stof is an open-source runtime for executing logic that an application does not own or fully trust. It represents a document as JSON with functions, then instantiates that document in a small WebAssembly environment whose functions are restricted to the document itself and cannot access or manipulate anything outside it. The project is designed to be easier to transmit than conventional WebAssembly binaries and to retain JSON compatibility, while serving as a glue layer between data and distributed systems rather than replacing an existing data format. It supports interchange formats such as JSON, YAML, and TOML, as well as complex structured and unstructured data including PDFs, images, and binaries. Its stated motivation is that dynamic software increasingly needs runtime composition, while adapters compiled at build time can be too rigid. Stof applies this model to AI-generated data and code, treating them like calls into an untrusted service: developers can embed execution, choose where it runs, combine execution harnesses with data, and use a document as living context. JSON sections can be parsed or stringified at runtime for uses such as agent tool definitions. A browser playground runs entirely client-side. The runtime is written in Rust and currently supports JavaScript/TypeScript and Python. The creator is seeking feedback on whether the concept and documentation are clear from the landing page.