Skip to main content
An agent’s published configuration is shared by every caller — but each session can be personalized at creation time. Two mechanisms cover this, and both travel in the same POST /v1/agent/sessions request:

Dynamic variables

Write {{variable_name}} placeholders in your agent’s system prompt or first message and supply values when you create the session. Substitution happens once, when the published configuration is assembled for the session.
System prompt
Pass values as a flat object of strings, numbers, or booleans. Variable names must match [A-Za-z][A-Za-z0-9_]* (no hyphens or dots), string values are capped at 1,000 characters, and a request can carry at most 50 variables — violations reject session creation with 422:
Placeholders with no matching variable are not removed — the literal {{variable_name}} text stays in the prompt, visible to the model. Make sure every placeholder in your configuration has a value at session creation.
Session records never store dynamic variable values.
You don’t need a variable for the current date or time — the agent already knows both, in the session’s timezone. See Time & timezone.

Overrides

Overrides replace configuration fields wholesale for one session — for example, forcing a different language for a caller. Because they change agent behavior, each agent declares which fields callers may override; everything else is rejected.

The language shorthand

Overriding the session language is common enough that the request accepts a top-level language field as shorthand for overrides.language. Both forms pass through the same allowlist gate — if language is not overridable on the agent, both are rejected.

Validation

The session record stores which overrides took effect.

Who supplies the values

Where variables and overrides come from depends on how the session is authenticated: In sessionToken mode the SDK’s overrides, dynamicVariables, and language options have no effect — the session already exists by the time the token reaches the browser. Attach personalization server-side instead:
Backend (sessionToken mode)
In agentId mode, values arrive from the end user’s browser — treat them as untrusted input. Keep the override allowlist limited to fields you are comfortable letting anyone set, and use sessionToken mode when personalization must come from data only your backend knows.

Going further

Agent configuration

The fields your placeholders and overrides act on.

Authentication

API keys, session tokens, and the two session modes.

Versions & publishing

Sessions assemble the published configuration.

Web SDK

Every AgentSession.start() option.