View as Markdown

Attest · API reference

Risk policies

Your account's versioned risk thresholds, weights and required-signal rules for attestations.

Related guide: Risk scoring

The policy version object

Attributes

objectenumRequired
The type of object. One of policy_version.
policy_idstring
The policy's ID (pol_…), the same on every version of it.
domainstringRequired
The policy domain.
versionintegerRequired
The version number.
activebooleanRequired
Whether this version is the active policy.
notestring | null
A note for the record.
created_atstring
When it was created.
created_bystring | null
Who saved the version.
documentobject
The policy document as saved, with Provenance's rule IDs.
shadowboolean
The shadow settings.
draftboolean
Present and true on a draft saved with POST .../versions that has not gone live.
trial_ends_attimestamp
Present while the version is on a trial run, with when the trial run ends.
restored_frominteger
On a restore, the version it copies.
promoted_from_trialboolean
Present and true when the version went live from its trial run.
sourceenum
Where the version was written: the console, the API, or a rules embed session (<provenance-rules>). Present on versions written since 2026-11-17. One of console, api, embed.
embed_sessionstring
On a version saved by a rules embed session, that session's id (the embed token's id, never the token). created_by names the API key or console member that minted the session.
draft_groupstring
Sandbox. The draft group a rules embed session saved this draft in (rules.draft_group). It stays once the draft is published. Listed only with ?draft_group= naming the group while the draft waits.
key_last4string
In the version list, on a version written through the API or a rules embed session, the last four characters of the account's API key that wrote it (or minted the session). Absent when created_by is a console member.
warningsarray of objects
Checkout rules only, present when a rule never runs (shadowed_by). The version is saved either way.
Show child attributes
typeenumRequired
Always shadowed_by. One of shadowed_by.
rule_idstringRequired
The rule that never runs.
shadowed_bystringRequired
The rule above it that always decides first.
messagestringRequired
The warning in words ("This rule never runs: 'No mandate or approval' decides first").

The policy version object

{
  "object": "policy_version",
  "policy_id": "pol_1ABC88A0840736699E93A01902",
  "domain": "claims_risk",
  "version": 1,
  "active": true,
  "note": "stricter thresholds for auto claims",
  "created_at": "2026-11-20T07:43:23.067Z",
  "document": {
    "thresholds": {
      "verified": 20,
      "partial": 60
    }
  }
}

Create a risk policy draft

POST/v1/attest/risk_policies/versions

Validates a document and saves it as the next version without making it live: a draft (v13 while v12 is live). Review it with diff, check it with backtest, then publish it.

Parameters

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
documentobjectRequired
Carrier-configurable Attest risk policy (domain claims_risk). Tunes status thresholds, per-factor weights, and required-signal rules. All fields optional; an account with none uses the historic 30/80 cuts and default weights (regression-locked).
Show child attributes
thresholdsobject
Status cutoffs; must satisfy 0 < verified < partial < 100. They never apply to an asset with signature_invalid, device_revoked or device_cert_mismatch, which is always failed.
Show child attributes
verifiednumber
Whether it was verified.
partialnumber
How many were partial.
factor_weightsobject
Per-factor point overrides, keyed by risk-factor code (e.g. gps_absent). Each value is CLAMPED to [0, 2×default] at evaluation. Re-weighting a decisive factor (signature_invalid, device_revoked, device_cert_mismatch) changes the score but not the failed status.
rulesarray of objects
Required-signal rules. When a rule's when matches and the required signal is absent, an ADVISORY CARRIER_POLICY_<SIGNAL>_MISSING factor is added (never a hard failure).
Show child attributes
idstringRequired
Unique identifier for the object.
labelstring
The rule's name in the builder.
enabledboolean
Whether the rule is on. false keeps it but it fires no signal; absent means on.
whenarray of objects | object
A rule's or signal's IF part. Either a list of conditions that must all match, or an object that picks a mode over conditions and groups (groups nest to three levels with the rule's own; at most 10 items in a group and 20 conditions in all).
Show child attributes
matchenum
Whether all, any, none or at least n of the items must match (none holds when no item does). One of all, any, none, at_least.
ninteger
With match: at_least: how many items must match (1 to the item count).
itemsarray of objects
Conditions and groups (at most 10).
Show child attributes
factstring
The fact the condition reads (transaction_amount, order.amount, agent.verified), or field to read path from the request.
openum
The comparison operator. A field condition takes the comparisons, in, matches, contains, contains_any, is_empty and is_not_empty. Every operator except the two null operators fails to match a missing or null fact, ne included. is_empty matches a fact that is missing, null, an empty string or an empty list; is_not_empty matches any other value.
valueany
The value to compare with (a string, number, boolean or a list of them). is_empty and is_not_empty take true.
pathstring
With fact: field: up to 6 dotted names, each optionally followed by [] for every element of a list (at most one []), such as metadata.cost_center or order.items[].sku.
itemsenum
With a path through a list: whether any element (the default) or every element must match. One of any, all.
metricenum
With fact: velocity: what is counted. One of verify_count, amount_sum.
windowenum
With fact: velocity: the window. 1h and 24h are rolling; month is the calendar month in UTC, counted per account or agent. One of 1h, 24h, month.
perenum
With fact: velocity: what it is counted per. agent is the registered agent the token names (none: 0). One of device, session, account, agent.
setstring
With fact: canary or prediction: the canary family or probe.
best_effortboolean
With a canary or probe: an unavailable reading evaluates false instead of failing closed.
baselineenum
With z_gt or pct_gt: the baseline the score is compared against. One of agent, account.
if_unavailableenum
What an unavailable reading means for this condition: skip (no match), match, or ask (match and ask a person). ignore is an external risk fact's older word for skip; a capture fact or Trace finding takes skip or match. One of skip, match, ask, ignore.
matchenum
Whether all, any, none or at least n of the group's items must match (none holds when no item does; a condition on a missing fact doesn't hold). One of all, any, none, at_least.
ninteger
With match: at_least: how many items must match (1 to the item count). N-of-M.
conditionsarray of objects
The group's conditions and groups (1 to 10).
requireobjectRequired
What a matching action needs.
Show child attributes
signalenum
The signal a matching capture must carry: gps, biometric or attestation. One of gps, biometric, attestation.
notestring
A note for the record.

