# Risk scoring

The risk score adds fixed points for each factor found on an asset, caps the total at 100, and maps it to verified, partial or failed. Three decisive factors always fail the asset.

The risk score is a rule-based number from 0 to 100, that adds fixed points for each problem found on an asset so you can see exactly why a photo or video scored as it did.

## When to use it

Use the status to route work: approve `verified` assets automatically, send `partial` ones to an adjuster, and investigate `failed` ones. Use the factors to tell the policyholder what would resolve a problem.

## How it works

1. Verification checks the hash, signature, certificate, device, metadata and, for video, the chunk chain.
2. Each check that fails adds its factor's points. The total is capped at 100.
3. The score maps to a status, unless a decisive factor is present: then the status is `failed`. The same inputs always give the same score; there is no machine learning in it.

1. **Checks**: hash, signature, device, metadata
2. **Factors**: points per problem
3. **Score**: capped at 100 → status

| Score | Status | Suggested action |
| --- | --- | --- |
| 0–30 | `verified` | Approve automatically. |
| 31–60 | `partial` | Adjuster review. |
| 61–80 | `partial` | Enhanced review. |
| 81–100 | `failed` | Investigation. |

### Decisive factors

Three factors each make the asset `failed`, whatever its score or its other signals:

- `signature_invalid`: the bundle changed after signing.
- `device_revoked`: the device that signed it is revoked.
- `device_cert_mismatch`: another key signed it for an enrolled device.

The factor still adds its points and appears in `risk_factors`, so the result explains the failure. A claim with any such asset has `overall_status: "failed"`.

## Key fields: the factors

