---
title: "Test Policy Route"
method: POST
path: "/api/v1/policies/test"
tags: ["policies"]
---

# Test Policy Route

`POST /api/v1/policies/test`

## Request

- Base URL: `https://cp.xenovia.io` (the document declares no server; this is the origin it was published from)
- URL: `https://cp.xenovia.io/api/v1/policies/test`
- Auth: none declared

Run a rule against sample inputs, wrapped as the runtime wraps it. For
a person, Nova and the reviewer; stores nothing. 503 ``opa_unavailable``
without the opa binary.

## Headers

- `Authorization` string, nullable

## Request body

- PolicyTestRequest
  - `rego` string, required
  - `stage` 'model_request' | 'model_response' | 'tool_call' | 'tool_result', required
  - `inputs` PolicyTestInput[]
    - `name` string, required
    - `input` object, required
    - `expect` 'allow' | 'block' | 'redact' | 'escalate', required

## Response `200`

Successful Response

- PolicyTestResponse
  - `compile_errors` string[], required
  - `results` PolicyTestResult[], required
    - `name` string, required
    - `decision` 'allow' | 'block' | 'redact' | 'escalate' | 'undefined', required
    - `passed` boolean, required
    - `detail` string, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-04** `b475b750a0b7`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/xenovia/apis/controlplane/changes/api/v1/policies/test/post.md)

---

[API](https://skmtc.dev/xenovia/apis/controlplane.md) - [All operations](https://skmtc.dev/xenovia/apis/controlplane/llms.txt) - [OpenAPI document](https://skmtc.dev/xenovia/apis/controlplane/revisions/3e25bef24f8f?raw)