Returns

The draft, with draft true and its document. See the policy version object.

Errors

curl -s -X POST "$PROVENANCE_API/v1/account/keys" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Risk policy writer", "products": ["attest"] }' > step.json
export RISK_KEY=$(jq -r '.api_key' step.json)
export RISK_KEY_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/attest/risk_policies/versions" \
  -H "Authorization: Bearer $RISK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "GPS on auto and property claims",
    "document": {
      "thresholds": {
        "verified": 20,
        "partial": 60
      },
      "rules": [
        {
          "id": "gps-claims",
          "label": "GPS on auto and property claims",
          "when": {
            "match": "any",
            "items": [
              {
                "fact": "claim_type",
                "op": "eq",
                "value": "auto"
              },
              {
                "fact": "claim_type",
                "op": "eq",
                "value": "property"
              }
            ]
          },
          "require": {
            "signal": "gps"
          }
        }
      ]
    }
  }'
curl -s -X POST "$PROVENANCE_API/v1/account/keys/$RISK_KEY_ID/revoke" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" > /dev/null

Response 201

{
  "object": "policy_version",
  "policy_id": "pol_1ABC88A0840736699E93A01902",
  "version": 1,
  "active": false,
  "note": "GPS on auto and property claims",
  "created_by": "key_2TNMR8MCEP8FMAZVAJP8WBV3SH",
  "created_at": "2026-11-17T14:21:13.448Z",
  "draft": true,
  "source": "api",
  "domain": "claims_risk",
  "document": {
    "thresholds": {
      "verified": 20,
      "partial": 60
    },
    "rules": [
      {
        "id": "gps-claims",
        "when": {
          "match": "any",
          "items": [
            {
              "fact": "claim_type",
              "op": "eq",
              "value": "auto"
            },
            {
              "fact": "claim_type",
              "op": "eq",
              "value": "property"
            }
          ]
        },
        "label": "GPS on auto and property claims",
        "require": {
          "signal": "gps"
        }
      }
    ]
  }
}

Retrieve the active risk policy

GET/v1/attest/risk_policies

Returns the active risk policy, or the built-in default with is_default true.

Parameters

No parameters.

Returns

The active policy for the domain.

Errors

export PROVENANCE_KEY=prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x
curl "$PROVENANCE_API/v1/attest/risk_policies" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "object": "policy",
  "id": null,
  "domain": "claims_risk",
  "document": {
    "thresholds": {},
    "factor_weights": {},
    "rules": []
  },
  "version": null,
  "is_default": true
}

Retrieve a risk policy version

GET/v1/attest/risk_policies/versions/{version}

Returns one saved risk policy version's document.

Parameters

versionintegerpathRequired
The version number.

Returns

The policy version. See the policy version object.

Errors

curl -s -X POST "$PROVENANCE_API/v1/account/keys" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Risk policy writer", "products": ["attest"] }' > step.json
export RISK_KEY=$(jq -r '.api_key' step.json)
export RISK_KEY_ID=$(jq -r '.id' step.json)
curl -s -X PUT "$PROVENANCE_API/v1/attest/risk_policies" \
  -H "Authorization: Bearer $RISK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "stricter thresholds for auto claims",
    "document": {
      "thresholds": {
        "verified": 20,
        "partial": 60
      }
    }
  }' > step.json
export RISK_VERSION=$(jq -r '.version' step.json)
curl "$PROVENANCE_API/v1/attest/risk_policies/versions/$RISK_VERSION" \
  -H "Authorization: Bearer $RISK_KEY"
curl -s -X DELETE "$PROVENANCE_API/v1/attest/risk_policies" \
  -H "Authorization: Bearer $RISK_KEY" > /dev/null
curl -s -X POST "$PROVENANCE_API/v1/account/keys/$RISK_KEY_ID/revoke" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" > /dev/null

Response 200