| Factor | Points | Applies when | What it usually means |
| --- | --- | --- | --- |
| `signature_invalid` | 70, decisive | The signature fails ECDSA verification | The asset or bundle changed after signing. |
| `sensor_hash_mismatch` | 50 | The image bytes don't match `sensor_hash` | The image was edited after capture. |
| `frame_hash_mismatch` | 50 | A video chunk doesn't match the chain | The video was edited after capture. |
| `device_revoked` | 80, decisive | The device is revoked in the registry | Check the [device registry](https://provenanceauth.com/docs/attest/concepts/device-registry.md). |
| `device_cert_mismatch` | 80, decisive | The bundle names an enrolled device but carries another certificate | Another key signed it; see the [device registry](https://provenanceauth.com/docs/attest/concepts/device-registry.md). |
| `cert_unknown_ca` | 40 | The certificate isn't from a known root, and isn't the enrolled certificate of a phone whose hardware the server verified | An unknown or self-made device. |
| `device_not_enrolled` | 20 | The device isn't in the registry | A web upload or unknown device. |
| `no_manifest` | 60 | There is no bundle at all | Never captured with the SDK; consider [screening](https://provenanceauth.com/docs/attest/concepts/synthetic-media-screening.md). |
| `session_nonce_mismatch` | 70 | A live session's chain isn't seeded with its nonce | A pre-recorded video presented as live. |
| `liveness_check_failed` | 40 | Live-session chunk timing is inconsistent | Review the recording. |
| `screen_or_print_suspected` | 40 | The [screen-or-print check](#the-screen-or-print-check) found signs of a photo of a screen or a print | Review the photo; alone it sends a capture to review. |
| `video_manifest_incomplete` | 40 | Chunks are missing or out of sequence | The manifest is damaged or partial. |
| `hardware_backing_absent` | 40 | A real device couldn't prove hardware-backed keys | Lower assurance capture. Sandbox devices are exempt. |
| `timestamp_stale` | 25 | Captured over 72 hours before submission | Old media submitted as new. |
| `gps_absent` | 30 | No location | Can't confirm where it was taken. |
| `biometric_absent` | 10 | No biometric at capture | Can't tie a person to the moment. |
| `geofence_mismatch` | 20 | Captured far from the claim's `loss_location` | Only when you send `loss_location` at attest. |
| `exif_timestamp_mismatch` | 15 | The JPEG's EXIF time differs from the capture time | The photo may come from earlier. |
| `exif_editor_trace` | 15 | The EXIF names an image editor | The photo was opened in an editor. |
| `exif_missing` | 5 | A JPEG with no EXIF | Often a re-save or screenshot. |
| `cross_claim_link` | 15 or 30 | The claim shares a location (15) or a device or certificate (30) with another of yours | See [linked claims](https://provenanceauth.com/docs/attest/guides/review-claims.md#3-check-for-linked-claims). |

The metadata factors (`exif_*`, `geofence_mismatch`) are advisory: modest points, and they never fire when the input is missing.

## Tune the score for your carrier

A carrier can set its own thresholds, factor weights and required signals with a risk policy in the `claims_risk` [policy domain](https://provenanceauth.com/docs/concepts/policies.md). Weights are clamped between 0 and twice the default, and a required-signal rule adds an advisory `carrier_policy_*_missing` factor rather than failing the asset. Thresholds and weights never override a decisive factor. A carrier without a policy scores exactly as this page describes.

Try a draft against sample facts with [`POST /v1/attest/risk_policies/simulate`](https://provenanceauth.com/docs/api/risk-policies.md#post-v1-attest-risk-policies-simulate) and a key with the `attest` scope on the carrier's account:

**curl**

```bash
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x

curl "$PROVENANCE_API/v1/attest/risk_policies/simulate" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "document": {
      "thresholds": { "verified": 20, "partial": 60 },
      "rules": [{
        "id": "fl-water-gps",
        "when": [{ "fact": "claim_type", "op": "eq", "value": "water" }, { "fact": "state", "op": "eq", "value": "FL" }],
        "require": { "signal": "gps" }
      }]
    },
    "facts": { "claim_type": "water", "state": "FL", "gps_present": false, "biometric_present": true, "attested": true }
  }'
```

**Node**

```ts
import { Provenance } from "@provenanceauth/sdk";

const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY!, baseUrl: process.env.PROVENANCE_API });
const sim = await prov.mandate.policies.simulateRisk({
  document: {
    thresholds: { verified: 20, partial: 60 },
    rules: [{ id: "fl-water-gps", when: [{ fact: "claim_type", op: "eq", value: "water" }, { fact: "state", op: "eq", value: "FL" }], require: { signal: "gps" } }],
  },
  facts: { claim_type: "water", state: "FL", gps_present: false, biometric_present: true, attested: true },
});
```

**Python**

```python
import os
from provenanceauth import Provenance

prov = Provenance(os.environ["PROVENANCE_KEY"], base_url=os.environ["PROVENANCE_API"])
sim = prov.mandate.policies.simulate_risk(
    document={
        "thresholds": {"verified": 20, "partial": 60},
        "rules": [{"id": "fl-water-gps", "when": [{"fact": "claim_type", "op": "eq", "value": "water"}, {"fact": "state", "op": "eq", "value": "FL"}], "require": {"signal": "gps"}}],
    },
    facts={"claim_type": "water", "state": "FL", "gps_present": False, "biometric_present": True, "attested": True},
)
```

```json
{
  "object": "policy_simulation",
  "domain": "claims_risk",
  "score": 20,
  "status": "verified",
  "factors": [
    { "factor": "carrier_policy_gps_missing", "points": 20, "description": "Carrier risk policy requires GPS for this claim, and it is absent" }
  ],
  "thresholds": { "verified": 20, "partial": 60 }
}
```

Send `claim_type` and `state` at attest so the rules can match. You can also edit the policy in the console under **Rules → Claims** (the score's weights are in its developer editor).

## The screen-or-print check

Every captured photo gets a check for signs that it was taken of a screen or of a printed picture: moire from a screen's pixel grid or a print's dot pattern, a flat glare off glass or gloss paper, a bezel or paper edge inside the frame, display banding and, when the device returns depth data, a flat plane at screen distance. The result is on the shot's checks as `recapture`:

| `recapture.status` | The panel reads | Points |
| --- | --- | --- |
| `clear` | No sign of a screen or a print | 0 |
| `suspected` | Looks like a screen or a print | 40 (`screen_or_print_suspected`) |
| `not_checked` | Not checked, with `reason`: `too_small` (under 480 pixels on the short side), `too_blurred`, `not_a_photo`, `decode_failed`, `timeout` or `check_off` | 0 |

Capture rules read it as `capture.screen_or_print` (`suspected` or `clear`, absent when the photo wasn't checked), next to `capture.risk_score`. The factor is never decisive, and its weight can be changed like any other.

**Limitations:** the check finds many photos of screens and prints, not all. A high-resolution screen photographed from a distance, or a good print in soft light, can pass; a real photo of a patterned surface can fire. It is one factor in the score, not a verdict.

A hardware attestation proves the camera took the photo, not what it pointed at, so it doesn't change this check. The threshold is provisional until the evaluation set of about 1,000 photos is complete; its precision, recall and false-positive rate are published then.

## Two separate signals

`risk_score` says whether Provenance can prove an asset is authentic. A [synthetic-media score](https://provenanceauth.com/docs/attest/concepts/synthetic-media-screening.md) says whether a third-party detector thinks it looks generated. They are never combined; the detector matters only for an asset that can't be proven, such as one with `no_manifest`.

## Related

- [Verification](https://provenanceauth.com/docs/attest/concepts/verification.md)
- [Insurance claims](https://provenanceauth.com/docs/attest/guides/review-claims.md)
- [Policies](https://provenanceauth.com/docs/concepts/policies.md)
