View as Markdown

Account · Guide

If a key leaks

Keys leak the way all keys do: committed to a public repository, pasted into a ticket, printed in a log. Provenance acts on a leaked key as soon as it's reported, and tells you where it was found and what it did.

Availability: every plan, at no charge.

Before you begin: nothing to set up. Choose what a leaked live key does under Settings → Agents → Takeover protection (revoke at once by default, or tell you only).

1. Know the key formats

New keys end in a 6-character checksum, so a scanner can tell a Provenance key from random text with almost no false matches:

KeyFormat
Live API keyprv_live_ + 32 random characters + a 6-character checksum
Sandbox API keyprv_test_ + 32 random characters + a 6-character checksum
Webhook signing secretwhsec_ + 32 random characters + a 6-character checksum

The checksum is the CRC32 of everything before it (prefix included), written as 6 base62 characters. Keys made before the checksum keep working. The console marks them under Developers → API keys: rotate them so scanners can match them too.

2. See what happens to a leaked key

What leakedWhat Provenance does
A live API keyRevokes it at once (or only tells you, if you chose that).
A sandbox API keyTells you. It keeps working, so rotate it, or revoke it if nothing should use it.
A webhook signing secretRotates it. Deliveries carry a signature from the new secret and, for 24 hours, from the old one, so your receiver can switch without dropping events.
An agent signing key's private partRevokes the signing key and opens a takeover check for the agent with the reason key_leaked.

Provenance never holds an agent's private key; a report counts only when its private part matches a registered public key.

Owners and admins get an email, a console task and the api_key.leaked webhook, with where the key was found (the URL from the report), what was done, and a link to make a new key. GET /v1/leaked_key_reports lists your reports.

3. Report a key you found

Anyone can report a Provenance key, without an account. Send the whole key and, if you have it, where you found it:

curl -s -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" }'
{
  "object": "leaked_key_report_receipt",
  "received": true
}

The answer is always 202 with the same body, whether the key is valid, unknown or already revoked, so the route can't be used to test keys. Each address can report 10 keys an hour.

4. GitHub secret scanning

Provenance receives GitHub's secret scanning reports at POST /v1/public/secret_scanning/github, in GitHub's partner format. It checks GitHub's ECDSA P-256 signature against the keys GitHub publishes before it acts on a report, and answers each match with GitHub's true_positive or false_positive label. A report whose signature doesn't verify changes nothing.

Availability: the endpoint answers 503 secret_scanning_not_configured until GitHub enables scanning for Provenance keys. Until then, report keys with the route in step 3.

Errors you might see

CodeWhat to do
rate_limit_exceededWait for the hour's window to reset, then report again.
secret_scanning_not_configuredReport the key with POST /v1/public/leaked_keys.
secret_scanning_signature_invalidSend the report exactly as GitHub signed it.
secret_scanning_keys_unavailableThe report was held, not trusted. GitHub retries it.

See also