Chapter III · The standard library / Lesson 18 of 27

The sandbox

You'll learn: See what's blocked by default — the reason this VM is agent-ready.

This playground runs in a sandboxed VM: dangerous functions like os.execute, io.open, require, and load are stubbed to raise. Those are the libraries a host application typically locks down before exposing a scripting surface to users or LLMs. *Chapter IV* shows how to expose your *own* safe functions back into Lua.

sandbox.lua
Output idle
Hit Run to execute.
Try it: Try your own escape — io.open('/etc/passwd', 'r') or require('os'). Same outcome. Now check the *Embedding* lesson to see how to allow specific paths through.