{
  "object": "policy_version",
  "domain": "claims_risk",
  "version": 1,
  "active": true,
  "document": {
    "thresholds": {
      "verified": 20,
      "partial": 60
    }
  },
  "note": "stricter thresholds for auto claims",
  "created_at": "2026-11-20T07:43:30.223Z"
}

Get a claims risk policy version's plan

GET/v1/attest/risk_policies/versions/{version}/plan

The version compiled into its plan: each rule's facts with what reading them costs (the request and token, your own records, a network call or a model call), cheapest first, and warnings for a fact this rule set can't read, an operator that never matches its fact, or a rule that's never reached.

Parameters

versionintegerpathRequired
The version number.

Returns

The plan.

Errors

curl -s -X POST "$PROVENANCE_API/v1/account/keys" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Risk policy writer", "products": ["attest"] }' > step.json
export RISK_KEY=$(jq -r '.api_key' step.json)
export RISK_KEY_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/attest/risk_policies/versions" \
  -H "Authorization: Bearer $RISK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "GPS on auto and property claims",
    "document": {
      "thresholds": {
        "verified": 20,
        "partial": 60
      },
      "rules": [
        {
          "id": "gps-claims",
          "label": "GPS on auto and property claims",
          "when": {
            "match": "any",
            "items": [
              {
                "fact": "claim_type",
                "op": "eq",
                "value": "auto"
              },
              {
                "fact": "claim_type",
                "op": "eq",
                "value": "property"
              }
            ]
          },
          "require": {
            "signal": "gps"
          }
        }
      ]
    }
  }' > step.json
export RISK_VERSION=$(jq -r '.version' step.json)
curl "$PROVENANCE_API/v1/attest/risk_policies/versions/$RISK_VERSION/plan" \
  -H "Authorization: Bearer $RISK_KEY"
curl -s -X POST "$PROVENANCE_API/v1/account/keys/$RISK_KEY_ID/revoke" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" > /dev/null

Response 200

{
  "object": "policy_plan",
  "domain": "claims_risk",
  "version": 6,
  "plan_hash": "62df39c24900ce9498a4128d11b6bdeca1c4c59722cd43c736a191df1c96e854",
  "node_count": 6,
  "reads": [
    {
      "fact": "claim_type",
      "tier": 0,
      "provider": "request"
    }
  ],
  "rules": [
    {
      "id": "gps-claims",
      "tier": 0,
      "reads": [
        {
          "fact": "claim_type",
          "tier": 0,
          "provider": "request"
        }
      ]
    }
  ],
  "nodes": [
    {
      "id": "fact:claim_type",
      "kind": "fact",
      "tier": 0,
      "reads": [],
      "fact": "claim_type"
    },
    {
      "id": "cond:gps-claims:0",
      "kind": "condition",
      "tier": 0,
      "reads": [
        "fact:claim_type"
      ]
    },
    {
      "id": "cond:gps-claims:1",
      "kind": "condition",
      "tier": 0,
      "reads": [
        "fact:claim_type"
      ]
    },
    "… 3 more"
  ],
  "warnings": [],
  "approve_on_tier3_only": []
}

Get the trial run

GET/v1/attest/risk_policies/trial

Risk policies don't offer trial runs (agent, checkout and capture policies do): this answers 400 policy_feature_unsupported. The route is here so every policy has the same routes.

Parameters

No parameters.

Returns

The trial run.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/attest/risk_policies/trial" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "object": "policy_trial",
  "domain": "claims_risk",
  "active": true,
  "version": 12,
  "started_at": "2026-11-08T18:05:02.803Z",
  "ends_at": "2026-11-15T18:05:02.803Z",
  "evaluated": 0,
  "differences": 0,
  "examples": []
}

Get the risk policy shadow report

GET/v1/attest/risk_policies/shadow_report

Risk policies don't offer shadow mode (agent, checkout, capture and traffic policies do): this answers 400 policy_feature_unsupported. The route is here so every policy has the same routes.

Parameters

created_gtetimestampquery
The start of the time window, as an ISO 8601 time.
created_ltetimestampquery
The end of the time window, as an ISO 8601 time.

Returns

The shadow report.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/attest/risk_policies/shadow_report" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "object": "shadow_report",
  "domain": "claims_risk",
  "shadow_active": false,
  "shadow_version": null,
  "from": null,
  "to": null,
  "evaluated": 0,
  "diverged": 0,
  "divergence_rate": 0,
  "transitions": {}
}

Get rule performance

GET/v1/attest/risk_policies/performance

Claims risk policies don't offer rule performance yet (checkout policies do): this answers 400 policy_feature_unsupported. The route is here so every policy has the same routes.

Parameters

