Thanks for your answer.
Andrew> How do you define "harmful" for your environment? And what features do
Andrew> you want sandboxed code to be able to use?
I want to prevent the script from reading or modifying something on the computer it is running. So, no access to file system, no access to sockets, etc. I am not interested in preventing denial of service. So 100% CPU usage, memory exhaution, etc. is not a real issue for me.
The script must be able to perform basic language stuff (assigning/reading variables, structure control (if-then-else, loops, etc.), string manipulation, etc. It will retrieve its inputs and provide its outputs from dedicated functions written in another language and explicitly provided to the script (C functions registered by lua_register).
Andrew> Some of the base functions are essentially part of the language -
Andrew> especially select(), pairs(), ipairs(), type(), pcall(), error(),
Andrew> assert(), tonumber(), tostring(). Without at least those, writing any
Andrew>
nontrivial code will be hard.