Variables
Dynamic variables are named placeholders in an agent’s prompt, first message, and webhook tool configs. You supply concrete values at session start, so one agent definition serves many customers, tenants, or contexts — you change the values, not the agent.
To set them up, see Add variables.
Types
Interpolation
Reference a variable with double braces in the prompt, first message, or webhook tool config (URL, headers, body):
{{key}}— plain interpolation. Numbers and booleans are stringified;jsonvalues render as their JSON text.{{key|json}}— JSON-encoded. The value is serialized (quoted and escaped), so it’s safe inside a JSON body.
Inside a JSON tool body, always use the |json form. Without it, a value like alice"malicious breaks the surrounding JSON:
Reserved system variables
The platform populates these at session start. You can’t define or override them — any key starting with system__ is rejected.
GET /v1/agents/{id}/variables returns system_variables — the same catalog — so an editor UI can list them without hard-coding.
Precedence
When the platform resolves a variable at session start, later sources win:
- Agent default — the
defaulton the variable definition. - Session override — values in
dynamic_variableson the conversation or session create call. - Reserved
system__*— platform values always win and can’t be shadowed.
Limits
A typo in a template reference never breaks dispatch — the token resolves to an empty string. Use GET /v1/agents/{id}/variables to confirm the keys your prompt references exist.
Coming soon: tool-response assignment will let a variable update mid-call from data a tool returns, accumulating context across turns.