View as Markdown

Trace · API reference

Canary baselines

Per-agent normal ranges that relative canary rules compare against.

Related guide: Canary baselines

The trace canary baseline object

Attributes

idstring
Unique identifier for the object.
objectenum
The type of object. One of trace_canary_baseline.
agent_idstring | null
The registered agent's ID.
scopeenum
What the object applies to. One of agent, account.
model_versionstring
The model version, as a registry model ID.
familystring
The canary family.
versioninteger
The version number.
statusenum
The object's current status. One of learning, ready, stale, superseded.
min_samplesinteger
Readings needed before the baseline is ready.
ninteger
The number of samples it's based on.
excludedinteger
Readings left out because they tripped an absolute threshold.
meannumber
The mean score learned.
sigmanumber
The standard deviation learned.
sigma_floornumber
The smallest standard deviation used, so a quiet baseline doesn't trip on tiny changes.
histogramarray of integers
100 bins over [0, 1].
started_attimestamp
When learning started.
ready_attimestamp | null
When it became ready; null while learning.
stale_attimestamp | null
When it went stale; null while current.
updated_attimestamp
When it last changed.
deletedenum
Always true for a deleted object. One of true.

The trace canary baseline object

{
  "id": "cbl_01M6VQC3ZTADBA4G41FR6QHPAP",
  "object": "trace_canary_baseline",
  "agent_id": null,
  "scope": "account",
  "model_version": "qwen2.5-0.5b-instruct@7ae55760",
  "family": "prompt_injection",
  "version": 1,
  "status": "learning",
  "min_samples": 20,
  "n": 0,
  "excluded": 0,
  "mean": 0,
  "sigma": 0,
  "sigma_floor": 0.01,
  "histogram": [
    0,
    0,
    0,
    "… 97 more"
  ],
  "started_at": "2026-11-07T19:22:10.298Z",
  "ready_at": null,
  "stale_at": null,
  "updated_at": "2026-11-07T19:22:10.298Z"
}

Create canary baselines

POST/v1/trace/baselines

Starts learning a baseline per canary family for one agent, or for the whole account, from its traced readings. Relative canary rules read the baseline once it's ready.

Parameters

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
agent_idstring
The registered agent's ID.
model_versionstringRequired
The model version, as a registry model ID.
familiesarray of strings
Canary families.
min_samplesinteger
Readings needed before the baseline is ready.

Returns

The baselines, now learning.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/trace/baselines" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_version": "qwen2.5-0.5b-instruct@7ae55760",
    "families": [
      "prompt_injection"
    ],
    "min_samples": 20
  }'

Response 201

{
  "object": "list",
  "data": [
    {
      "id": "cbl_01M6VQC3ZTADBA4G41FR6QHPAP",
      "object": "trace_canary_baseline",
      "agent_id": null,
      "scope": "account",
      "model_version": "qwen2.5-0.5b-instruct@7ae55760",
      "family": "prompt_injection",
      "version": 1,
      "status": "learning",
      "min_samples": 20,
      "n": 0,
      "excluded": 0,
      "mean": 0,
      "sigma": 0,
      "sigma_floor": 0.01,
      "histogram": [
        0,
        0,
        0,
        "… 97 more"
      ],
      "started_at": "2026-11-07T19:22:10.298Z",
      "ready_at": null,
      "stale_at": null,
      "updated_at": "2026-11-07T19:22:10.298Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Retrieve a canary baseline

GET/v1/trace/baselines/{id}

Returns one baseline with its sample count, mean, spread and status.

Parameters

No parameters.

Returns

The baseline. See the trace canary baseline object.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "invoice-bot" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/trace/baselines" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"agent_id\": \"$AGENT_ID\",
    \"model_version\": \"qwen2.5-0.5b-instruct@7ae55760\",
    \"families\": [
      \"prompt_injection\"
    ],
    \"min_samples\": 20
  }" > step.json
export BASELINE_ID=$(jq -r '.data[0].id' step.json)
curl "$PROVENANCE_API/v1/trace/baselines/$BASELINE_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "id": "cbl_01M6VQC3ZVB52JSAQHN9H52SX3",
  "object": "trace_canary_baseline",
  "agent_id": "agt_01M6VQC3ZTFEAJAJ3NWH4A0FBF",
  "scope": "agent",
  "model_version": "qwen2.5-0.5b-instruct@7ae55760",
  "family": "prompt_injection",
  "version": 1,
  "status": "learning",
  "min_samples": 20,
  "n": 0,
  "excluded": 0,
  "mean": 0,
  "sigma": 0,
  "sigma_floor": 0.01,
  "histogram": [
    0,
    0,
    0,
    "… 97 more"
  ],
  "started_at": "2026-11-07T19:22:10.299Z",
  "ready_at": null,
  "stale_at": null,
  "updated_at": "2026-11-07T19:22:10.299Z"
}

List canary baselines

GET/v1/trace/baselines

Lists your canary baselines with their status and learned statistics.

Parameters

agent_idstringquery
The registered agent's ID.
model_versionstringquery
The model version, as a registry model ID.
statusenumquery
The object's current status. One of learning, ready, stale, superseded.
limitintegerquery
The most items to return, from 1 to 100. The default is 20.
cursorstringquery
The next_cursor from the previous page.

Returns

The baselines, newest first.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/trace/baselines" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "object": "list",
  "data": [],
  "has_more": false,
  "next_cursor": null
}

Delete a canary baseline

DELETE/v1/trace/baselines/{id}

Deletes a baseline.

Parameters

No parameters.

Returns

The deleted object. See the trace canary baseline object.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "invoice-bot" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/trace/baselines" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"agent_id\": \"$AGENT_ID\",
    \"model_version\": \"qwen2.5-0.5b-instruct@7ae55760\",
    \"families\": [
      \"prompt_injection\"
    ],
    \"min_samples\": 20
  }" > step.json
export BASELINE_ID=$(jq -r '.data[0].id' step.json)
curl -X DELETE "$PROVENANCE_API/v1/trace/baselines/$BASELINE_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 200

{
  "id": "cbl_01M6VQC3ZYPHVSY9AA5927SX7Z",
  "object": "trace_canary_baseline",
  "deleted": true
}

Re-learn a canary baseline

POST/v1/trace/baselines/{id}/relearn

Starts a new version of a baseline from scratch. The current version keeps serving until the new one is ready.

Parameters

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

Returns

The new baseline version, now learning. See the trace canary baseline object.

Errors

export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/trace/baselines/cbl_01M5QYCNK0ZC7PTD9E04A15A7E/relearn" \
  -H "Authorization: Bearer $PROVENANCE_KEY"

Response 201

{
  "id": "cbl_01M5R0CRN3WESNVCQYET3WP313",
  "object": "trace_canary_baseline",
  "agent_id": null,
  "scope": "account",
  "model_version": "qwen2.5-0.5b-instruct@7ae55760",
  "family": "prompt_injection",
  "version": 2,
  "status": "learning",
  "min_samples": 20,
  "n": 0,
  "excluded": 0,
  "mean": 0,
  "sigma": 0,
  "sigma_floor": 0.01,
  "histogram": [
    0,
    0,
    0,
    "… 97 more"
  ],
  "started_at": "2026-10-24T22:49:02.130Z",
  "ready_at": null,
  "stale_at": null,
  "updated_at": "2026-10-24T22:49:02.130Z"
}

Was this page helpful? Send us feedback

LLM? Read llms.txt.