fromstringquery
The first UTC day, YYYY-MM-DD (default: 29 days before to).
tostringquery
The last UTC day, YYYY-MM-DD (default: today). A window covers at most 366 days.
versionintegerquery
Only the decisions this version made (default: every version in the window, in the live version's rule order).
currencystringquery
The ISO 4217 currency values are summed in (default: the one with the most orders).

Returns

The rule set's totals and each rule's numbers.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/attest/risk_policies/performance" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "object": "policy_performance",
  "domain": "checkout",
  "from": "2026-11-03",
  "to": "2026-12-02",
  "version": null,
  "currency": "USD",
  "other_currencies": [],
  "totals": {
    "matched": 1,
    "value_minor": 3800,
    "outcomes": [
      {
        "outcome": "approve",
        "count": 0,
        "value_minor": 0,
        "currency": "USD",
        "share": 0
      },
      {
        "outcome": "challenge",
        "count": 1,
        "value_minor": 3800,
        "currency": "USD",
        "share": 1
      },
      {
        "outcome": "reject",
        "count": 0,
        "value_minor": 0,
        "currency": "USD",
        "share": 0
      }
    ],
    "results": {
      "true_positive": {
        "count": 0,
        "value_minor": 0,
        "currency": "USD"
      },
      "false_positive": {
        "count": 0,
        "value_minor": 0,
        "currency": "USD"
      },
      "missed": {
        "count": 0,
        "value_minor": 0,
        "currency": "USD"
      },
      "allowed": {
        "count": 0,
        "value_minor": 0,
        "currency": "USD"
      },
      "unlabelled": {
        "count": 1,
        "value_minor": 3800,
        "currency": "USD"
      }
    },
    "labelled": 0,
    "enough_labels": false
  },
  "rules": [
    {
      "rule_id": "fallback",
      "name": null,
      "outcomes": [
        "challenge"
      ],
      "matched": 1,
      "value_minor": 3800,
      "results": {
        "true_positive": {
          "count": 0,
          "value_minor": 0,
          "currency": "USD"
        },
        "false_positive": {
          "count": 0,
          "value_minor": 0,
          "currency": "USD"
        },
        "missed": {
          "count": 0,
          "value_minor": 0,
          "currency": "USD"
        },
        "allowed": {
          "count": 0,
          "value_minor": 0,
          "currency": "USD"
        },
        "unlabelled": {
          "count": 1,
          "value_minor": 3800,
          "currency": "USD"
        }
      }
    }
  ],
  "labels_note": "A rejected order has no outcome, so rejections count only when a label says whether they were right; the rest show as No label yet."
}

List risk policy versions

GET/v1/attest/risk_policies/versions

Lists a domain's saved risk policy versions, newest first, and which is active.

Parameters

No parameters.

Returns

The policy versions, newest first.

Errors

curl -s -X POST "$PROVENANCE_API/v1/account/keys" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Risk policy writer", "products": ["attest"] }' > step.json
export RISK_KEY=$(jq -r '.api_key' step.json)
export RISK_KEY_ID=$(jq -r '.id' step.json)
curl -s -X PUT "$PROVENANCE_API/v1/attest/risk_policies" \
  -H "Authorization: Bearer $RISK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "stricter thresholds for auto claims",
    "document": {
      "thresholds": {
        "verified": 20,
        "partial": 60
      }
    }
  }' > step.json
export RISK_VERSION=$(jq -r '.version' step.json)
curl "$PROVENANCE_API/v1/attest/risk_policies/versions" \
  -H "Authorization: Bearer $RISK_KEY"
curl -s -X DELETE "$PROVENANCE_API/v1/attest/risk_policies" \
  -H "Authorization: Bearer $RISK_KEY" > /dev/null
curl -s -X POST "$PROVENANCE_API/v1/account/keys/$RISK_KEY_ID/revoke" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" > /dev/null

Response 200

