Lua
Lua is Rival’s fastest-starting language for Function tools — ideal for lightweight logic with minimal dependencies. The runtime is a strict sandbox: file I/O, module imports, and dynamic code execution are disabled.
Handler
Section titled “Handler”Define a global cortexone_handler in cortexone_function.lua, accepting event and context and returning a table with statusCode and body.
Available
Section titled “Available”- A pre-loaded
jsonmodule for encoding/decoding. os.time()for Unix timestamps.- Standard Lua libraries:
string,table,math. - Environment variables via
process.envfor secrets. - Conditional HTTP through
fetch(), which returns a structured response table (not a string).
Restricted
Section titled “Restricted”File I/O, module imports, dynamic code execution, and most OS access are disabled — specifically the io module, require(), package, dynamic loaders, and most os functions.
Limits
Section titled “Limits”512 MB memory, 300-second runtime, 2.0-core CPU. Runtime failures are automatically wrapped with a 500 status code.