# Send verdicts to Provenance

For risk providers whose customers use Provenance. Push verdicts with the key a customer gives you, answer signed lookups within the timeout, or serve a list, all in one verdict format.

Use this page to deliver your verdicts to a company that uses Provenance. The company adds you as a risk provider in its account and chooses how verdicts arrive: you push them, Provenance looks them up on your endpoint, or you serve a list. Verdicts stay inside that company's account and are used only by its rules.

**Before you begin:** the company adds you in **Settings → Agents → Risk signals** and gives you what your kind needs: a push key, or the secret it set for your lookup endpoint, or the URL of your list.

## 1. Use the verdict format

Every kind uses the same verdict:

```json
{
  "entity": { "kind": "origin", "value": "https://login-lumen.example" },
  "risk": "high",
  "categories": ["phishing", "impersonation"],
  "observed_at": "2026-10-27T09:00:00Z",
  "expires_at": "2026-11-26T09:00:00Z",
  "reference": "case-4821"
}
```

| Field | Rules |
| --- | --- |
| `entity.kind` | `domain`, `origin`, `agent`, `agent_key` (a key's JWK SHA-256 thumbprint), `account` or `email_domain`. |
| `entity.value` | Normalized on arrival: a host in lower case (IDN to punycode), an origin as `scheme://host[:port]`, an email address to its domain. |
| `risk` | `none`, `low`, `medium`, `high` or `critical`. `none` withdraws an earlier verdict. |
| `categories` | `phishing`, `impersonation`, `fraud`, `compromised`, `shell_site`, `laundering`, `malware`, `spam` or `other`. Anything else becomes `other`. |
| `observed_at` | ISO 8601; defaults to now and can't be in the future. |
| `expires_at` | ISO 8601; defaults to 30 days after `observed_at`. An expired verdict is never used. |
| `reference` | Your reference, up to 512 characters. |

A later verdict for the same entity replaces the earlier one.

## 2. Push verdicts

Send up to 1,000 verdicts per request to [`POST /v1/mandate/risk_signals`](https://provenanceauth.com/docs/api/risk-signals.md#post-v1-mandate-risk-signals) with the push key the company gave you, here in `PUSH_KEY`. The key can only call this endpoint.

**curl**

```bash norun
curl -s -X POST https://sandbox-api.provenanceauth.com/v1/mandate/risk_signals \
  -H "Authorization: Bearer $PUSH_KEY" -H "Content-Type: application/json" \
  -d '{ "signals": [ { "entity": { "kind": "domain", "value": "shell-shop.example" }, "risk": "medium", "categories": ["shell_site"] } ] }'
```

**Node**

```ts
const batch = await fetch("https://sandbox-api.provenanceauth.com/v1/mandate/risk_signals", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PUSH_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ signals: [{ entity: { kind: "domain", value: "shell-shop.example" }, risk: "medium", categories: ["shell_site"] }] }),
}).then((r) => r.json());
```

**Python**

```python
batch = httpx.post("https://sandbox-api.provenanceauth.com/v1/mandate/risk_signals", headers={"Authorization": f"Bearer {os.environ['PUSH_KEY']}"}, json={
    "signals": [{"entity": {"kind": "domain", "value": "shell-shop.example"}, "risk": "medium", "categories": ["shell_site"]}],
}).json()
```

```json
{
  "object": "risk_signal_batch",
  "accepted": 1,
  "rejected": 0,
  "errors": []
}
```

Each verdict is checked on its own. Invalid ones come back in `errors` with their `index`, the `param` at fault and a message; the valid ones are kept. Send `Idempotency-Key` to retry a batch safely.

## 3. Answer lookups

For a lookup provider, Provenance POSTs to your HTTPS endpoint the first time a company's decision needs an entity you cover:

```json
{ "object": "risk_lookup", "entity": { "kind": "origin", "value": "https://login-lumen.example" }, "requested_at": "2026-10-27T09:00:01.120Z" }
```

| Your answer | Meaning |
| --- | --- |
| `200` with a verdict (`risk`, `categories`, …; `entity` optional) | The verdict, cached for the company's cache time or until `expires_at`. |
| `200` with `{ "risk": "none" }`, `404` or `204` | No verdict, cached the same way. |
| Anything else, or no answer within the timeout | `unavailable`: nothing is cached, and the company's rules decide what it means. |

Answer within the company's timeout: 300 ms by default, 1 second at most. Responses are capped at 16 KB, redirects aren't followed, and the endpoint must be public HTTPS.

## 4. Verify the request signature

Each lookup carries `Provenance-Signature: t=<unix seconds>,v1=<hex>`, an HMAC-SHA256 under the secret the company set, over `<t>.<raw body>`. Check it, and refuse a timestamp more than 5 minutes old.

```ts
import { createHmac, timingSafeEqual } from "node:crypto";

export function verifyLookup(rawBody: string, header: string, secret: string): boolean {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=", 2)));
  const t = Number(parts.t);
  if (!Number.isFinite(t) || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return typeof parts.v1 === "string" && parts.v1.length === expected.length && timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
}
```

It's the same scheme as Provenance webhooks, so a webhook verifier works too.

## 5. Serve a list

A list is CSV with a header row, or JSON (an array of verdicts, or `{ "signals": [...] }`), up to 10,000 verdicts and 4 MB. In CSV, split categories with `|`:

```text
entity_kind,entity_value,risk,categories,expires_at,reference
domain,shell-shop.example,high,shell_site,,case-4821
origin,https://login-lumen.example,critical,phishing|impersonation,2026-11-26T09:00:00Z,
```

The company uploads it, or gives Provenance your list's HTTPS URL to fetch daily. Each upload or fetch replaces the last list.

## Errors you might see

| Code | What to do |
| --- | --- |
| `insufficient_scope` | Use the push key the company gave you; it only sends verdicts. |
| `risk_signal_invalid` | Send at most 1,000 verdicts, in the format above. |
| `risk_provider_invalid` | The company paused you; it resumes you in Settings → Agents → Risk signals. |
| `api_key_revoked` | The company rotated your key or removed you. Ask it for a new key. |

## See also

- [Use your risk providers](https://provenanceauth.com/docs/mandate/guides/use-your-risk-providers.md)
- [Webhooks](https://provenanceauth.com/docs/integrate/webhooks.md)