{
  "object": "list",
  "data": [
    {
      "object": "policy_version",
      "policy_id": "pol_1ABC88A0840736699E93A01902",
      "version": 1,
      "active": true,
      "note": "stricter thresholds for auto claims",
      "created_by": "key_5EYBGG39EJ8TJSKX5N73D54QXJ",
      "created_at": "2026-11-16T02:27:36.761Z",
      "source": "api",
      "key_last4": "9FtQ",
      "domain": "claims_risk"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

List the records a backtest would change

GET/v1/attest/risk_policies/backtest/{id}/changes

Backtests of risk policies keep no changed records yet (checkout and agent policies do), so no backtest has an id to read here: this answers 404 resource_missing, or 400 policy_feature_unsupported where the policy has no backtest. The route is here so every policy has the same routes.

Parameters

idstringpathRequired
The backtest's id (pbt_…), from POST …/backtest.
limitintegerquery
Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid.
cursorstringquery
Opaque; pass a response's next_cursor back to get the next page.

Returns

One page of the records that would change.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/attest/risk_policies/backtest/pbt_01M8WMKZJ4EZ1EWXVEN3N4HE9R/changes" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "object": "list",
  "data": [
    {
      "id": "cas_01M81CRZ5CX8S238KB791A7JB0",
      "kind": "checkout_assessment",
      "created_at": "2026-12-01T18:05:02.794Z",
      "value_minor": 124000,
      "currency": "USD",
      "live": "challenge",
      "draft": "reject",
      "live_rule_id": "first-order-over-500",
      "draft_rule_id": "two-risk-signs",
      "label": "disputed",
      "live_result": "true_positive",
      "draft_result": "true_positive"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "total": 1,
  "capped": false,
  "policy_version": 13
}

Publish a risk policy

PUT/v1/attest/risk_policies

Validates a risk policy document, saves it as the next version and makes it active. An invalid document is refused with details for each failing rule. An approval rule may carry auto_approve clauses (Pro and above); each clause gets expires_at 90 days out unless it sets one (at most 365), and a clause where a person is always required is refused with auto_approve_not_allowed.

Parameters

documentobjectRequired
A RiskPolicyDocument.
Show child attributes
thresholdsobject
Status cutoffs; must satisfy 0 < verified < partial < 100. They never apply to an asset with signature_invalid, device_revoked or device_cert_mismatch, which is always failed.
Show child attributes
verifiednumber
Whether it was verified.
partialnumber
How many were partial.
factor_weightsobject
Per-factor point overrides, keyed by risk-factor code (e.g. gps_absent). Each value is CLAMPED to [0, 2×default] at evaluation. Re-weighting a decisive factor (signature_invalid, device_revoked, device_cert_mismatch) changes the score but not the failed status.
rulesarray of objects
Required-signal rules. When a rule's when matches and the required signal is absent, an ADVISORY CARRIER_POLICY_<SIGNAL>_MISSING factor is added (never a hard failure).
Show child attributes
idstringRequired
Unique identifier for the object.
labelstring
The rule's name in the builder.
enabledboolean
Whether the rule is on. false keeps it but it fires no signal; absent means on.
whenarray of objects | object
A rule's or signal's IF part. Either a list of conditions that must all match, or an object that picks a mode over conditions and groups (groups nest to three levels with the rule's own; at most 10 items in a group and 20 conditions in all).
Show child attributes
matchenum
Whether all, any, none or at least n of the items must match (none holds when no item does). One of all, any, none, at_least.
ninteger
With match: at_least: how many items must match (1 to the item count).
itemsarray of objects
Conditions and groups (at most 10).
Show child attributes
factstring
The fact the condition reads (transaction_amount, order.amount, agent.verified), or field to read path from the request.
openum
The comparison operator. A field condition takes the comparisons, in, matches, contains, contains_any, is_empty and is_not_empty. Every operator except the two null operators fails to match a missing or null fact, ne included. is_empty matches a fact that is missing, null, an empty string or an empty list; is_not_empty matches any other value.
valueany
The value to compare with (a string, number, boolean or a list of them). is_empty and is_not_empty take true.
pathstring
With fact: field: up to 6 dotted names, each optionally followed by [] for every element of a list (at most one []), such as metadata.cost_center or order.items[].sku.
itemsenum
With a path through a list: whether any element (the default) or every element must match. One of any, all.
metricenum
With fact: velocity: what is counted. One of verify_count, amount_sum.
windowenum
With fact: velocity: the window. 1h and 24h are rolling; month is the calendar month in UTC, counted per account or agent. One of 1h, 24h, month.
perenum
With fact: velocity: what it is counted per. agent is the registered agent the token names (none: 0). One of device, session, account, agent.
setstring
With fact: canary or prediction: the canary family or probe.
best_effortboolean
With a canary or probe: an unavailable reading evaluates false instead of failing closed.
baselineenum
With z_gt or pct_gt: the baseline the score is compared against. One of agent, account.
if_unavailableenum
What an unavailable reading means for this condition: skip (no match), match, or ask (match and ask a person). ignore is an external risk fact's older word for skip; a capture fact or Trace finding takes skip or match. One of skip, match, ask, ignore.
matchenum
Whether all, any, none or at least n of the group's items must match (none holds when no item does; a condition on a missing fact doesn't hold). One of all, any, none, at_least.
ninteger
With match: at_least: how many items must match (1 to the item count). N-of-M.
conditionsarray of objects
The group's conditions and groups (1 to 10).
requireobjectRequired
What a matching action needs.
Show child attributes
signalenum
The signal a matching capture must carry: gps, biometric or attestation. One of gps, biometric, attestation.
notestring
A note for the record.

Returns

The new policy version. See the policy version object.

Errors

curl -s -X POST "$PROVENANCE_API/v1/account/keys" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Risk policy writer", "products": ["attest"] }' > step.json
export RISK_KEY=$(jq -r '.api_key' step.json)
export RISK_KEY_ID=$(jq -r '.id' step.json)
curl -X PUT "$PROVENANCE_API/v1/attest/risk_policies" \
  -H "Authorization: Bearer $RISK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "stricter thresholds for auto claims",
    "document": {
      "thresholds": {
        "verified": 20,
        "partial": 60
      }
    }
  }'
curl -s -X DELETE "$PROVENANCE_API/v1/attest/risk_policies" \
  -H "Authorization: Bearer $RISK_KEY" > /dev/null
curl -s -X POST "$PROVENANCE_API/v1/account/keys/$RISK_KEY_ID/revoke" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" > /dev/null

Response 201

{
  "object": "policy_version",
  "policy_id": "pol_1ABC88A0840736699E93A01902",
  "domain": "claims_risk",
  "version": 1,
  "active": true,
  "note": "stricter thresholds for auto claims",
  "created_at": "2026-11-20T07:43:23.067Z",
  "document": {
    "thresholds": {
      "verified": 20,
      "partial": 60
    }
  }
}

Reset to the default risk policy

DELETE/v1/attest/risk_policies

Returns a domain to the built-in default. Saved versions are kept.

Parameters

No parameters.

Returns

The default policy, now active.

Errors

curl -s -X POST "$PROVENANCE_API/v1/account/keys" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Risk policy writer", "products": ["attest"] }' > step.json
export RISK_KEY=$(jq -r '.api_key' step.json)
export RISK_KEY_ID=$(jq -r '.id' step.json)
curl -X DELETE "$PROVENANCE_API/v1/attest/risk_policies" \
  -H "Authorization: Bearer $RISK_KEY"
curl -s -X POST "$PROVENANCE_API/v1/account/keys/$RISK_KEY_ID/revoke" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" > /dev/null

Response 200

{
  "object": "policy",
  "id": null,
  "domain": "claims_risk",
  "document": {
    "thresholds": {},
    "factor_weights": {},
    "rules": []
  },
  "version": null,
  "is_default": true
}

Review a risk policy version's changes

GET/v1/attest/risk_policies/versions/{version}/diff

Compares a version with the live one (or with against, another version) rule by rule, in plain sentences: each added, removed, changed or moved rule, with what changed in it.

Parameters

versionintegerpathRequired
The version number.
againststringquery
active (the default) or another version number to compare with.

Returns

The changes.

Errors

curl -s -X POST "$PROVENANCE_API/v1/account/keys" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Risk policy writer", "products": ["attest"] }' > step.json
export RISK_KEY=$(jq -r '.api_key' step.json)
export RISK_KEY_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/attest/risk_policies/versions" \
  -H "Authorization: Bearer $RISK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "GPS on auto and property claims",
    "document": {
      "thresholds": {
        "verified": 20,
        "partial": 60
      },
      "rules": [
        {
          "id": "gps-claims",
          "label": "GPS on auto and property claims",
          "when": {
            "match": "any",
            "items": [
              {
                "fact": "claim_type",
                "op": "eq",
                "value": "auto"
              },
              {
                "fact": "claim_type",
                "op": "eq",
                "value": "property"
              }
            ]
          },
          "require": {
            "signal": "gps"
          }
        }
      ]
    }
  }' > step.json
export RISK_VERSION=$(jq -r '.version' step.json)
curl "$PROVENANCE_API/v1/attest/risk_policies/versions/$RISK_VERSION/diff" \
  -H "Authorization: Bearer $RISK_KEY"
curl -s -X POST "$PROVENANCE_API/v1/account/keys/$RISK_KEY_ID/revoke" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" > /dev/null

Response 200

{
  "object": "policy_diff",
  "domain": "claims_risk",
  "version": 1,
  "against": null,
  "changes": [
    {
      "rule_id": "gps-claims",
      "label": "GPS on auto and property claims",
      "change": "added",
      "parts": [],
      "before": null,
      "after": "If any of: Claim type is auto; or Claim type is property, then require GPS (else a risk factor is added)"
    }
  ]
}

Publish a risk policy version

POST/v1/attest/risk_policies/versions/{version}/publish

Makes a draft the live risk policy now.

Parameters

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
versionintegerpathRequired
The version number.

Returns

The live version. See the policy version object.

Errors

curl -s -X POST "$PROVENANCE_API/v1/account/keys" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Risk policy writer", "products": ["attest"] }' > step.json
export RISK_KEY=$(jq -r '.api_key' step.json)
export RISK_KEY_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/attest/risk_policies/versions" \
  -H "Authorization: Bearer $RISK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "GPS on auto and property claims",
    "document": {
      "thresholds": {
        "verified": 20,
        "partial": 60
      },
      "rules": [
        {
          "id": "gps-claims",
          "label": "GPS on auto and property claims",
          "when": {
            "match": "any",
            "items": [
              {
                "fact": "claim_type",
                "op": "eq",
                "value": "auto"
              },
              {
                "fact": "claim_type",
                "op": "eq",
                "value": "property"
              }
            ]
          },
          "require": {
            "signal": "gps"
          }
        }
      ]
    }
  }' > step.json
export RISK_VERSION=$(jq -r '.version' step.json)
curl -X POST "$PROVENANCE_API/v1/attest/risk_policies/versions/$RISK_VERSION/publish" \
  -H "Authorization: Bearer $RISK_KEY"
curl -s -X DELETE "$PROVENANCE_API/v1/attest/risk_policies" \
  -H "Authorization: Bearer $RISK_KEY" > /dev/null
curl -s -X POST "$PROVENANCE_API/v1/account/keys/$RISK_KEY_ID/revoke" \
  -H "Authorization: Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" > /dev/null

Response 200

{
  "object": "policy_version",
  "policy_id": "pol_1ABC88A0840736699E93A01902",
  "version": 1,
  "active": true,
  "note": "GPS on auto and property claims",
  "created_by": "key_1VYDV92FM08AR9JRQHGJBVBSAA",
  "created_at": "2026-11-16T02:28:02.189Z",
  "source": "api",
  "domain": "claims_risk"
}

Export risk policy versions

GET/v1/attest/risk_policies/versions/export

Returns every version with its document, for your own records. Available on the Enterprise plan.

Parameters

No parameters.

Returns

Every version.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/attest/risk_policies/versions/export" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "object": "policy_version_export",
  "domain": "claims_risk",
  "exported_at": "2026-11-08T18:02:11.204Z",
  "versions": [
    {
      "object": "policy_version",
      "version": 2,
      "active": true,
      "note": "GPS on auto and property claims",
      "created_by": "usr_01M6VQBCTY8NPW81EFB7PMWCDK",
      "created_at": "2026-11-08T17:58:40.112Z",
      "domain": "claims_risk",
      "document": {
        "thresholds": {
          "verified": 20,
          "partial": 60
        },
        "rules": [
          {
            "id": "gps-claims",
            "label": "GPS on auto and property claims",
            "when": {
              "match": "any",
              "items": [
                {
                  "fact": "claim_type",
                  "op": "eq",
                  "value": "auto"
                },
                {
                  "fact": "claim_type",
                  "op": "eq",
                  "value": "property"
                }
              ]
            },
            "require": {
              "signal": "gps"
            }
          }
        ]
      }
    },
    {
      "object": "policy_version",
      "version": 1,
      "active": false,
      "note": "stricter thresholds for auto claims",
      "created_by": "usr_01M6VQBCTY8NPW81EFB7PMWCDK",
      "created_at": "2026-11-02T15:21:06.480Z",
      "domain": "claims_risk",
      "document": {
        "thresholds": {
          "verified": 20,
          "partial": 60
        }
      }
    }
  ]
}

