Session metadata
The keys the agent reads or writes on session.metadata, who owns each, and how they surface in traces.
Context —
session.metadatais one JSON object per session, shared between your integration and the agent. You may store anything in it; this page lists the keys the agent itself reads or writes, so the two never collide.
Ownership
event_webhook_url, session_key
you
Set them at session creation (or via the metadata update endpoint) to opt into the behaviour each one drives.
agent_glossary_log, agent_handoff, autonomous_run_id, event_webhook_hwm, max_engine_iterations_reached, max_engine_iterations_value, routine_id, step_outputs, webhook_match, webhook_name
the agent
Runtime state the agent writes during a conversation or an autonomous run. Setting one of these yourself is accepted — existing integrations keep working — but logged as a warning, and the agent may overwrite it.
agent_*
the agent
Reserved for future agent-written keys; never use this prefix for your own.
Every other key is yours and is never read, written, or interpreted by the agent. Keys and values are persisted with the session and returned verbatim by the sessions API.
Where the keys surface
session_keynames the conversation in traces: the trace name is<agent>: <session_key> (turn: N)and every turn of the conversation groups under the session<agent>: <session_key>. Without it the first 8 characters of the opaque session id are used.event_webhook_urlturns on real-time delivery of conversation events to that URL, unlessagent_config.event_webhook.urloverrides the destination. Selected metadata keys can also be included throughevent_webhook.include.session_metadata.Each trace carries a
sessionblock ({id, key, kind}) and atriggerblock derived from these keys — see the observability guide.
Fields
The keys on session.metadata that carry meaning for the agent; every other key is the integration's and passes through untouched.
session_key
string
no
null
Integration-set stable identifier for the conversation (a ticket id). Names the trace and groups its turns into one session; the server-generated session id is opaque.
event_webhook_url
string
no
null
Integration-set URL that receives each conversation event as it is emitted, in addition to the polling stream.
event_webhook_hwm
integer
no
null
Engine: offset of the last event delivered to event_webhook_url.
autonomous_run_id
string
no
null
Engine: marks the session as hosting an autonomous routine run.
routine_id
string
no
null
Engine: the routine an autonomous run executes.
webhook_match
boolean
no
null
Engine: marks the short-lived session the webhook matcher reasons in; deleted after the delivery is dispatched.
webhook_name
string
no
null
Engine: the manifest webhook a matcher session belongs to.
step_outputs
object
no
null
Engine: think-step outputs of an autonomous run, keyed by step id, read by downstream steps.
agent_handoff
object
no
null
Engine: human-handoff intent recorded by built-in:initiate_human_handoff — {reason, internal_note, customer_message, silent, metadata}. Written once per session (first write wins). internal_note is staff-facing; customer_message was already emitted as the turn's reply (or nothing was, when silent). The integration attaches the note and commits channel-side effects on the turn's ready status.
agent_glossary_log
list[object]
no
null
Engine: the glossary terms the conversation has retrieved, in the order they entered it — [{term_id, anchor}], anchor being the offset of the last event when the term entered. Prompts show each term from that point of the conversation on.
max_engine_iterations_reached
boolean
no
null
Engine: the turn hit the per-turn iteration cap.
max_engine_iterations_value
integer
no
null
Engine: the cap that was hit.
Last updated
Was this helpful?

