LuaAgent is the object your project exports from src/index.ts: it names the agent, holds its persona and model, and registers every primitive the compiler bundles. lua compile looks for new LuaAgent({ … }) in index.ts, src/index.ts, agent.ts, src/agent.ts, main.ts, then src/main.ts, and compiles only the primitives referenced from that object’s arrays. Pass the config as an object literal directly to the constructor; a config held in a variable isn’t traversed, so its primitives aren’t compiled.
Verified against lua-cli 3.33.0.
Quick example
src/index.ts
lua push agent uploads this configuration; the primitives in the arrays are pushed with their own lua push <type> commands or together with lua push all.
Constructor
personais an object with none ofbase,voice,text:Agent persona object must have at least one of: base, voice, textmodelSettings.temperatureis outside 0 to 2:Agent modelSettings.temperature must be between 0 and 2modelSettings.topPis outside 0 to 1:Agent modelSettings.topP must be between 0 and 1modelSettings.maxOutputTokensis less than 1:Agent modelSettings.maxOutputTokens must be >= 1temperature,topP,topK,maxOutputTokens,presencePenalty,frequencyPenalty, orseedis not a finite number:Agent modelSettings.<key> must be a finite numbermodelSettings.stopSequencesis not an array of strings:Agent modelSettings.stopSequences must be a string arraymodelSettings.reasoningis not an object, itseffortis not one of the six values, or itsshowis not a boolean:Agent modelSettings.reasoning must be an object,Agent modelSettings.reasoning.effort must be one of: off, minimal, low, medium, high, max,Agent modelSettings.reasoning.show must be a boolean
name and a string persona are not validated; lua compile warns Agent should have a persona when the persona is empty.
Configuration
Fields ofLuaAgentConfig, in declaration order.
string
required
Agent name shown in the compiled manifest and in CLI output. The platform identifies the agent by the
agentId in lua.skill.yaml, not by this name.string
Summary of what the agent can do, read by a Space when deciding whether to route a request to this agent. The persona owns tone and behavior. Omit it to leave any description set in the admin dashboard untouched; set
'' to clear it on the next lua push agent.PersonaText
required
The prompt text that defines who the agent is and how it behaves. A string, or
{ base?, voice?, text? } where base is rendered on every channel, voice is appended in voice sessions, and text is appended on text channels. An object needs at least one key.LuaAgentModel
A model code such as
'openai/gpt-5.4' (list them with lua models list), or a model resolver (request: LuaRequest) => string | Promise<string> that runs on every request with every runtime object available. Omit it to use the platform default model.AgentModelSettings
Sampling settings sent with every model call. A key left out keeps the provider’s default.
reasoning is the agent-level default; a per-request override wins.LuaWorkflow[]
default:"[]"
Workflows built with
createWorkflow or defineWorkflow. Tools referenced by a workflow’s tool steps are compiled through this array too.PreProcessor[]
default:"[]"
Preprocessors, run before a message reaches the model.
PostProcessor[]
default:"[]"
Postprocessors, run on the reply before it is sent.
LuaMCPServer[]
default:"[]"
LuaDeviceTrigger[]
default:"[]"
Standalone device triggers.
LuaVoice[]
Voices the agent can answer with. A channel picks one in its channel configuration; without a binding the first entry is used.
BatchingConfig
Message batching for this agent. A key left out falls back to the platform default.
GovernanceConfig
Governance policy for tool calls, preprocessors, and postprocessors. The credential for
'api' mode is read from the GOVERNANCE_API_KEY environment variable, never from this object.boolean | BrowserSwitchConfig
Browser tools for the agent, off by default.
true turns them on with platform defaults; an object adds policy.Methods
Read-only getters that return what was passed to the constructor.
There is no getter for
deviceTriggers or governance.
Types
LuaAgentConfig, LuaAgentModel, PersonaText, AgentModelSettings, and LuaRequest are exported types. BatchingConfig, GovernanceConfig, and BrowserSwitchConfig are declared inline; derive them from the config type.

