# Synthetic-media screening

Screening asks a third-party detector whether media that was never attested looks AI-generated, as an advisory score kept separate from the risk score.

Synthetic-media screening is a call to a third-party AI-media detector, that scores whether a photo or video that was never attested looks generated or deepfaked. Its score is advisory and always kept separate from the risk score.

## When to use it

Screen only media that has no attestation: an upload with `no_manifest`, from before you used the capture SDK or from a channel that bypasses it. An asset with a valid signature and a matching hash is already proven, so a detector score adds nothing.

## How it works

1. You send the media's bytes. Results are cached by content hash, so the same file is screened once.
2. Provenance calls the detector (Sightengine) for AI-generated images, AI-generated video and deepfakes.
3. You get a `synthetic_media_score` from 0 to 100, the higher of the two confidences times 100, with the factors behind it.

1. **Unattested media**: image or video bytes
2. **Detector**: AI-generated, deepfake
3. **Advisory score**: 0–100, never in risk_score

## Key fields

- `synthetic_media_score` (integer): 0–100; higher means more likely generated. Suggested reading: 0–30 no signals, 31–70 inconclusive, 71–100 likely generated.
- `synthetic_media_factors` (object[]): `ai_generated_likely` or `deepfake_likely`, each with `score_contribution`, `detector` and `detector_model`.

## Screen an upload

**curl**

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

curl $PROVENANCE_API/v1/attest/media/screen \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "image_base64": "/9j/4AAQSkZJRgABAQ" }'
```

**Node**

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

const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY!, baseUrl: process.env.PROVENANCE_API });
const screening = await prov.attest.media.screen({ imageBase64: "/9j/4AAQSkZJRgABAQ" });
```

**Python**

```python
import os
from provenanceauth import Provenance

prov = Provenance(os.environ["PROVENANCE_KEY"], base_url=os.environ["PROVENANCE_API"])
screening = prov.attest.media.screen(image_base64="/9j/4AAQSkZJRgABAQ")
```

The sandbox has no detector configured, so it answers with the error your code should handle:

```json
{
  "error": {
    "type": "unavailable_error",
    "code": "detector_not_configured",
    "message": "Synthetic-media screening is not configured …",
    "doc_url": "https://provenanceauth.com/docs/errors#detector_not_configured",
    "request_id": "req_01M5Q1B5ZQNS9SJ06Y4ZMYHVTJ"
  }
}
```

With a detector, the response carries the score and factors. Provenance only ever returns a score from a live detector response or its cached copy:

| Situation | Response |
| --- | --- |
| No detector configured | `503` [`detector_not_configured`](https://provenanceauth.com/docs/platform/errors.md#detector_not_configured) |
| The detector failed | `502` [`screening_provider_error`](https://provenanceauth.com/docs/platform/errors.md#screening_provider_error) |
| The screening budget is spent | `402` [`usage_limit_reached`](https://provenanceauth.com/docs/platform/errors.md#usage_limit_reached) |

## Screen an asset you already hold

Attest stores an asset's hash, not its bytes. To screen a stored asset, hash the original file you hold and compare it with the asset's `sensor_hash` from its [verification result](https://provenanceauth.com/docs/attest/concepts/verification.md); screen only on a match, or the score describes some other file. The console's **Screen this asset** does this in the browser and refuses a file that doesn't match.

**Limitations:** detector accuracy drops for recompressed media and screenshots. The sandbox's screening budget is limited per day and per month.

## Related

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