Backtest a risk policy

POST/v1/attest/risk_policies/backtest

Pro plan and above (402 plan_required below it). Returns available: false with reason: no_history: claims keep no request history to replay. Use simulate to test a claims rule against facts you supply.

Parameters

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
documentobject
Carrier-configurable Attest risk policy (domain claims_risk). Tunes status thresholds, per-factor weights, and required-signal rules. All fields optional; an account with none uses the historic 30/80 cuts and default weights (regression-locked).
Show child attributes
thresholdsobject
Status cutoffs; must satisfy 0 < verified < partial < 100. They never apply to an asset with signature_invalid, device_revoked or device_cert_mismatch, which is always failed.
Show child attributes
verifiednumber
Whether it was verified.
partialnumber
How many were partial.
factor_weightsobject
Per-factor point overrides, keyed by risk-factor code (e.g. gps_absent). Each value is CLAMPED to [0, 2×default] at evaluation. Re-weighting a decisive factor (signature_invalid, device_revoked, device_cert_mismatch) changes the score but not the failed status.
rulesarray of objects
Required-signal rules. When a rule's when matches and the required signal is absent, an ADVISORY CARRIER_POLICY_<SIGNAL>_MISSING factor is added (never a hard failure).
Show child attributes
idstringRequired
Unique identifier for the object.
labelstring
The rule's name in the builder.
enabledboolean
Whether the rule is on. false keeps it but it fires no signal; absent means on.
whenarray of objects | object
A rule's or signal's IF part. Either a list of conditions that must all match, or an object that picks a mode over conditions and groups (groups nest to three levels with the rule's own; at most 10 items in a group and 20 conditions in all).
Show child attributes
matchenum
Whether all, any, none or at least n of the items must match (none holds when no item does). One of all, any, none, at_least.
ninteger
With match: at_least: how many items must match (1 to the item count).
itemsarray of objects
Conditions and groups (at most 10).
Show child attributes
factstring
The fact the condition reads (transaction_amount, order.amount, agent.verified), or field to read path from the request.
openum
The comparison operator. A field condition takes the comparisons, in, matches, contains, contains_any, is_empty and is_not_empty. Every operator except the two null operators fails to match a missing or null fact, ne included. is_empty matches a fact that is missing, null, an empty string or an empty list; is_not_empty matches any other value.
valueany
The value to compare with (a string, number, boolean or a list of them). is_empty and is_not_empty take true.
pathstring
With fact: field: up to 6 dotted names, each optionally followed by [] for every element of a list (at most one []), such as metadata.cost_center or order.items[].sku.
itemsenum
With a path through a list: whether any element (the default) or every element must match. One of any, all.
metricenum
With fact: velocity: what is counted. One of verify_count, amount_sum.
windowenum
With fact: velocity: the window. 1h and 24h are rolling; month is the calendar month in UTC, counted per account or agent. One of 1h, 24h, month.
perenum
With fact: velocity: what it is counted per. agent is the registered agent the token names (none: 0). One of device, session, account, agent.
setstring
With fact: canary or prediction: the canary family or probe.
best_effortboolean
With a canary or probe: an unavailable reading evaluates false instead of failing closed.
baselineenum
With z_gt or pct_gt: the baseline the score is compared against. One of agent, account.
if_unavailableenum
What an unavailable reading means for this condition: skip (no match), match, or ask (match and ask a person). ignore is an external risk fact's older word for skip; a capture fact or Trace finding takes skip or match. One of skip, match, ask, ignore.
matchenum
Whether all, any, none or at least n of the group's items must match (none holds when no item does; a condition on a missing fact doesn't hold). One of all, any, none, at_least.
ninteger
With match: at_least: how many items must match (1 to the item count). N-of-M.
conditionsarray of objects
The group's conditions and groups (1 to 10).
requireobjectRequired
What a matching action needs.
Show child attributes
signalenum
The signal a matching capture must carry: gps, biometric or attestation. One of gps, biometric, attestation.
daysinteger
How many days to replay (default 30).

