SDK reference · Node SDK

prov.trace.canarySets.create

prov.trace.canarySets.create in Node SDK. Define an account canary family on a model (Growth+).

Signature

prov.trace.canarySets.create(params: { family: string; model: string; members: TraceCanaryMember[]; description?: string; card?: CanaryFamilyCardInput }): Promise<TraceCanarySet>

Parameters

params{ family: string; model: string; members: TraceCanaryMember[]; description?: string; card?: CanaryFamilyCardInput }Required

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
familystringRequired
The canary family.
modelstringRequired
A model_version_id (or slug).
membersarray of objectsRequired
The neurons in the canary set, each with its trip threshold.
Show child attributes
layerintegerRequired
The model layer.
idxintegerRequired
The neuron's index within its layer.
poleenumRequired
The sign of the activation, pos or neg. One of pos, neg.
thresholdnumberRequired
The trip threshold.
descriptionstring
A longer description.
cardobject
The family's concept card. Required unless a card already describes the family (yours, or a curated one); 400 parameter_missing (param card) otherwise.
Show child attributes
titlestringRequired
A short title.
definitionstringRequired
What the family measures.
may_indicatearray of stringsRequired
What a trip of this family may indicate.
not_necessarilyarray of strings
Common benign causes.
examplesarray of objects
Labeled examples.
Show child attributes
flaggedstringRequired
How many were flagged.
benignstringRequired
Whether it's benign.
severityenum
How serious a trip of this family is. One of low, medium, high.
recommended_actionstring | null
What to do when this family trips.
mappingsobject
Related entries in public AI-risk frameworks.
Show child attributes
owasp_llmstring
The matching OWASP Top 10 for LLM Applications entries.
mitre_atlasstring
The matching MITRE ATLAS techniques.
aiuc_1array of strings
The matching AIUC-1 controls.
draft_idstring
Save a built canary draft (cdr_…): send its model, family and members as built. The set takes the draft's held-out precision and recall and its label summary, and the draft's example text is deleted. Anything else is 409 canary_draft_mismatch.

Returns

Promise<TraceCanarySet> The canary set, with its members.

HTTP operation

POST /v1/trace/canary_sets: Create a canary set

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/canary_sets`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "family": "wire_fraud",
    "model": "qwen2.5-0.5b-instruct@7ae55760",
    "members": [
      {
        "layer": 16,
        "idx": 1495,
        "pole": "pos",
        "threshold": 11
      }
    ],
    "card": {
      "title": "Wire fraud",
      "definition": "Text that pushes the agent to send money to a new or changed account.",
      "may_indicate": [
        "An email asks to change where an invoice is paid"
      ]
    }
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.