VindexDocs

Concepts

Dry-run & policy_version

A dry run makes a real decision and enforces none of it. Use it to try a prompt, or a policy version that isn't live yet, on real traffic.

X-Vindex-Dry-Run

Add X-Vindex-Dry-Run: true to POST /v1/check:

Shell
curl https://api.getvindex.com/v1/check \
  -H "Authorization: Bearer $VINDEX_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Vindex-Dry-Run: true" \
  -d '{"input": {"prompt": "a lighthouse at dusk, oil painting"}}'

The prompt is screened and the decision is logged and returned as usual, with dry_run: true. Then nothing acts on it:

  • no review item is opened;
  • no webhook is sent;
  • Explain adds "(Dry run: not enforced.)" to its summary.
Explain (excerpt)
{
  "id": "dec_d740b79c52a14f44a8a570f0fbf047e8",
  "outcome": "block",
  "dry_run": true,
  "summary": "Blocked by adult (checks.adult.on_act). Score 0.91 reached the act line 0.35, so checks.adult.on_act applied: block. (Dry run: not enforced.)",
  "actions": {
    "review_id": null,
    "webhook_events": [],
    "webhooks_suppressed": null,
    "tags": [],
    "ran": [
      "Dry run: nothing was enforced, no review item was opened and no webhooks were sent."
    ]
  }
}

Dry runs still count toward usage, under the key's mode. The decision log includes them unless you pass dry_run=false.

policy_version

policy_version screens against one version of a policy, published or not, instead of its current one. It only works on a dry run: a draft can never decide for real.

Shell
# Version 2 of your default policy, before you publish it
curl https://api.getvindex.com/v1/check \
  -H "Authorization: Bearer $VINDEX_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Vindex-Dry-Run: true" \
  -d '{"input": {"prompt": "a lighthouse at dusk, oil painting"}, "policy_version": 2}'

Add "policy": "pol_…" to pin a version of another policy. Without the header, the API refuses:

400 policy_version_requires_dry_run
{
  "type": "https://api.getvindex.com/problems/policy_version_requires_dry_run",
  "title": "Invalid request",
  "status": 400,
  "detail": "`policy_version` screens against a version that may not be live, so it needs `X-Vindex-Dry-Run: true`.",
  "code": "policy_version_requires_dry_run"
}

To compare two versions, send the same prompt with each and compare the outcomes. The dashboard's Playground does exactly this for a whole file.