Returns

How the document would have decided.

Errors

export PROVENANCE_KEY=prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x
curl -X POST "$PROVENANCE_API/v1/attest/risk_policies/backtest" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "days": 30 }'

Response 200

{
  "object": "policy_backtest",
  "days": 30,
  "from": "2026-10-27T04:36:05.627Z",
  "to": "2026-11-26T04:36:05.627Z",
  "available": false,
  "reason": "no_history",
  "requests": 0,
  "truncated": false,
  "field_conditions_unscored": false,
  "totals": {
    "allowed": 0,
    "challenged": 0,
    "rejected": 0
  },
  "rules": []
}

Simulate a risk policy

POST/v1/attest/risk_policies/simulate

Evaluates a draft or the active risk policy against facts you supply and changes nothing. For claims_risk it returns the score, status and factors the claim would get.

Parameters

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
documentany
Draft to test; omit to use the active policy.
factsobject
The facts the policy evaluates. For claims_risk: claim_type, state, case_type, gps_present, biometric_present and attested. A missing or unrecognized case_type counts as insurance_claim, as it does on attest.
base_signalsobject
claims_risk only — base risk signals to combine before scoring.
orderobject
An order in the cart shape (order_id, integer total in minor units, currency, items); its order.* facts join facts, as on verify.
attimestamp
When the preview starts (default now): business hours and escalation times count from it.

