# Probes

Linear probes that predict a family before the model writes.

Related guide: [Predictive preflight](https://provenanceauth.com/docs/trace/guides/predictive-preflight.md)

## Endpoints

- `POST /v1/trace/probes`: [Register a probe](#post-v1-trace-probes)
- `GET /v1/trace/probes/{id}`: [Retrieve a probe](#get-v1-trace-probes-id)
- `GET /v1/trace/probes`: [List probes](#get-v1-trace-probes)
- `DELETE /v1/trace/probes/{id}`: [Delete a probe](#delete-v1-trace-probes-id)

## The trace probe object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | no | Unique identifier for the object. |
| `object` | enum | no | The type of object. One of `trace_probe`. |
| `model_version` | string | no | The model version, as a registry model ID. |
| `name` | string | no | A name you choose. |
| `scope` | enum | no | What the object applies to. One of `curated`, `account`. |
| `layer` | enum | no | The model layer. One of `final_norm`. |
| `position` | enum | no | Where in the model it reads. One of `last_prompt_token`. |
| `d_model` | integer | no | The model width the weights match. |
| `bias` | number | no | The probe's bias term. |
| `threshold` | number | no | The trip threshold. |
| `weights_hash` | string | no | SHA-256 of the probe's weights. |
| `grade` | enum | no | How the measurement was graded. One of `fixture`, `validated`, `account`. |
| `card` | object | no | The family's concept card. |
| `card.precision` | number \| null | no | Measured precision, from 0 to 1. |
| `card.recall` | number \| null | no | Measured recall, from 0 to 1. |
| `card.auroc` | number \| null | no | Area under the ROC curve, from 0 to 1. |
| `card.dataset` | string | no | The dataset it was measured on. |
| `card.n` | integer | no | The number of samples it's based on. |
| `card.positives` | integer | no | How many positive examples. |
| `card.description` | string \| null | no | A longer description. |
| `weights_b64` | string | no | Your own probes only. |
| `created_at` | timestamp | no | When it was created. |
| `deleted` | enum | no | Always true for a deleted object. One of `true`. |

### Example

```json
{
  "id": "prb_fixture_refusal",
  "object": "trace_probe",
  "model_version": "qwen2.5-0.5b-instruct@7ae55760",
  "name": "refusal",
  "scope": "curated",
  "layer": "final_norm",
  "position": "last_prompt_token",
  "d_model": 896,
  "bias": -9.703206,
  "threshold": 0.5,
  "weights_hash": "27d23d3615afb46f70031cebd28a64ba25d0eef8e4cab30fa5699a7db6646b01",
  "grade": "fixture",
  "card": {
    "precision": 0.75,
    "recall": 0.8571,
    "auroc": 0.9784,
    "n": 40,
    "positives": 7,
    "dataset": "eval_sets/prompt_injection.jsonl + credential_exfiltration.jsonl, odd pairs held out (fixture)",
    "description": "The model is about to refuse: read at the last prompt token, before generation."
  },
  "created_at": "2026-11-07T19:21:45.885Z"
}
```

## Register a probe

`POST /v1/trace/probes`

*Available on Enterprise.*

Registers a linear probe trained on the model, with its weights, threshold and concept card, for predictive preflight.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | Retry a create safely: the same key + request returns the stored response (24 h, per caller). |
| `model_version` | body | string | yes | The model version, as a registry model ID. |
| `name` | body | string | yes | A name you choose. |
| `weights_b64` | body | string | yes | The probe's weights, base64-encoded float32 values. |
| `bias` | body | number | no | The probe's bias term. |
| `threshold` | body | number | yes | The trip threshold. |
| `card` | body | object | yes | The family's concept card. |
| `card.precision` | body | number \| null | yes | Measured precision, from 0 to 1. |
| `card.recall` | body | number \| null | yes | Measured recall, from 0 to 1. |
| `card.auroc` | body | number \| null | yes | Area under the ROC curve, from 0 to 1. |
| `card.dataset` | body | string | yes | The dataset it was measured on. |
| `card.n` | body | integer | yes | The number of samples it's based on. |
| `card.positives` | body | integer | no | How many positive examples. |
| `card.description` | body | string \| null | no | A longer description. |

### Returns

The probe. See [the trace probe object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`plan_required`](https://provenanceauth.com/docs/platform/errors.md#plan_required)
- [`probe_dimension_mismatch`](https://provenanceauth.com/docs/platform/errors.md#probe_dimension_mismatch)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl -X POST "$PROVENANCE_API/v1/trace/probes" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_version": "qwen2.5-0.5b-instruct@7ae55760",
    "name": "refund_fraud",
    "weights_b64": "AAAAAA",
    "threshold": 0.7,
    "card": {
      "precision": 0.91,
      "recall": 0.84,
      "auroc": 0.95,
      "n": 400,
      "dataset": "Refund-fraud eval set, 400 labeled prompts"
    }
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/probes`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "model_version": "qwen2.5-0.5b-instruct@7ae55760",
    "name": "refund_fraud",
    "weights_b64": "AAAAAA",
    "threshold": 0.7,
    "card": {
      "precision": 0.91,
      "recall": 0.84,
      "auroc": 0.95,
      "n": 400,
      "dataset": "Refund-fraud eval set, 400 labeled prompts"
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/trace/probes", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "model_version": "qwen2.5-0.5b-instruct@7ae55760",
    "name": "refund_fraud",
    "weights_b64": "AAAAAA",
    "threshold": 0.7,
    "card": {
        "precision": 0.91,
        "recall": 0.84,
        "auroc": 0.95,
        "n": 400,
        "dataset": "Refund-fraud eval set, 400 labeled prompts"
    }
}).json()
```

### Response 201

```json
{
  "id": "prb_01M5R0D5H0M4Q8T1W3Y6A9C2EG",
  "object": "trace_probe",
  "model_version": "qwen2.5-0.5b-instruct@7ae55760",
  "name": "refund-abuse",
  "scope": "account",
  "layer": "final_norm",
  "position": "last_prompt_token",
  "d_model": 896,
  "bias": -4.218733,
  "threshold": 0.5,
  "weights_hash": "6e1b9d4a2c7f3e08b5a1d9c4f2e7b3a06d8c1f5e9b2a7d4c0f6e3b8a1d5c9f2e",
  "grade": "account",
  "card": {
    "precision": 0.82,
    "recall": 0.77,
    "auroc": 0.91,
    "n": 240,
    "positives": 60,
    "dataset": "Your labeled refund requests, 20% held out",
    "description": "The model is about to approve a refund outside policy."
  },
  "created_at": "2026-10-24T22:48:10.774Z"
}
```

## Retrieve a probe

`GET /v1/trace/probes/{id}`

Returns one probe and its card.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

No parameters.

### Returns

The probe. See [the trace probe object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s "$PROVENANCE_API/v1/trace/probes?model_version=qwen2.5-0.5b-instruct%407ae55760" \
  -H "Authorization: Bearer $PROVENANCE_KEY" > step.json
export PROBE_ID=$(jq -r '.data[0].id' step.json)
curl "$PROVENANCE_API/v1/trace/probes/$PROBE_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/probes?model_version=qwen2.5-0.5b-instruct%407ae55760`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
const probeId = step1.data[0].id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/probes/${probeId}`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.get(f"{api}/v1/trace/probes?model_version=qwen2.5-0.5b-instruct%407ae55760", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
probe_id = step1["data"][0]["id"]
data = httpx.get(f"{api}/v1/trace/probes/{probe_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "prb_fixture_refusal",
  "object": "trace_probe",
  "model_version": "qwen2.5-0.5b-instruct@7ae55760",
  "name": "refusal",
  "scope": "curated",
  "layer": "final_norm",
  "position": "last_prompt_token",
  "d_model": 896,
  "bias": -9.703206,
  "threshold": 0.5,
  "weights_hash": "27d23d3615afb46f70031cebd28a64ba25d0eef8e4cab30fa5699a7db6646b01",
  "grade": "fixture",
  "card": {
    "precision": 0.75,
    "recall": 0.8571,
    "auroc": 0.9784,
    "n": 40,
    "positives": 7,
    "dataset": "eval_sets/prompt_injection.jsonl + credential_exfiltration.jsonl, odd pairs held out (fixture)",
    "description": "The model is about to refuse: read at the last prompt token, before generation."
  },
  "created_at": "2026-11-07T19:21:45.885Z"
}
```

## List probes

`GET /v1/trace/probes`

Lists the predictive probes for a model: the curated ones and your own.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `model_version` | query | string | no | The model version, as a registry model ID. |
| `limit` | query | integer | no | The most items to return, from 1 to 100. The default is 20. |
| `cursor` | query | string | no | The `next_cursor` from the previous page. |

### Returns

The probes.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/trace/probes?model_version=qwen2.5-0.5b-instruct%407ae55760" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/probes?model_version=qwen2.5-0.5b-instruct%407ae55760`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/trace/probes?model_version=qwen2.5-0.5b-instruct%407ae55760", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "prb_fixture_refusal",
      "object": "trace_probe",
      "model_version": "qwen2.5-0.5b-instruct@7ae55760",
      "name": "refusal",
      "scope": "curated",
      "layer": "final_norm",
      "position": "last_prompt_token",
      "d_model": 896,
      "bias": -9.703206,
      "threshold": 0.5,
      "weights_hash": "27d23d3615afb46f70031cebd28a64ba25d0eef8e4cab30fa5699a7db6646b01",
      "grade": "fixture",
      "card": {
        "precision": 0.75,
        "recall": 0.8571,
        "auroc": 0.9784,
        "n": 40,
        "positives": 7,
        "dataset": "eval_sets/prompt_injection.jsonl + credential_exfiltration.jsonl, odd pairs held out (fixture)",
        "description": "The model is about to refuse: read at the last prompt token, before generation."
      },
      "created_at": "2026-11-07T19:21:45.885Z"
    },
    {
      "id": "prb_fixture_harmful_compliance",
      "object": "trace_probe",
      "model_version": "qwen2.5-0.5b-instruct@7ae55760",
      "name": "harmful_compliance",
      "scope": "curated",
      "layer": "final_norm",
      "position": "last_prompt_token",
      "d_model": 896,
      "bias": -2.836678,
      "threshold": 0.5,
      "weights_hash": "ad15c2a17e1d9d7de453b45388600f02df0d2b058531148b511240bda408af25",
      "grade": "fixture",
      "card": {
        "precision": 0.8,
        "recall": 0.5714,
        "auroc": 0.7912,
        "n": 40,
        "positives": 14,
        "dataset": "eval_sets/prompt_injection.jsonl + credential_exfiltration.jsonl, odd pairs held out (fixture)",
        "description": "An injected or credential-exfiltration request the model is about to go along with."
      },
      "created_at": "2026-11-07T19:21:45.885Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## Delete a probe

`DELETE /v1/trace/probes/{id}`

Deletes one of your probes.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

No parameters.

### Returns

The deleted object. See [the trace probe object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl -X DELETE "$PROVENANCE_API/v1/trace/probes/prb_01M5Q2KD3N7V4Y9W1XQ2B8R6TS" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/probes/prb_01M5Q2KD3N7V4Y9W1XQ2B8R6TS`, {
  method: "DELETE",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.delete(f"{api}/v1/trace/probes/prb_01M5Q2KD3N7V4Y9W1XQ2B8R6TS", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}).json()
```

### Response 200

```json
{
  "id": "prb_01M5R0D5H0M4Q8T1W3Y6A9C2EG",
  "object": "trace_probe",
  "deleted": true
}
```
