Skip to main content

Setup

Streaming

Streaming works without any additional configuration. The runtime stamps X-Xenovia-Session-Id and X-Xenovia-Trace-Id into the response headers before the first byte.

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.
If a tool name matches a block rule in your Rego policy, the request returns 403 before reaching the upstream LLM.

Sessions

Pass X-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.
If you omit the header, Xenovia resolves a session automatically using message fingerprinting or the user field. See Runtime Architecture for the full five-strategy chain.

Forwarding the simulation session

Simulation sends your agent an X-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.
Pass it per call, not in 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 20 X-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 returns 403 Forbidden. The OpenAI SDK raises this as PermissionDeniedError. The X-Xenovia-Trace-Id response header identifies the blocking trace.

Reading trace headers

The response always includes trace headers you can log for correlation: