# Traffic assessment

The traffic assessment is the one object Identify returns for a request, with the signing agent, the person behind it, the rule score, a vendor's score and your policy's decision kept apart.

A traffic assessment is the object that says what Identify concluded about one request: which agent signed it, whether a person approved what the agent does, how bot-like it looks, and what your traffic policy decided. The hosted check, the middleware and the edge templates all return the same shape.

## When to use it

- Branch your own code on `class` and `decision.action` after the middleware runs.
- Log an assessment next to an order, so support can see that a signed agent placed it for an approving person.
- Report assessments from your middleware in batches, so the console shows your traffic.

## How it works

Three signals sit side by side. Identify never merges them into one number:

| Signal | Where it comes from | What can change it |
| --- | --- | --- |
| `agent` | A Web Bot Auth signature checked against keys its `Signature-Agent` URL publishes, or, on the hosted check, an HTTP message signature checked against a key the agent registered with Provenance | Only cryptography |
| `bot_score` | Identify's own rules, each a named signal with a weight, added and capped at 100 | The request's headers and behavior |
| `vendor_score` | Your vendor's model, through your own key, labelled with the vendor's name | The vendor |

`class: "signed_agent"` comes from a verified signature alone. A high `bot_score` or `vendor_score` never makes a signed agent anything else; your policy can still read both scores and decide.

