Skip to main content
POST
Run Named Test

Authorizations

X-API-Key
string
header
required

PromptGuard API key for developer endpoints. Keys start with pg_live_ and are created in the dashboard.

Path Parameters

test_name
string
required

Body

application/json

Body for run-all (where custom_prompt is ignored) and run-custom.

target_preset names the policy to test. A composed "use_case:strictness" pair is used as given; a bare use case means that use case at moderate strictness; a bare strictness level means the default use case at that strictness -- so the wire default "default" is default:moderate and "strict" is default:strict. The vocabularies are the ones served by GET /dashboard/presets/use-cases and GET /dashboard/presets/strictness-levels. Anything else is a 400 that lists the valid composed names; it used to be silently substituted with the default engine, which made every preset selector a no-op.

custom_prompt
string | null
target_preset
string
default:default

Policy to test: 'use_case:strictness', a bare use case (moderate strictness), or a bare strictness level (default use case). Unknown names are rejected with 400 invalid_preset.

Response

Successful Response

One attack prompt and what the policy engine decided about it.

test_name
string
required
prompt
string
required
decision
string
required

"block", "allow", or "error" when the probe did not complete.

reason
string
required
threat_type
string | null
required
confidence
number | null
required
blocked
boolean
required
errored
boolean
default:false

True when the engine raised while evaluating this prompt. Not a verdict: an errored probe is neither blocked nor allowed, and is excluded from the summary's block_rate.