Platform · API reference
Leaked keys
Reports of leaked keys: GitHub secret scanning, anyone's report, and your matched reports.
Related guide: If a key leaks
The leaked key report object
Attributes
idstring- Unique identifier for the object.
objectenum- The type of object. One of
leaked_key_report. kindenum- What leaked. One of
api_key,webhook_secret,agent_signing_key. key_refstring- The API key, webhook endpoint or signing key it matched.
key_environmentstring | null- The key's environment (
sandboxorlive). sourceenum- Who reported it. One of
github,public. found_atstring | null- The URL from the report.
outcomeenum- What Provenance did. One of
revoked,reported,rotated,notify_only,already_revoked. created_atstring- When it was created.
Events
Sent to your webhook endpoints when they subscribe:
api_key.leaked
List leaked-key reports
GET/v1/leaked_key_reports
Reports that matched one of your keys, newest first: what leaked, where it was found and what Provenance did. A hash of the value is kept, never the value.
Parameters
limitintegerquery- Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid.
cursorstringquery- Opaque; pass a response's
next_cursorback to get the next page.
Returns
A page of reports.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/leaked_key_reports" \
-H "Authorization: Bearer $PROVENANCE_KEY"const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/leaked_key_reports`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/leaked_key_reports", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()Response 200
{
"object": "list",
"data": [],
"has_more": false,
"next_cursor": null
}Report a leaked key
POST/v1/public/leaked_keys
Anyone can report a Provenance key, no account needed. Always 202 with the same body, whether the key is valid, unknown or revoked. 10 reports an hour per address.
No API key needed.
Parameters
keystringRequired- The whole key: an API key, a webhook signing secret, or an agent signing key's private JWK as JSON.
urlstring- Where you found it.
Returns
Received.
Errors
curl -X POST "$PROVENANCE_API/v1/public/leaked_keys" \
-H "Content-Type: application/json" \
-d '{
"key": "prv_live_notarealkeyatall000000000000000",
"url": "https://github.com/example/repo/blob/main/.env"
}'const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/public/leaked_keys`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"key": "prv_live_notarealkeyatall000000000000000",
"url": "https://github.com/example/repo/blob/main/.env"
}),
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/public/leaked_keys", json={
"key": "prv_live_notarealkeyatall000000000000000",
"url": "https://github.com/example/repo/blob/main/.env"
}).json()Response 202
{
"object": "leaked_key_report_receipt",
"received": true,
"message": "Thanks. If this is a Provenance key, its owner is told and it is handled."
}