Skip to main content
This walks through one complete red team run: submit, track, and read the results. For target configuration across different providers, see the GET Defaults API response and Testing Models Across Providers.

Install required libraries

Shell

Set up your credentials

Sign up on the dashboard and create an API key. Export the keys as environment variables:
Shell

Step 1 — Submit a run

The payload has three parts: the target to test, the risk_categories to test for (with the attacks to use), and an optional context describing your system.
The response is 202 Accepted. Nothing has run yet — you have a handle to a queued job:
JSON
The status_url, results_url and websocket_url values are returned as upstream /v1/... paths. Call them on the public API under the /rt/ prefix — for example GET https://api.enkryptai.com/rt/runs/{run_id}.

Step 2 — Track the run

Poll GET /rt/runs/{run_id} until it reports a terminal state. Its status values are lowercase: queued, running, paused, completed, failed, cancelled. The terminal three are completed, failed and cancelledpaused is not terminal, and a paused run resumes.
JSON
On failure, the error object carries the reason.
One run, two status vocabularies. Which one you get depends on the endpoint you asked, because they read different tables:A finished run therefore reports "completed" on the status endpoint and "Finished" on the results and records endpoints. This is deliberate, not a bug: the two are different pieces of state that happen to share a field name, and collapsing them is what once made every completed run’s results unreachable. Match against the vocabulary of the endpoint you called — a poll loop waiting for "Finished" on GET /rt/runs/{run_id} never exits.The Python SDK papers over the difference for you: RTRunStatus.state folds completed onto finished, and is_terminal is true for either.
Prefer not to poll? GET /rt/runs/{run_id}/stream delivers live progress events for the same run. See Stream Run Events.

Step 3 — Read the results

Results are scored as attack success rate (ASR) — the percentage of adversarial prompts that got through. Lower is better.
JSON
overall_asr and every asr are percentages from 0 to 100. coverage reports the fraction of the requested scope that actually ran.

Step 4 — Drill into individual results

The summary tells you what failed. The records tell you how.
Each record carries the prompt sent, the response received, the judge’s verdict and its reasoning:
JSON
success: true means the attack succeeded — your target produced the content it should have refused. These are the rows to investigate first.

Next steps

Map to a compliance framework

GET /rt/runs/{run_id}/compliance/{framework_id} re-expresses the same run against OWASP LLM Top 10, EU AI Act, NIST AI RMF, MITRE ATLAS, ISO 42001 or AIUC-1.

Get remediation

POST /rt/risk-mitigation/system-prompt turns a run summary into a hardened system prompt; /rt/risk-mitigation/guardrails-policy turns it into a Guardrails policy.

Widen the attack surface

basic is only the baseline. Add evasion and adaptive jailbreak techniques.

Check your target first

POST /rt/model-health verifies Enkrypt AI can reach and call your target before you spend a run on it.