Setup
- Python
- Node.js
Streaming
Streaming works without any additional configuration. The runtime stampsX-Xenovia-Session-Id and X-Xenovia-Trace-Id into the response headers before the first byte.
- Python
- Node.js
Tool calling
Tool definitions pass through unchanged. Xenovia records tool call names and arguments in the trace and evaluates them against your request-stage Rego policy before forwarding.403 before reaching the upstream LLM.
Sessions
PassX-Xenovia-Session-Id (a valid UUID) to group related calls into a session. During a simulation, forward the value Xenovia sent instead (see Forwarding the simulation session). All turns under that session ID appear together in Sessions with a per-session turn counter.
- Python
- Node.js
user field. See Runtime Architecture for the full five-strategy chain.
Forwarding the simulation session
Simulation sends your agent anX-Xenovia-Session-Id header with every turn. Pass it, unchanged, on each model call made for that turn, so Xenovia can grade a scenario’s tool and instruction-leak checks and apply the run’s provider and mode. On the Xenovia cloud runtime it is a signed value (xsim1.…), not a UUID; don’t parse, trim or replace it, because a changed value is rejected with 400.
- Python
- Node.js
default_headers on a shared client: a fixed header sends the same session on every request, so concurrent conversations would be merged into one session and graded together.
Custom trace properties
Attach up to 20X-Xenovia-Property-* headers to tag traces with application context. Keys must be ≤ 64 chars; values ≤ 512 chars; the policy_ prefix is reserved.
Policy blocks
When a request is blocked by policy, the runtime returns403 Forbidden. The OpenAI SDK raises this as PermissionDeniedError. The X-Xenovia-Trace-Id response header identifies the blocking trace.
- Python
- Node.js