Skip to main content

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.

Pipeline vs metrics API

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

OutputRequirement
Results overviewTest exists in your org; evaluation finished (status is completed or evaluation_failed)
RecommendationsRows stored in policy_recommendations (created after evaluation, or via POST /tests/{id}/recommendations/generate)
Report PDFReport 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

GET test results overview
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

FieldTypeDescription
test_idstring (UUID)Test identifier
created_atstring (ISO 8601)Test creation time
statusstring or nullTest status (e.g. completed)
summaryobjectOverall total, passed, failed, pass_rate
certificationsarrayGroups 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

Results overview (trimmed)
{
"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 (detail explains 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

ParameterDefaultDescription
limit10Maximum number of rows returned (UI-style list)
limit0Return all stored recommendations (export)
sortpass_rate_ascpass_rate_asc or pass_rate_desc

When limit is greater than 0, it is capped at 500.

Request (UI list)

GET top recommendations
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)

GET all recommendations
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

FieldTypeDescription
recommendationsarrayRecommendation objects
countintegerLength 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 (trimmed)
{
"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

POST generate report (ReportLab)
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

GET report status
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

GET report download
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

  1. Run a test to completion (SDK generate_and_run_test, or the app UI).
  2. GET /tests/{test_id}/results — metrics overview.
  3. GET /tests/{test_id}/recommendations?limit=0 — full recommendation export.
  4. POST /tests/{test_id}/report/generate-reportlab → poll GET …/report/statusGET …/report/download — PDF report.
Python SDK

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.