- `class` (string): `signed_agent`, `declared_bot`, `suspected_bot`, `likely_human` or `unknown`.
- `agent` (object | null): The signing agent: `id` and `name` for an agent registered with Provenance, `category`, `operator`, and `verified`. Null when the request carries no signature.
- `human` (object | null): The person behind the agent, when the request carries an Authorize intent token or a grant: `backed`, a `pseudonym`, when and how they approved, and `intent_valid`.
- `bot_score` (integer): 0 to 100, advisory.
- `signals` (array): The named signals behind `bot_score`, each with a description.
- `vendor_score` (object): `{ "status": "not_configured" }` without a vendor key. Never fabricated.
- `decision` (object): Your policy's `action`, and what a shadow policy would have done.
- `policy` (object | null): The rule that decided, with each condition and the value it compared (see [the rule that decided](https://provenanceauth.com/docs/concepts/assessments.md#the-rule-that-decided)). Null when no rule matched and your policy's default applied.
- `signature` (object): How the request was signed: `web_bot_auth`, `http_signature` (no `Signature-Agent`, checked against a key the agent registered with Provenance; the hosted check only) or `none` (see [how the agent signed](https://provenanceauth.com/docs/concepts/assessments.md#how-the-agent-signed)).
- `authority` (object | null): The person's token the request carried and what it covered (see [what covered it](https://provenanceauth.com/docs/concepts/assessments.md#what-covered-it)). Null when it carried none.
- `bot` (object): How likely the request is automated: `likelihood` (the score), `band`, `reason` and the named `signals` that are true (see [how likely it's a bot](https://provenanceauth.com/docs/concepts/assessments.md#how-likely-its-a-bot)). A request alone under 30 is `unclassified`.
- `action` (string | null): Your route map's name for the request, such as `checkout` or `login`.
- `request` (object): The request's `method` and `path` (never the query), and `agent.platform`: the platform that sent it, `signed` through its signing directory or `declared` by a known crawler's user agent, or null (see [which platform sent it](https://provenanceauth.com/docs/concepts/assessments.md#which-platform-sent-it)).
- `network` (object): Where the request came from (see [network and device](#network-and-device)).
- `device` (object): The device the request describes (see [network and device](#network-and-device)).

### Network and device

Every decision says where the request came from and what device it describes. A range says where a request came from, not who sent it: only a signature verifies an agent.

- `network.kind` (string): `hosting` from a cloud provider's published range or a hosting company's AS number; `residential`, `mobile` or `business` only from an IP lookup provider; else `unknown`, never a guess.
- `network.provider` (string | null): The cloud or hosting company, such as `aws`, `azure` or `hetzner`.
- `network.agent_range` (object | null): The agent operator whose published range holds the address, and which crawler's: OpenAI, Anthropic, Google, Microsoft, Apple, Perplexity, Meta or Common Crawl.
- `network.privacy` (object): A Tor exit, iCloud Private Relay, and a VPN or proxy when an IP lookup provider is set (null without one).
- `network.asn` (integer | null): The AS number and, in `as_org`, its organisation, from the IP lookup provider.
- `network.country` (string | null): Two letters, from the IP lookup provider.
- `network.ip_prefix` (string | null): The /24 (IPv4) or /48 (IPv6) prefix. The whole address is in `network.ip` only when your account keeps full addresses.
- `network.unavailable` (array): The fields Identify couldn't know. A request with no address reads `["ip"]`.
- `network.sources` (object): The dates of the lists the decision was classified with.
- `device.os` (string | null): The operating system and, in `os_version`, its version.
- `device.browser` (string | null): The browser and, in `browser_version`, its major version.
- `device.type` (string): `desktop`, `mobile`, `tablet`, `bot` or `unknown`.
- `device.time_zone` (string | null): The time zone your page's script sent in `client` on the hosted check, with `locale` for its language.

The network is worked out on the whole address, then only the prefix is stored. Owners and admins on Pro and up can keep whole addresses with `keep_full_ip` in the site settings; they are still deleted with the decision. Embeds never show the address or its prefix, only the country. Nothing in `device` identifies a device across visits.

Rules read the same facts:

| Fact | Reads |
| --- | --- |
| `network.kind`, `network.provider`, `network.asn` | The kind of network, the provider, the AS number |
| `network.in_agent_range`, `network.agent_range_operator` | An agent operator's published range |
| `network.tor`, `network.private_relay`, `network.vpn` | Privacy services |
| `network.country` | The network's country |
| `device.os`, `device.browser`, `device.type` | The device |

For example, challenge a hosting address that isn't a signed agent:

```json
{
  "id": "hosting-unsigned",
  "when": [
    { "fact": "network.kind", "op": "eq", "value": "hosting" },
    { "fact": "agent.class", "op": "ne", "value": "signed_agent" }
  ],
  "then": { "action": "challenge" }
}
```

A rule that names a fact the request didn't have doesn't match. Filter the decision list with `network_kind` and `agent_range` (an operator, `any` or `none`).

### The person behind an agent

`human.pseudonym` is a `hum_` id that stays the same for one person at your site and is unrelated to the id another site sees. Use it to rate-limit or block one person's agents. It never appears inside a token, and the person's identity is never in an assessment.

The pseudonym comes from the token's subject, which is pairwise per audience. An agent that mints its intent token with your origin as the `audience` gives the person a stable pseudonym at your site. A token without an audience, or a grant, carries a per-token subject, so its assessment has `human.pseudonym: null` while `human.backed` still says a person approved.

### Signature outcomes

| Outcome | Signal | Makes a signed agent |
| --- | --- | --- |
| Verifies against a key its directory publishes | none | Yes |
| Fails: forged, tampered, too old or replayed | `signature_invalid`, `signature_expired`, `signature_replayed` | No, and adds to `bot_score` |
| Can't be attributed: the directory didn't resolve or doesn't list the key | `unknown_signature_agent` | No, and adds to `bot_score` |

## Example

Check a request with [`POST /v1/identify/assessments`](https://provenanceauth.com/docs/api/traffic-checks.md#post-v1-identify-assessments). This one comes from curl, which names itself in its user agent:

**curl**

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

curl -s $PROVENANCE_API/v1/identify/assessments \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "request": { "method": "GET", "url": "https://quillstack.example/products/linen-a5", "headers": { "user-agent": "curl/8.7.1" } } }'
```

**Node**

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

const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY!, baseUrl: process.env.PROVENANCE_API });
const assessment = await prov.identify.assess({
  request: { method: "GET", url: "https://quillstack.example/products/linen-a5", headers: { "user-agent": "curl/8.7.1" } },
});
```

**Python**

```python
import os
from provenanceauth import Provenance

prov = Provenance(os.environ["PROVENANCE_KEY"], base_url=os.environ["PROVENANCE_API"])
assessment = prov.identify.assess(request={
    "method": "GET", "url": "https://quillstack.example/products/linen-a5", "headers": {"user-agent": "curl/8.7.1"},
})
```

The full assessment:

```json
{
  "object": "traffic_assessment",
  "id": "tas_01M6M6EF2X58TGZGVF8FKGG0N9",
  "class": "declared_bot",
  "agent": null,
  "human": null,
  "bot_score": 40,
  "signals": [{ "code": "declared_bot_ua", "description": "The user agent declares automation (a bot, crawler or spider token). (an HTTP library)" }],
  "vendor_score": { "status": "not_configured" },
  "protocol": null,
  "decision": { "action": "allow", "shadow": null },
  "policy": null,
  "signature": { "method": "none", "valid": null, "key_id": null, "directory": null, "agent_id": null, "covers": [] },
  "authority": null,
  "bot": { "likelihood": 40, "band": "medium", "reason": null, "signals": [] },
  "action": "browse",
  "request": { "method": "GET", "path": "/products/linen-a5", "agent": { "platform": null } },
  "source": "hosted",
  "created_at": "2026-11-04T21:11:40.377Z",
  "response": null
}
```

`class` is the conclusion; `signals` say why. `decision` is what your traffic policy did with it, and `response`, when the policy answers for you, is the status, headers and body to send back.

A hosted check is recorded, so you can read it back by its `tas_` id at `GET /v1/identify/assessments/{id}`, or list them at `GET /v1/identify/assessments`. A read carries what was recorded: the request's method and path, the class, the agent, the signals and the decision, never the `response`. Reports from your middleware are traffic decisions, at `GET /v1/identify/decisions`.

The list filters on the outcome, the class, the signature, the bot likelihood and when it was assessed. To show these visits to your staff in your own admin tool, use the [traffic list](https://provenanceauth.com/docs/embeds/traffic-list.md) and [traffic result](https://provenanceauth.com/docs/embeds/traffic-result.md) embeds.

## Related

- [Verify signed agents](https://provenanceauth.com/docs/identify/guides/verify-signed-agents.md)
- [Require a human](https://provenanceauth.com/docs/identify/guides/require-a-human.md)
- [`POST /v1/identify/assessments`](https://provenanceauth.com/docs/api/traffic-checks.md#post-v1-identify-assessments)