Returns

What the policy would decide. A webhook rule reports would_call_webhook without calling it. A rule with a route adds routing: who gets it now, each step, and the end.

Errors

export PROVENANCE_KEY=prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x
curl -X POST "$PROVENANCE_API/v1/attest/risk_policies/simulate" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "document": {
      "thresholds": {
        "verified": 20,
        "partial": 60
      }
    },
    "facts": {
      "claim_type": "auto",
      "gps_present": false,
      "biometric_present": true,
      "attested": true
    },
    "base_signals": {
      "gps_absent": true
    }
  }'

Response 200

{
  "object": "policy_simulation",
  "domain": "claims_risk",
  "score": 30,
  "status": "partial",
  "factors": [
    {
      "factor": "gps_absent",
      "points": 30,
      "description": "GPS is null or lat/lng are both 0"
    }
  ],
  "thresholds": {
    "verified": 20,
    "partial": 60
  }
}

Stop the trial run

DELETE/v1/attest/risk_policies/trial

Risk policies don't offer trial runs (agent, checkout and capture policies do): this answers 400 policy_feature_unsupported. The route is here so every policy has the same routes.

Parameters

No parameters.

Returns

No trial run.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X DELETE "$PROVENANCE_API/v1/attest/risk_policies/trial" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "object": "policy_trial",
  "domain": "claims_risk",
  "active": false,
  "version": null
}

Promote the trial run

POST/v1/attest/risk_policies/trial/promote

Risk policies don't offer trial runs (agent, checkout and capture policies do): this answers 400 policy_feature_unsupported. The route is here so every policy has the same routes.

Parameters

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).

Returns

The new live version, with promoted_from_trial. See the policy version object.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/attest/risk_policies/trial/promote" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 200

{
  "object": "policy_version",
  "policy_id": "pol_AC2A5612965B31B91188589F91",
  "version": 13,
  "active": true,
  "note": "big orders from new shoppers or unsigned agents",
  "created_by": "key_7FHWBSCG1E8PJV9C3XB7HS0CF4",
  "created_at": "2026-11-08T18:05:02.805Z",
  "trial_ends_at": "2026-11-15T18:05:02.805Z",
  "source": "api",
  "domain": "claims_risk",
  "promoted_from_trial": true
}

Shadow a risk policy version

POST/v1/attest/risk_policies/versions/{version}/shadow

Risk policies don't offer shadow mode (agent, checkout, capture and traffic policies do): this answers 400 policy_feature_unsupported. The route is here so every policy has the same routes.

Parameters

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
versionintegerpathRequired
The version number.

Returns

The version, now running in shadow. See the policy version object.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/attest/risk_policies/versions/1/shadow" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 200

{
  "object": "policy_version",
  "domain": "claims_risk",
  "version": 5,
  "active": true,
  "shadow": true
}

Stop shadowing risk policy

DELETE/v1/attest/risk_policies/versions/{version}/shadow

Risk policies don't offer shadow mode (agent, checkout, capture and traffic policies do): this answers 400 policy_feature_unsupported. The route is here so every policy has the same routes.

Parameters

versionintegerpathRequired
The version number.

Returns

The shadow is off.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X DELETE "$PROVENANCE_API/v1/attest/risk_policies/versions/1/shadow" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "object": "policy_shadow",
  "domain": "claims_risk",
  "shadow": false
}

Was this page helpful? Send us feedback

LLM? Read llms.txt.