Test outputs (results, recommendations, report)
After a Redraven test is evaluated, you can read metrics, policy recommendations, and the PDF report over HTTP. These endpoints do not return per-case prompts or full LLM transcripts.
See Authentication for headers and base URL. Replace {test_id} with your test UUID.
The Python SDK eval flow uses GET /tests/{id}/results/summary?kind=eval and GET /tests/{id}/results/cases for pipeline materialization. The endpoints on this page are the stable read APIs for dashboard metrics, recommendation export, and report download.
Prerequisites
| Output | Requirement |
|---|---|
| Results overview | Test exists in your org; evaluation finished (status is completed or evaluation_failed) |
| Recommendations | Rows stored in policy_recommendations (created after evaluation, or via POST /tests/{id}/recommendations/generate) |
| Report PDF | Report generated (POST /tests/{id}/report/generate-reportlab or Generate Report in the app), then GET /tests/{id}/report/status shows ready: true |
Test results overview
GET {base}/api/v1/tests/{test_id}/results
Returns pass/fail totals and pass rates grouped by certification and policy. No request/response text for individual test cases.
When to use
- Export or integrate the same metrics shown on the test results page in the Redraven app
- Automate compliance dashboards without pulling case-level artifacts
Request
curl -sS \
-H "X-API-Key: ${REDRAVEN_API_KEY}" \
-H "X-Organization-Id: ${REDRAVEN_ORGANIZATION_ID}" \
"${REDRAVEN_BASE_URL}/api/v1/tests/{test_id}/results"
Response
| Field | Type | Description |
|---|---|---|
test_id | string (UUID) | Test identifier |
created_at | string (ISO 8601) | Test creation time |
status | string or null | Test status (e.g. completed) |
summary | object | Overall total, passed, failed, pass_rate |
certifications | array | Groups per certification, each with summary and policies[] |
pass_rate on this endpoint
pass_rate values are fractions between 0.0 and 1.0 (for example 0.85 means 85%). This differs from raw aggregated_policies storage (integer 0–100) and from recommendation pass_rate (see below).
Example response
{
"test_id": "11111111-1111-1111-1111-111111111111",
"created_at": "2025-06-01T12:00:00Z",
"status": "completed",
"summary": {
"total": 100,
"passed": 85,
"failed": 15,
"pass_rate": 0.85
},
"certifications": [
{
"certification": "EU AI Act",
"summary": {
"total": 60,
"passed": 50,
"failed": 10,
"pass_rate": 0.8333333333333334
},
"policies": [
{
"name": "Policy A",
"total": 30,
"passed": 28,
"failed": 2,
"pass_rate": 0.9333333333333333
}
]
}
]
}
Errors
- 404 — Test not found, or evaluation not finished / no aggregate data yet (
detailexplains wait for evaluation)
Recommendations
GET {base}/api/v1/tests/{test_id}/recommendations
Returns stored FireGuard-style policy recommendations generated from failing policies on the test.
Query parameters
| Parameter | Default | Description |
|---|---|---|
limit | 10 | Maximum number of rows returned (UI-style list) |
limit | 0 | Return all stored recommendations (export) |
sort | pass_rate_asc | pass_rate_asc or pass_rate_desc |
When limit is greater than 0, it is capped at 500.
Request (UI list)
curl -sS \
-H "X-API-Key: ${REDRAVEN_API_KEY}" \
-H "X-Organization-Id: ${REDRAVEN_ORGANIZATION_ID}" \
"${REDRAVEN_BASE_URL}/api/v1/tests/{test_id}/recommendations?limit=10&sort=pass_rate_asc"
Request (export all)
curl -sS \
-H "X-API-Key: ${REDRAVEN_API_KEY}" \
-H "X-Organization-Id: ${REDRAVEN_ORGANIZATION_ID}" \
"${REDRAVEN_BASE_URL}/api/v1/tests/{test_id}/recommendations?limit=0&sort=pass_rate_asc"
Response
| Field | Type | Description |
|---|---|---|
recommendations | array | Recommendation objects |
count | integer | Length of recommendations |
Each recommendation includes id, redraven_policy_id, redraven_policy_text, certification, pass_rate, test_cases_total, test_cases_failed, fireguard_policy, created_at.
pass_rate on recommendations
pass_rate here is stored in database format (typically 0–100 as a percentage, e.g. 42 for 42%). It is not the 0.0–1.0 fraction used on the results overview endpoint.
Example response
{
"recommendations": [
{
"id": "22222222-2222-2222-2222-222222222222",
"redraven_policy_id": "policy-hash-id",
"redraven_policy_text": "Do not disclose internal credentials.",
"certification": "EU AI Act",
"pass_rate": 42,
"test_cases_total": 12,
"test_cases_failed": 7,
"fireguard_policy": {
"name": "Block credential disclosure",
"description": "Reject requests that ask for secrets.",
"criticality": "HIGH",
"violation": true,
"metadata": {}
},
"created_at": "2025-06-01T14:00:00Z"
}
],
"count": 1
}
Report download
The report is a PDF file, not JSON. Generate it first, poll status, then download bytes.
Step 1 — Generate report
curl -sS -X POST \
-H "X-API-Key: ${REDRAVEN_API_KEY}" \
-H "X-Organization-Id: ${REDRAVEN_ORGANIZATION_ID}" \
"${REDRAVEN_BASE_URL}/api/v1/tests/{test_id}/report/generate-reportlab"
You can also use Generate Report on the test results page in the Redraven app.
Step 2 — Poll until ready
curl -sS \
-H "X-API-Key: ${REDRAVEN_API_KEY}" \
-H "X-Organization-Id: ${REDRAVEN_ORGANIZATION_ID}" \
"${REDRAVEN_BASE_URL}/api/v1/tests/{test_id}/report/status"
Proceed when ready is true (and optionally file_id is set).
Step 3 — Download PDF
curl -sS -o report.pdf \
-H "X-API-Key: ${REDRAVEN_API_KEY}" \
-H "X-Organization-Id: ${REDRAVEN_ORGANIZATION_ID}" \
"${REDRAVEN_BASE_URL}/api/v1/tests/{test_id}/report/download"
The response body is binary PDF data with Content-Disposition: attachment. Do not parse it as JSON.
Errors
- 404 — Report not generated or file missing in storage
End-to-end flow
- Run a test to completion (SDK
generate_and_run_test, or the app UI). GET /tests/{test_id}/results— metrics overview.GET /tests/{test_id}/recommendations?limit=0— full recommendation export.POST /tests/{test_id}/report/generate-reportlab→ pollGET …/report/status→GET …/report/download— PDF report.
The SDK does not yet ship typed helpers for these three read routes. Use curl or httpx with the same REDRAVEN_API_KEY, REDRAVEN_ORGANIZATION_ID, and REDRAVEN_BASE_URL as in the Python SDK guide.