---
title: "Test Policy Template"
method: POST
path: "/policy/templates/test"
tags: ["policies"]
---

# Test Policy Template

`POST /policy/templates/test`

Test a policy template's guardrails against a text input without creating them.

Instantiates temporary guardrails from the template definitions, runs them
against the provided text, and returns per-guardrail results so users can
verify the template solves their problem before creating it.

## Request body

- TestPolicyTemplateRequest
  - `guardrail_definitions` object[], required — All guardrailDefinitions from the policy template
  - `text` string, required — Test input text to run guardrails against

## Response `200`

Successful Response

- TestPolicyTemplateResponse
  - `overall_action` string, required
  - `results` GuardrailTestResultEntry[], required
    - `action` string, required
    - `details` string, required
    - `guardrail_name` string, required
    - `output_text` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/flock/apis/litellm-api.md) · [All operations](https://skmtc.net/flock/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/flock/litellm-api/revisions/8fbaab4fc7c5/schema)
