SDK reference · Python SDK
prov.trace.canary_families.put
prov.trace.canary_families.put in Python SDK. Write your own card for a family (wins over a curated one for your readings).
Signature
prov.trace.canary_families.put(slug: str, card: dict) -> AnyParameters
slugstrRequiredcarddictRequired
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;
nullgoes 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
Any Your card.
HTTP operation
PUT /v1/trace/canary_families/{slug}: Set a family card
Errors
- authentication_required
- invalid_json
- parameter_invalid
- parameter_missing
- rate_limit_exceeded
- resource_missing
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();import os
import httpx
api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/trace/canary_families/wire_fraud", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"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()