SDK reference · Node SDK

prov.trace.canaryFamilies.put

prov.trace.canaryFamilies.put in Node SDK. Write your own card for a family (your card wins over a curated one for your readings).

Signature

prov.trace.canaryFamilies.put(slug: string, card: CanaryFamilyCardInput): Promise<CanaryFamily>

Parameters

slugstringRequired
cardCanaryFamilyCardInputRequired

Request fields

slugstringpathRequired
The family's slug.
titlestring
A short title.
definitionstring
What the family measures.
may_indicatearray of strings
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.
spikeobject | null
A change to the family's spike alert setting. Fields left out keep their value; null goes back to the defaults.
Show child attributes
enabledboolean
Turn spike alerts on or off for the family.
windowenum
The window trips are counted in. One of 1h, 24h.
min_tripsinteger
The fewest trips in the window that can be a spike.
factornumber
How many times the usual rate is a spike.

Returns

Promise<CanaryFamily> Your card.

HTTP operation

PUT /v1/trace/canary_families/{slug}: Set a family card

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/canary_families/wire_fraud`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "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.