---
title: "Test Pipeline"
method: POST
path: "/policies/test-pipeline"
tags: ["Policies"]
---

# Test Pipeline

`POST /policies/test-pipeline`

Test a guardrail pipeline with sample messages.

Executes the pipeline steps against the provided test messages and returns
step-by-step results showing which guardrails passed/failed, actions taken,
and timing information.

Example Request:
```bash
curl -X POST "http://localhost:4000/policies/test-pipeline" \
    -H "Authorization: Bearer <your_api_key>" \
    -H "Content-Type: application/json" \
    -d '{
        "pipeline": {
            "mode": "pre_call",
            "steps": [
                {"guardrail": "pii-guard", "on_pass": "next", "on_fail": "block"}
            ]
        },
        "test_messages": [{"role": "user", "content": "My SSN is 123-45-6789"}]
    }'
```

## Request body

- PipelineTestRequest — Request body for testing a guardrail pipeline with sample messages.
  - `pipeline` object, required — Pipeline definition with 'mode' and 'steps'.
  - `test_messages` object[], required — Test messages to run through the pipeline, e.g. [{'role': 'user', 'content': '...'}].

## Response `200`

Successful Response

- unknown

## 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)
