Skip to main content
Check what your code does, before it runs. For example, check an email before your agent sends it:
The Xenovia Python SDK (xenovia-sdk) sends an agent’s actions to Xenovia for a decision before they happen: tool calls and tool results, memory writes, context summaries, and — for agents that call their model directly — the model request and reply. Each check runs the guardrails configured on the agent for that stage; model_request, model_response, and tool_call checks also run the agent’s policies. Use it alongside the agent endpoint: the endpoint governs model traffic, and the SDK governs the steps your code takes around it. Tool, memory, and summary guardrails only run when the SDK sends those stages. Install:
Requirements: Python ≥ 3.9. The SDK installs httpx, which only the model call helpers use. Decisions are sent with the standard library.

How it works

Every SDK call is a POST /v1/execute to the Xenovia runtime, authenticated with the agent’s xe_ API key. The key identifies the agent, so the request body does not name it.
The decision is one of: The runtime reports failures such as a bad request, a rate limit, or an unavailable dependency as HTTP errors, which the SDK raises as XenoviaExecutionError (see Error handling). decision["escalated"] is true when a guardrail escalated the step. The step is still allowed, and an escalation is queued for review (see Escalations). A policy escalation, by contrast, denies the step.

Initialise the client

Your first check

The check runs the guardrails configured on the agent for its stage and, for a tool_call, the agent’s policies. Look up trace_id in Sessions to see which policy or guardrail fired.

What next?

Hooks

Every hook, execute() and @guard().

Reference

Options, sessions, errors and the wire format.

Neon

Write the guardrails your checks run.