# Server configuration

The environment variables a self-hosted Provenance API and trace worker read, grouped by what they control, with their defaults.

These are the environment variables a self-hosted Provenance API reads. Every setting is optional unless marked required; an unset integration reports itself as not configured instead of returning made-up results.

## Core

| Variable | Default | What it controls |
| --- | --- | --- |
| `NODE_ENV` | `development` | `production` hardens the posture: weak secrets refuse boot and development routes are off. |
| `API_ENVIRONMENT` | `sandbox` | `sandbox` seeds the fixtures on boot; `live` is for real data. |
| `PORT`, `HOST` | `8080`, `0.0.0.0` | Where the API listens. |
| `DATABASE_URL` | unset | A Postgres URL. Unset uses the in-memory store. |
| `DATABASE_POOL_MAX` | `10` | Postgres connections per replica. Keep replicas × pool under the database's limit. |
| `RATE_LIMIT_BACKEND` | `memory` | Where rate-limit windows and single sign-on state live. `memory` is per process, right for one replica; `pg` shares them through Postgres so several replicas enforce one limit. |
| `SESSION_RATE_LIMIT` | `100` | Requests a minute for one signed-in console session. API keys and addresses keep their own limits. |
| `DEMO_KEY_RATE_LIMIT` | `1000` | Requests a minute for each of Provenance's own live demo keys, on a sandbox that runs the demos (`DEMO_ACCOUNTS=on`). Every other key keeps its own limit; a live deployment ignores it. |
| `REPLICAS` | `1` | How many API replicas you run. More than one with the `memory` backend logs a startup warning. |
| `JWT_SECRET` | dev value | Required in production: at least 32 characters. |
| `DOCS_BASE_URL` | `https://www.provenanceauth.com/docs` | The base of `doc_url` in error bodies. A localhost value refuses boot in live. |
| `EMAIL_MARK_URL` | `https://provenanceauth.com/brand/provenance-mark.png` | The Provenance mark beside "Powered by Provenance" in emails when `NEXT_PUBLIC_SITE_URL` is unset, not an absolute URL, or localhost. Otherwise the mark comes from the site. |
| `E2E_WORLD_RESET_TOKEN` | unset | On a sandbox with `NODE_ENV=production` (a staging stack), turns on the operator route that deletes and re-seeds the synthetic test accounts before an end-to-end run. Callers send it in `X-World-Reset-Token`. Never served in live. |

## Signing keys

| Variable | Default | What it controls |
| --- | --- | --- |
| `INTENT_SIGNING_KEY_PEM` | ephemeral in sandbox | Required in production. The EC P-256 key that signs intent tokens, receipts and manifests; its public half is published at `/.well-known/jwks.json`. |
| `INTENT_SIGNING_KEY_PEM_PREVIOUS` | unset | The previous key during a rotation, kept in the JWKS until its tokens expire. |
| `AP2_ISSUER` | `off` | `on` signs AP2 mandates after a passkey approval and serves `/.well-known/ap2/jwks.json`. |
| `AP2_ISSUER_KEY_PEM` | made at boot in sandbox | Required in production while `AP2_ISSUER` is on. A separate EC P-256 key that signs AP2 mandates only. |
| `AP2_MANDATE_TTL_SECONDS` | `600` | How long each issued copy of a closed AP2 mandate lives (never past the intent token inside). |
| `AP2_APP_SIGN_WAIT_SECONDS` | `120` | How long an approval opened from the Provenance app waits for the app's key before the issuer key signs. |
| `ISSUER_DEADLINE_MARGIN_MS` | `250` | How long before a card processor hook's budget an issuer decision must answer; past it the program's fail mode answers. |
| `ISSUER_LITHIC_API_BASE` | `https://sandbox.lithic.com` | Where a decoupled 3-D Secure challenge's answer goes for a Lithic card program that set its API key. |
| `ISSUER_HOLD_HOURS` | `168` | How long an authorization's hold counts against an agent's card limit when the processor sends no clearing, reversal or expiry for it. |
| `INTENT_TOKEN_ISSUER` | `provenance-authorize` | The `iss` claim; set it to your API's public URL. |
| `INTENT_SUBJECT_KEY` | unset | 32 random bytes, base64. Keys every token's `sub`: pairwise per audience (`psub_…`) or per token (`anon_…`), never the device id. Required in live; elsewhere a key derived from `JWT_SECRET` is used. Rotating it gives every device a new subject, and a new pseudonym, at every site. |
| `RISK_SIGNALS_ENCRYPTION_KEY` | unset | 32 random bytes, base64. Encrypts risk providers' lookup secrets. In live, adding a provider answers 503 `risk_signals_not_configured` until it's set; elsewhere a key derived from `JWT_SECRET` is used. |
| `RISK_SIGNALS_ENCRYPTION_KEY_PREVIOUS` | unset | The old `RISK_SIGNALS_ENCRYPTION_KEY` during a rotation: values sealed under it still open, new ones use the new key. Run `node apps/api/scripts/reseal.mjs --key RISK_SIGNALS_ENCRYPTION_KEY` to re-seal the rest, then unset it. |
| `TSA_URL` | unset | An RFC 3161 timestamp authority for evidence exports and the transparency log. Unset marks timestamps `not_configured`. |

## Trace worker

| Variable | Default | What it controls |
| --- | --- | --- |
| `TRACE_BACKEND` | `fixture` in a sandbox, else `none` | `remote` uses your worker; `none` answers `503 trace_backend_not_configured`. `fixture` is refused in production. |
| `TRACE_WORKER_URL`, `TRACE_WORKER_TOKEN` | unset | Your worker's URL (https and a public host in production) and its bearer token. |
| `TRACE_MASK_SALT` | — | Required in production: at least 16 random characters, salting the opaque IDs of masked neurons. |
| `TRACE_TIMEOUT_MS`, `TRACE_INFERENCE_TIMEOUT_MS` | `30000`, `120000` | Worker request timeouts. |
| `TRACE_READING_MAX_AGE_S` | `900` | How old a reading can be for verify and check. |
| `TRACE_WORKER_KEYS_FREE`, `TRACE_WORKER_KEYS_PRO`, `TRACE_WORKER_KEYS_GROWTH` | `1`, `1`, `5` | Active [sidecar](https://provenanceauth.com/docs/self-host/sidecar.md) worker keys per plan; Enterprise has no limit. |
| `FREE_TRIAL_TRACE_READINGS` | `1000` | Signed readings across the Free trial. |
| `PRICE_TIERS_TRACE_READING` | `10000000:0.1,100000000:0.02,1000000000:0.005,inf:0.002` | The signed-reading tiers, `up_to:cents` by monthly volume, ending in `inf`. |
| `TRACE_MAX_PROMPT_CHARS` | `32000` | The prompt size limit. |
| `TRACE_DEFAULT_MODEL` | `qwen3-8b` | The hosted model when a request names none. |
| `TRACE_KEEP_WARM_INTERVAL_MS` | `0` | Pings a serverless worker's `/health` on this interval to keep the model loaded. |
| `TRACE_BASELINE_MAX_AGE_DAYS`, `TRACE_BASELINE_SIGMA_FLOOR` | `30`, `0.01` | When a learned baseline goes stale, and the smallest sigma used for z-scores. |
| `TRACE_EXPLAINER_URL`, `TRACE_EXPLAINER_TOKEN`, `TRACE_EXPLAINER_TIMEOUT_MS` | unset, unset, `20000` | The endpoint behind AI trip summaries. It receives `POST {instructions, explanations}` and answers `{text, model}`. |
| `TRACE_EVAL_ENCRYPTION_KEY` | unset | 32 random bytes, base64 (`openssl rand -base64 32`). Encrypts eval-suite prompt text with AES-256-GCM. Required in live when a trace backend is on; elsewhere a key derived from `JWT_SECRET` is used, with a startup warning. Replacing it without `TRACE_EVAL_ENCRYPTION_KEY_PREVIOUS` makes stored suite prompts unreadable. |
| `TRACE_EVAL_ENCRYPTION_KEY_PREVIOUS` | unset | The old `TRACE_EVAL_ENCRYPTION_KEY` during a rotation: values sealed under it still open, new ones use the new key. Run `node apps/api/scripts/reseal.mjs --key TRACE_EVAL_ENCRYPTION_KEY` to re-seal the rest, then unset it. |
| `TRACE_EVAL_MAX_PROMPTS`, `TRACE_EVAL_RUNS_PER_HOUR` | `50`, `30` | Prompts per eval suite, and suite runs an account may start per hour. |
| `TRACE_LABELER_API_KEY` | unset | The Anthropic key behind [neuron labels](https://provenanceauth.com/docs/trace/guides/neuron-labels.md). Unset (or `TRACE_LABELER=none`), label requests answer `503 trace_labeler_not_configured`. |
| `TRACE_LABEL_MODEL`, `TRACE_LABEL_RECHECK_MODEL` | `claude-haiku-5-5`, `claude-sonnet-5-5` | The first-pass model and the model that re-checks a canary member's label. A model without a list price in the API is refused, so a label is never billed at a guessed price. |
| `TRACE_LABEL_MARGIN_PCT` | `30` | The margin over model cost on each label. |
| `TRACE_LABELS_PER_HOUR`, `TRACE_LABELS_MAX_PER_REQUEST` | `200`, `20` | New labels an account may get an hour, and neurons one request may name. |
| `TRACE_LABELER_TIMEOUT_MS`, `TRACE_LABELER_BASE_URL` | `30000`, unset | The labeller call timeout, and a base URL for a proxy in front of the Anthropic API. |
| `TRACE_CANARY_COUNTS_RETENTION_DAYS` | `90` | How long hourly canary counts are kept. |
| `TRACE_CANARY_SPIKE_MIN_TRIPS`, `TRACE_CANARY_SPIKE_FACTOR` | `5`, `3` | The default spike alert every canary family has until someone changes it: at least this many trips in an hour and this many times the usual rate. |
| `TRACE_WORKER_BATCHED_READ` | `off` | `on` once your worker serves `POST /v1/activations/examples`, the read the canary family builder ranks neurons from. Off, building a family from examples answers `503 trace_backend_unavailable`. |
| `TRACE_CANARY_PROPOSALS_PER_DAY`, `TRACE_CANARY_GENERATIONS_PER_DAY` | `1000`, `10` | Proposed labels and plain-words generations an account may have a day in each environment. Both use the explainer endpoint (`TRACE_EXPLAINER_URL`). |
| `TRACE_CANARY_TRIES_PER_MINUTE` | `30` | Try-a-sample readings one member may ask for a minute. |
| `PUBLIC_API_URL` | unset | The API's public https base. Hosted agent key directories and cards are published under it, and Twilio's signed webhooks are checked against it. Required in live (the API refuses to boot without it); elsewhere, unset, each request's host is used. |
| `IDENTIFY_PSEUDONYM_KEY` | unset | 32 random bytes, base64. The root of every per-site pseudonym. Required in live; elsewhere a key derived from `JWT_SECRET` is used. Rotating it gives every person a new pseudonym at every site. |
| `IDENTIFY_PSEUDONYM_KEY_PREVIOUS` | unset | The old `IDENTIFY_PSEUDONYM_KEY` during a rotation: lookups match pseudonyms and contact hashes under either key, sealed values open under either, new ones use the new key. Run `node apps/api/scripts/reseal.mjs --key IDENTIFY_PSEUDONYM_KEY`, then unset it at the end of the announced window. |
| `IDENTIFY_BUNDLE_TTL_SECONDS`, `IDENTIFY_MAX_SIGNATURE_AGE_SECONDS` | `300`, `60` | How often the middleware refreshes its policy bundle, and the oldest signature it accepts. |
| `IDENTIFY_DECISIONS_TTL_DAYS`, `IDENTIFY_DIRECTORY_TIMEOUT_MS` | `30`, `2000` | Default decision retention, and the timeout for fetching another operator's key directory. |
| `IDENTIFY_NETWORK_DIRECTORIES` | unset | The card network agent programs' key directories, as JSON: `[{ "program": "mastercard_agent_pay", "url": "https://…", "type": "directory" }]` (`type` is `directory`, `jwks_uri` or `key_lookup`). Their signatures verify only against these; a program with none reads `unverified`. |
| `IDENTIFY_NETWORK_SIGNATURE_WINDOW_SECONDS` | `480` | The longest a card network signature may live (`expires - created`), 60 to 3600. |

The worker reads its own settings:

| Variable | What it controls |
| --- | --- |
| `TRACE_WORKER_BACKEND` | `hf` to run a Hugging Face model, `fixture` to replay the sandbox recordings |
| `TRACE_MODEL` | The Hugging Face model ID to load |
| `TRACE_WORKER_TOKEN` | The bearer token the API sends |
| `LABELER_URL` | An agent labeler for registry builds; unset uses the heuristic labeler |
| `TRACE_SIDECAR`, `TRACE_SIGNING_KEY_PEM`, `TRACE_SIGNING_KEY_ID`, `PROVENANCE_API_URL` | [Sidecar](https://provenanceauth.com/docs/self-host/sidecar.md) mode |
| `TRACE_READING_SAMPLE_RATE` | The share of sidecar requests to read, `0` to `1` (default `1`); see [sampling](https://provenanceauth.com/docs/self-host/sidecar.md#sampling) |

## Attest

| Variable | Default | What it controls |
| --- | --- | --- |
| `SIGHTENGINE_API_USER`, `SIGHTENGINE_API_SECRET` | unset | The synthetic-media detector. Unset answers `503 detector_not_configured`. |
| `SCREENING_MONTHLY_BUDGET`, `SCREENING_DAILY_BUDGET` | `300`, `20` | Detector calls per month and per day. |
| `EXIF_TOLERANCE_SECONDS`, `GEOFENCE_RADIUS_KM` | `600`, `5` | Tolerances for the EXIF time and geofence risk factors. |
| `DOCUMENT_CLASSIFIER_URL`, `DOCUMENT_CLASSIFIER_KEY` | unset | The hosted classifier for the document type check on ID shots. Unset, every ID shot's check reads `not_run` (`document_classifier_not_configured`). |
| `DOCUMENT_CLASSIFIER_TIMEOUT_MS`, `DOCUMENT_CHECK_DAILY_BUDGET` | `2000`, `2000` | The time after which a document check reads `not_run` (`document_classifier_unavailable`) and the shot goes on, and the classifier calls one account makes per UTC day. |
| `ATTEST_RECAPTURE`, `ATTEST_RECAPTURE_THRESHOLD`, `ATTEST_RECAPTURE_TIMEOUT_MS` | `on`, `0.5`, `1500` | The screen-or-print check on each photo: `off` skips it, the probability at which it fires, and the time after which a photo reads "Not checked". |
| `CLAIM_LINK_RADIUS_M`, `CLAIM_LINK_WINDOW_HOURS` | `250`, `168` | The distance and time window for linking claims by GPS. |
| `INTEGRITY_CHECKS` | `off` | `on` verifies iOS App Attest and Android Play Integrity evidence at device enrollment. |
| `APP_ATTEST_APP_ID`, `PLAY_INTEGRITY_PACKAGE_NAME`, `PLAY_INTEGRITY_JWKS` | unset | The app identities those checks verify against. |
| `ANDROID_ATTESTATION_STATUS_URL` | Google's attestation status URL | With integrity checks on, the revoked and suspended Android attestation certificates. `off` skips the check in sandbox; in live, Android hardware tiers then count as unverified. |
| `ANDROID_ATTESTATION_STATUS_REFRESH_SECONDS`, `ANDROID_ATTESTATION_STATUS_MAX_AGE_SECONDS` | `3600`, `86400` | How often the list is fetched, and how old it may get before Android hardware tiers count as unverified. |
| `CAPTURE_RELEASE` | `off` | `on` shows the [capture release](https://provenanceauth.com/docs/attest/guides/capture-release.md) before every camera and refuses face and ID captures without an agreement. |
| `CAPTURE_PROVENANCE_APP` | `off` | Where capture links open: `development` lets development and test builds of the Provenance app take link captures; `on` makes it ready on each platform whose store listing is set. See [where the link opens](https://provenanceauth.com/docs/attest/guides/capture-requests.md#where-the-link-opens). |
| `CAPTURE_APP_CLIP`, `APP_CLIP_BUNDLE_ID` | `off`, unset | `on` with the clip's bundle id and `APP_STORE_URL` makes the App Clip ready on iPhone. |
| `CAPTURE_STORE_LISTING` | `off` | `on` offers Provenance's store listing (`APP_STORE_URL`, `PLAY_STORE_URL`) on capture links. |
| `TERMS_OF_SERVICE_VERSION` | `draft-2026-11-11` | The Terms of Service version served and recorded; its texts ship with the API. A live API refuses to boot with the release on and a `draft-` version. |
| `TERMS_OF_SERVICE_URL` | unset | The public Terms of Service page the sheet links to. Required in live with the release on. |
| `REMINDER_MAX_PER_REQUEST` | `3` | The most [reminders](https://provenanceauth.com/docs/messaging/reminders.md) one request can get (3 at most; 0 turns them off). |
| `REMINDER_MIN_GAP_SECONDS` | `600` | The least time between the last message to a person and a reminder for the same request. |
| `REMINDER_QUIET_START`, `REMINDER_QUIET_END` | `21`, `8` | The local hours between which a text reminder is held and sent when they end. |
| `CONTACT_PUSH_PHONE_MAX_AGE_DAYS` | `365` | A capture request or cart approval goes to a person's Provenance app instead of a text only when they verified that phone within this many days ([details](https://provenanceauth.com/docs/messaging/reminders.md#9-when-your-customer-has-the-provenance-app)). |
| `REQUEST_FOLLOW_UP_TEXTS_ENABLED` | `true` | The operator switch for follow-up texts after an app notification ([details](https://provenanceauth.com/docs/messaging/reminders.md#11-the-follow-up-text)). `false` stops every follow-up text at once: none is scheduled, and a waiting one ends `paused` when it comes due. No account can see or change it. |
| `TEXT_CONSENT_WORDING_VERSION` | `draft-2026-11-14` | The [consent to text](https://provenanceauth.com/docs/messaging/text-consent.md) wording version recorded with each consent; its texts ship with the API. |
| `TEXT_CONSENT_RETENTION_DAYS` | `1461` | How long a withdrawn consent to text is kept before the daily sweep deletes it. |
| `TEXT_CONSENT_REQUIRED` | `on` | A company's text goes only to a phone with a consent on record (`no_text_consent` otherwise, [details](https://provenanceauth.com/docs/messaging/text-consent.md#10-when-a-text-goes)). `off` skips the check and keeps the records as evidence only. No account can see or change it. |
| `TEXT_CONSENT_BOX_DAILY_CAP` | `500` | Consent box ticks one account can record in a day, each of which may send the company's confirmation text. Past it the box answers `429` and records nothing. |
| `PHONE_OTP_ACCOUNT_DAILY_CAP` | `10` | Verification texts to an account's own phones (the account's and each member's) in a day. A person can also send only five in 15 minutes. At the cap the phone routes answer `429` and send nothing. |
| `PHONE_OTP_NUMBER_DAILY_CAP` | `3` | Verification texts one number can get in a day, from any account. |
| `PHONE_OTP_DAILY_PLATFORM_CAP` | `1000` | Verification texts to account phones across the deployment in a day. At this cap no account can send one until the day's window ends. |

## Authorize

| Variable | Default | What it controls |
| --- | --- | --- |
| `APPROVAL_TTL_SECONDS` | `600` | How long a step-up approval stays actionable. |
| `STEPUP_PENDING_PER_ORIGIN` | `1` | Pending checkout step-ups per person per store; `0` turns the rule off. |
| `STEPUP_PER_ORIGIN_HOUR`, `STEPUP_PER_ORIGIN_DAY` | `5`, `20` | Checkout step-ups per person per store in an hour and in a day. |
| `STEPUP_PER_ACCOUNT_HOUR` | `30` | Checkout step-ups per operator account in an hour. |
| `APPROVAL_LINK_TTL_SECONDS` | `900` | How long a signed mobile approval link stays valid. |
| `DECISION_LEDGER_MAX` | `10000` | Ledger records the in-memory store keeps per environment. Postgres keeps them all. |
| `ORDER_REFUND_REPEAT_COUNT`, `ORDER_REFUND_REPEAT_DAYS` | `3`, `90` | How many refunds for the same shopper or agent, inside how many days, mark an order's ending `refund_abuse`. A single refund reads `refunded`. |
| `GRANT_ADJUST_LINK_TTL_MS` | `1800000` | How long an adjust link from a refused order lasts. An ask's link lasts as long as the ask. |
| `GRANT_ADJUST_NOTICE_TTL_MS` | `86400000` | The most a near-limit notice's adjust link lasts; otherwise it lasts until the budget window resets. |
| `DELEGATION_PLAN_TTL_MS` | `86400000` | How long a proposed delegation plan waits for the person before it expires (it is never accepted by silence), at most until the parent grant ends. |
| `COUNTER_OFFER_ASK_TTL_MS` | `86400000` | The ceiling on how long a counter-offer ask waits for the person. The wait itself is the person's setting, else the account's, else 24 hours; it also ends 30 seconds before the offer does and at the brief's deadline. |
| `COUNTER_OFFER_ASK_LIMITS` | `10,10` | Asks per brief per day, then open asks per person. Past either, the option is refused with `counter_offer_ask_limit` and still recorded. |
| `COUNTER_OFFER_COLLECT_MAX_SECONDS` | `120` | The longest a collect window (`collect_seconds` on a counter-offer or the account setting) gathers offers from several outside agents before one ask goes out. |
| `AUTHORITY_PROOF_TTL_SECONDS` | `600` | The longest an offer-scoped authority proof (`authority+jwt`) lives, 30 to 600 seconds. It never outlives the offer or the acceptance it covers. |
| `RESPONDER_PROPOSALS_PER_REQUEST` | `5` | How many proposals one responder agent may try on one request in an hour over MCP, dry runs included, 1 to 20. |
| `AGENT_MCP_TOKEN_TTL_SECONDS` | `900` | The life of a client-credentials MCP token (an agent signing in with its own key, or a party with no account signing in with its website key), 60 to 3600 seconds. |
| `PERSONAL_CARD_KEY` | none | 32 random bytes, base64. Keys the hash of a bank card's token on a person's card list. Without it a live API refuses bank card links with 503; the sandbox derives one. |
| `WEBAUTHN_ORIGIN`, `WEBAUTHN_RPID` | local dashboard | The origin and relying-party ID passkey ceremonies run under. |
| `APPROVER_NETWORK` | `on` | `off` pauses new approver invites; existing links keep working. |
| `THREEDS_BRIDGE` | `off` | `on` serves an approval's 3DS Requestor data (the FIDO data and browser fields) for a payment provider; off answers 503 `threeds_bridge_not_configured`. |
| `THREEDS_BANK_STEP` | `off` | `on` (with `THREEDS_BRIDGE`) runs the [bank check](https://provenanceauth.com/docs/authorize/guides/bank-check.md) on the approval page; off answers 503 `threeds_bank_step_not_configured`. |
| `THREEDS_PROVIDERS` | unset | The providers whose adapters you confirmed in their sandboxes, comma-separated: `checkout_com`, `adyen`, `cybersource`, `stripe`. Any other answers 503 `threeds_provider_not_configured`. |
| `THREEDS_BANK_STEP_TIMEOUT_SECONDS` | `600` | How long a bank check or its challenge waits for the store's result (60 to 3600). |
| `GUARANTEE_SHADOW_FEE_BPS`, `GUARANTEE_MONTHLY_LIMIT_CENTS` | `30`, `0` | The internal loss ledger shown in Ops: the rate each passkey-approved order is priced at, in basis points, and the monthly limit in cents (`0`: none). Nothing reaches a merchant. |
| `GUARANTEE_NEW_COVERAGE`, `GUARANTEE_PAYOUTS`, `GUARANTEE_LADDER`, `GUARANTEE_ORDER_LIMITS`, `GUARANTEE_WAITING_DAYS`, `GUARANTEE_YOUNG_WAITING_DAYS`, `GUARANTEE_TERMS_VERSION` | `off`, `hold`, `5000000:50,25000000:40,:30`, `50000:25000:10000`, `60`, `90`, `2026-11-21-draft` | The merchant program on top of that ledger, off by default: `on` allows enrolment and new orders, `hold` keeps cash payments for operator review, the monthly fee steps (cents:basis points), the per-order limits in cents (device passkey, synced passkey, standing permission), the waiting periods in days and the terms version. With `GUARANTEE_MONTHLY_LIMIT_CENTS` at `0` nothing is paid. |
| `UCP_RAILS`, `UCP_SCHEMA_BASE`, `UCP_PROFILE_FETCH_TIMEOUT_MS`, `UCP_MAX_BODY_BYTES` | `on` in the sandbox environment and `off` on live, the site URL, `3000`, `262144` | The Universal Commerce Protocol routes (off: 503 `ucp_unconfigured`), where the extension schema is served (its host must bind `com.provenanceauth`, or the profile routes answer 503), the profile fetch deadline in milliseconds and the body cap in bytes. |
| `PRESCRIBER_NPPES_URL`, `PRESCRIBER_LEIE_CSV`, `SAM_GOV_API_KEY`, `PRESCRIBER_VENDOR_URL`, `PRESCRIBER_VENDOR_API_KEY` | NPPES only | The prescriber credential sources for clinician ordering. An unset source caps the reachable tier. |
| `RUN_RECORD_ENCRYPTION_KEY` | unset | 32 random bytes, base64 (`openssl rand -base64 32`). Seals run-record spans at rest with AES-256-GCM. In live, the run-record routes answer 503 `run_record_not_configured` until it's set (runs, halts and the run guard still work); elsewhere a key derived from `JWT_SECRET` is used. |
| `RUN_RECORD_ENCRYPTION_KEY_PREVIOUS` | unset | The old `RUN_RECORD_ENCRYPTION_KEY` during a rotation: values sealed under it still open, new ones use the new key. Run `node apps/api/scripts/reseal.mjs --key RUN_RECORD_ENCRYPTION_KEY` to re-seal the rest, then unset it. |
| `DISPUTE_EVIDENCE_ENCRYPTION_KEY` | unset | 32 random bytes, base64 (`openssl rand -base64 32`). Seals evidence added to agent disputes with AES-256-GCM. In live, adding evidence answers 503 `dispute_evidence_not_configured` until it's set (the automatic bundle, findings and outcomes still work); elsewhere a key derived from `JWT_SECRET` is used. |
| `DISPUTE_EVIDENCE_ENCRYPTION_KEY_PREVIOUS` | unset | The old `DISPUTE_EVIDENCE_ENCRYPTION_KEY` during a rotation: values sealed under it still open, new ones use the new key. Run `node apps/api/scripts/reseal.mjs --key DISPUTE_EVIDENCE_ENCRYPTION_KEY` to re-seal the rest, then unset it. |

## Verified calls

AI agents register their phone calls and businesses check them ([verified calls](https://provenanceauth.com/docs/authorize/concepts/verified-calls.md)).

| Variable | Default | What it controls |
| --- | --- | --- |
| `VOICE_CALLS` | `on` in a sandbox, `off` in live | Turns verified calls on. Off, every call route answers `503 calls_not_configured`. |
| `CALL_CREDENTIAL_ENCRYPTION_KEY` | unset | 32 random bytes, base64 (`openssl rand -base64 32`). Seals each registered call credential, which holds both phone numbers, with AES-256-GCM. Required in live while `VOICE_CALLS` is on; elsewhere a key derived from `JWT_SECRET` is used. |
| `CALL_CREDENTIAL_ENCRYPTION_KEY_PREVIOUS` | unset | The old `CALL_CREDENTIAL_ENCRYPTION_KEY` during a rotation: values sealed under it still open, new ones use the new key. Run `node apps/api/scripts/reseal.mjs --key CALL_CREDENTIAL_ENCRYPTION_KEY` to re-seal the rest, then unset it. |
| `CALLS_RELAY_ADDRESS` | the site's host + `/c` | The short address, without a scheme, a person types a relayed call code at. |
| `CALLS_PROOF_WAIT_SECONDS` | `20` | How long a call check waits for the operator's proof after a challenge, unless the request sets `wait` (at most 30). |
| `CALLS_HOLD_WAIT_SECONDS` | `120` | How long a confirmation to the person stays open while the call holds, unless the request sets `wait` (10 to 300). |
| `TWILIO_FROM_VOICE` | `TWILIO_FROM_SMS` | A voice-capable Twilio number for placed calls, used to read a number-verification code out on a call. Unset with no SMS number, a verification by call reports `channel_not_configured`. |

Twilio reports on the calls it places to `/webhooks/twilio/voice` on `PUBLIC_API_URL`. Each callback must carry a valid `X-Twilio-Signature` for `TWILIO_AUTH_TOKEN` and a signed single-use token, or it answers `401 voice_callback_invalid`.

## Delivery

| Variable | Default | What it controls |
| --- | --- | --- |
| `WEBHOOKS_ENABLED` | `on` | Runs the outbound webhook worker. In production, endpoint URLs must be https and public. Off, resend and replay answer `503 webhooks_unavailable`. |
| `DEVLOG_ENCRYPTION_KEY` | unset | 32 random bytes, base64 (`openssl rand -base64 32`). Seals request-log bodies with AES-256-GCM. Unset, a sandbox seals under a key made at boot (bodies readable until a restart) and live keeps metadata only. |
| `DEVLOG_ENCRYPTION_KEY_PREVIOUS` | unset | The old `DEVLOG_ENCRYPTION_KEY` during a rotation: values sealed under it still open, new ones use the new key. Run `node apps/api/scripts/reseal.mjs --key DEVLOG_ENCRYPTION_KEY` to re-seal the rest, then unset it. |
| `DEVLOG_ENABLED` | `on` | `off` stops logging requests; events are still stored. |
| `DEVLOG_QUEUE_MAX` | `10000` | Request-log records waiting to be written before new ones are dropped and counted. |
| `DEVLOG_RETENTION_OVERRIDES`, `DEVLOG_RETENTION_MAX_DAYS` | unset, `365` | Longer request-log and event windows for named Enterprise accounts (`acct_id:days,…`), capped at the maximum. |
| `DEVTOOLS_STREAM_RECHECK_SECONDS` | `60` | How often an open live tail or `provenance listen` stream re-checks its console session or key; a signed-out session, removed member or revoked key ends the stream at the next check. |
| `CONSOLE_STREAM` | `on` | `off` turns off the console's live updates: `GET /v1/account/stream` answers 503 and the console checks every 15 seconds instead. |
| `CONSOLE_STREAM_POLL_MS` | `2000` | How often the one poller per account and environment reads the store for the account stream (at least 250). |
| `CONSOLE_STREAM_MAX_PER_MEMBER` | `4` | Open account streams per console member; one more ends the oldest. |
| `RESEND_API_KEY`, `MAIL_FROM` | unset | Transactional email. Unset logs mail in a sandbox and answers `503 mailer_not_configured` in production. |
| `TWILIO_ACCOUNT_SID`, `TWILIO_AUTH_TOKEN`, `TWILIO_FROM_SMS` | unset | SMS delivery of approval requests. Point the `TWILIO_FROM_SMS` number's "A message comes in" webhook at `/webhooks/twilio/sms` on `PUBLIC_API_URL` (HTTP POST) so STOP and START replies reach the [stop list](https://provenanceauth.com/docs/messaging/reminders.md#5-handle-a-person-who-stopped-texts); a reply without a valid `X-Twilio-Signature` answers `401 sms_webhook_invalid`. |
| `SHORT_LINK_BASE_URL` | unset | The origin that serves [short links](https://provenanceauth.com/docs/messaging/short-links.md) at `/c/<code>` (the site, e.g. `https://provenanceauth.com`). Set, approval, capture and hosted page links in texts become `<origin>/c/<code>` and `POST /v1/embed/links` answers a `short_url`. The site asks the API named by the code's first letter: `NEXT_PUBLIC_SANDBOX_API_URL` for `t`, `NEXT_PUBLIC_API_URL` for `l`. Unset, texts keep the long link. |
| `SHOPIFY_API_KEY` | unset | The Shopify app's client ID, from the Shopify Partner Dashboard, for [Shopify stores](https://provenanceauth.com/docs/authorize/guides/shopify.md). With it and `SHOPIFY_API_SECRET` unset, the Shopify routes answer 503 `store_integration_unconfigured`. |
| `SHOPIFY_API_SECRET` | unset | The Shopify app's client secret. It also checks Shopify's webhook and redirect signatures. |
| `SHOPIFY_SCOPES` | `read_orders,write_orders,write_merchant_managed_fulfillment_orders` | The access the app asks a shop for, comma-separated. |
| `SHOPIFY_API_VERSION` | `2026-10` | The Shopify Admin API version the app calls. |
| `SHOPIFY_BILLING_TEST` | on, off in production | Marks every charge billed through Shopify as a test charge, never billed. Set `off` to bill for real. |
| `SHOPIFY_USAGE_CAP_CENTS` | `50000` | The usage cap a new Shopify plan asks the merchant to approve when the account has no spend cap of its own, in cents for a 30-day cycle. |
| `SHOPIFY_DISPUTE_SCOPES` | `off` | `on` asks connecting shops for Shopify Payments' dispute scopes and answers their chargebacks with staged text ([chargeback responses](https://provenanceauth.com/docs/authorize/guides/chargeback-responses.md#shopify-payments)). `read` asks only for reading disputes: chargebacks are matched and the merchant pastes the prepared text. Leave it off until Shopify approves the scopes for your app. |
| `WOOCOMMERCE_INTEGRATION` | on | The [Provenance for WooCommerce](https://provenanceauth.com/docs/authorize/guides/woocommerce.md) plugin's routes. It needs no credential: each store gets its own secret, sealed under the Identify vault. `off` answers 503 `store_integration_unconfigured` on them. |
| `CHARGEBACK_STRIPE_KEYS` | `on` | Stripe connections with a merchant's restricted key, for [chargeback responses](https://provenanceauth.com/docs/authorize/guides/chargeback-responses.md); `off` answers 503 `payment_connection_unconfigured`. The key and its webhook secret are sealed under the Identify vault. |
| `STRIPE_APP_SECRET_KEY` | (unset) | The restricted key of your Stripe App's backend (kept apart from the billing key; a test key on sandbox, a live key only on live). With the two below, merchants can connect by installing the App. |
| `STRIPE_CONNECTED_WEBHOOK_SECRET` | (unset) | The signing secret of the webhook endpoint at `/webhooks/stripe/connected` that listens to connected accounts. |
| `STRIPE_APP_ID` | (unset) | The Stripe App's OAuth client id (`ca_…`). Without all three, the App path answers 503 `payment_connection_unconfigured`. |
| `STRIPE_SPT_API_VERSION`, `PAYMENT_SIGNAL_TIMEOUT_MS` | `2026-09-30.preview`, `5000` | The Stripe API version the shared payment token read sends, and the most a checkout assessment waits for Stripe before the payment facts stay as reported (500 to 10000). |
| `CHARGEBACK_SWEEP_MS` | `300000` | How often the chargeback sweep runs: retries, submits before the deadline, review reminders and the daily reconcile. |
| `IDENTIFY_STOREFRONT_EVENTS_PER_MINUTE` | `600` | The most [storefront check](https://provenanceauth.com/docs/identify/guides/storefront-check.md) events one site may send a minute (10 to 100,000); over it the beacon answers 429. |
| `IDENTIFY_BACKTEST_SAMPLE` | `20000` | The most recorded decisions one [traffic backtest](https://provenanceauth.com/docs/identify/guides/backtest-traffic-rules.md) replays, newest first (100 to 200,000); past it the answer says `truncated`. |
| `OPS_ALERT_STORE_SIGNATURE_FAILURES_PER_HOUR` | `10` | Store webhooks with a bad signature in an hour that raise `store_integration_failing` (0 disables). |
| `OPS_ALERT_STORE_TOKEN_REFRESH_FAILURES_PER_HOUR` | `3` | Failed Shopify token refreshes in an hour that raise `store_integration_failing` (0 disables). |
| `OPS_ALERT_STORE_USAGE_CHARGE_FAILURES_PER_HOUR` | `3` | Usage charges to Shopify that failed in an hour that raise `store_integration_failing` (0 disables). |
| `OPS_ALERT_CHARGEBACK_FAILURES_PER_HOUR` | `3` | Chargeback responses that failed on one platform in an hour that raise `chargeback_response_missed` (0 disables; a missed deadline always raises it). |
| `OPS_ALERT_UCP_COMPLETION_MISMATCHES_PER_HOUR` | `10` | UCP completions refused with `binding_mismatch` in an hour that raise `ucp_completion_mismatch_burst` (0 disables). |
| `EMAIL_PROVIDER`, `EMAIL_API_KEY`, `EMAIL_FROM` | unset | Approval and invite emails to approvers outside an account. `EMAIL_PROVIDER` is `postmark` or `resend`. Unset, nothing is sent and deliveries report `channel_not_configured`. |
| `EMAIL_POSTMARK_STREAM` | `approvals` | The Postmark message stream for approver emails. |
| `EMAIL_ACCOUNT_API_KEY` | unset | Postmark's account token, for companies' sending domains. Unset, adding a domain returns `502 email_provider_error`. |
| `IP_INTEL_PROVIDER`, `IP_INTEL_URL`, `IP_INTEL_API_KEY` | unset | An IP-intelligence lookup on approver decisions and on every captured shot: commercial VPN and proxy signals, the country behind `timezone_mismatch`, and a shot's network country and region. `GET <url>?ip=<ip>` with a Bearer key, answering `{ vpn, proxy, country }` and optionally `region`, `city`, `lat`, `lng`, `accuracy_radius_km` and `asn`. One request per decision or shot with a 300 ms budget; a slow answer falls back to the published lists. |
| `CHECKOUT_APPROVER_NETWORK_CITY` | `off` | `on` keeps the network city name the IP lookup gives, on approvals and on captured shots. Off, the city is dropped and reads `city_not_enabled`. |
| `GEOCODER_PROVIDER`, `GEOCODER_URL`, `GEOCODER_API_KEY` | unset | A geocoder for billing addresses on cart approvals. `GEOCODER_PROVIDER=nominatim` with `GEOCODER_URL` (a self-hosted Nominatim), and `GEOCODER_API_KEY` when a proxy in front wants a Bearer key. One lookup per distinct address per account, cached, with a 1 s budget; only the postal code, city, region and country are sent. Unset, the distance facts read `geocoder_not_configured` and the billing time zone comes from the region table. |
| `EMAIL_OWN_DOMAINS` | unset | More domains a company can't register as a sending domain, comma-separated. `EMAIL_FROM`'s domain and the console and API domains are always refused. |
| `VAPID_PUBLIC_KEY`, `VAPID_PRIVATE_KEY`, `VAPID_SUBJECT` | unset | Web push delivery. |
| `APNS_KEY_ID`, `APNS_TEAM_ID`, `APNS_PRIVATE_KEY`, `APNS_BUNDLE_ID`, `APNS_ENV` | unset, `production` | Push to the Provenance app on iPhone (token-based APNs). Unset, the app channel is skipped. |
| `FCM_PROJECT_ID`, `FCM_SERVICE_ACCOUNT_JSON` | unset | Push to the Provenance app on Android (FCM HTTP v1 with a service account). Unset, the app channel is skipped. |
| `APP_IOS_APP_IDS`, `APP_ANDROID_PACKAGE`, `APP_ANDROID_CERT_SHA256` | unset | What `/.well-known/apple-app-site-association` and `/.well-known/assetlinks.json` declare; unset, they answer 404. |
| `WEBAUTHN_APP_ORIGINS` | unset | Extra passkey origins the Android app reports (`android:apk-key-hash:…`), comma-separated. |
| `APP_STORE_URL`, `PLAY_STORE_URL` | unset | The store listings an approver invite links to, and a capture link's store listing. |

## Tool gateway

People connect their services once and their assistants use them through the Provenance MCP server ([Connect your tools](https://provenanceauth.com/help/personal/guides/connect-your-tools)).

| Variable | Default | What it controls |
| --- | --- | --- |
| `TOOL_GATEWAY` | on in sandbox, off in live | `on` serves the tool routes and adds connected tools to a person's tools on the MCP server. Off, the routes answer `503 tool_gateway_not_configured`. |
| `TOOL_TOKEN_ENCRYPTION_KEY` | unset | 32 random bytes, base64 (`openssl rand -base64 32`). Seals connected services' OAuth tokens and the opt-in call details with AES-256-GCM. Required in live while `TOOL_GATEWAY` is on: the API refuses to start without it. Elsewhere a key derived from `JWT_SECRET` is used. |
| `TOOL_TOKEN_ENCRYPTION_KEY_PREVIOUS` | unset | The old `TOOL_TOKEN_ENCRYPTION_KEY` during a rotation. Run `node apps/api/scripts/reseal.mjs --key TOOL_TOKEN_ENCRYPTION_KEY` to re-seal the rest, then unset it. |
| `TOOL_GATEWAY_SERVICES` | every service in sandbox, none in live | The catalog services offered, comma-separated (`github,notion`). |
| `TOOL_GATEWAY_CLIENT_ID_URL` | `<public API base>/v1/personal/tool_gateway_client` | The gateway's Client ID Metadata Document, which is also its client ID at services that take metadata documents. |
| `MCP_PUBLIC_URL` | unset | The public address of the Provenance MCP server (`https://mcp.<your domain>`), which the API also answers at `/v1/mcp` ([Provenance MCP](https://provenanceauth.com/docs/provenance-mcp.md)). Every MCP sign-in token carries it as its audience. Unset, MCP sign-in answers `503` and only API keys reach `/v1/mcp`. |
| `MCP_GRANT_CALLS_PER_MINUTE` | `60` | The tool calls, reads and writes alike, one connected app may make a minute; past it the call answers `rate_limit_exceeded` with `Retry-After`. `0` turns the limit off. |
| `MCP_GRANT_WRITES_PER_MINUTE` | `10` | The member writes (previews and dry runs) one connected app may start a minute; past it the call answers `rate_limit_exceeded` with `Retry-After`. `0` turns the limit off. |
| `MCP_MODERN_ERA` | `on` | Serve MCP 2026-07-28 statelessly beside the earlier versions; `off` answers 2026-07-28 with `-32022`. |
| `MCP_LEGACY_GRANT_KEY_UNTIL` | unset (read) | The last day (`YYYY-MM-DD`) a grant under the old `provenanceauth.com/grant` key is read. |
| `MCP_SESSION_HANDLE_IDLE_HOURS` | `24` | A `record_session` handle with no request for this long ends. |
| `MCP_CIMD_BLOCKED_HOSTS` | unset | Hosts whose Client ID Metadata Documents can't sign in, comma-separated. |
| `MCP_CIMD_FETCHES_PER_HOST_PER_HOUR` | `30` | Metadata document fetches per host per hour. |
| `DEVELOPER_MCP` | `on` | The developer tools on the MCP server, for a console sign-in with developer access ([Developer tools](https://provenanceauth.com/docs/provenance-mcp/developer-tools.md)). Sandbox only, and it needs `MCP_PUBLIC_URL`; `off` turns them off in sandbox too. |
| `DOCS_MCP_URL` | `NEXT_PUBLIC_SITE_URL` + `/docs/mcp` | The docs MCP server the MCP server forwards its docs tools to; `off` for none (the docs tools then answer `docs_unavailable`). |
| `DOCS_MCP_TIMEOUT_MS` | `5000` | The forward's deadline. |
| `TOOL_<SERVICE>_CLIENT_ID`, `TOOL_<SERVICE>_CLIENT_SECRET` | unset | Your OAuth app for a service without dynamic client registration (GitHub: `TOOL_GITHUB_CLIENT_ID`; Slack: `TOOL_SLACK_CLIENT_ID`). Its callback is `{DASHBOARD_ORIGIN}/me/tools/callback`. |
| `TOOL_GATEWAY_MONTHLY_CALLS` | `10000` | Tool calls a person may make each month. |
| `TOOL_UPSTREAM_TIMEOUT_MS`, `TOOL_UPSTREAM_MAX_BYTES` | `60000`, `10485760` | The deadline for a service's whole answer, and the largest answer passed through. |
| `OPS_ALERT_TOOL_GATEWAY_ADDED_P95_MS` | `80` | Added time on allowed calls over which the `tool_gateway_latency_budget` alert fires (more than 5% of calls); `0` disables it. |
| `OPS_ALERT_TOOL_UPSTREAM_ERROR_RATIO` | `0.2` | Upstream errors over allowed calls in 15 minutes that fire `tool_upstream_errors`; `0` disables it. |
| `OPS_ALERT_TOOL_REFRESH_FAILURES_PER_HOUR` | `20` | Failed token refreshes in an hour that fire `tool_token_refresh_failures`; `0` disables it. |

## Console and access

| Variable | Default | What it controls |
| --- | --- | --- |
| `DASHBOARD_ORIGIN` | local dashboard | The console origin allowed to send credentialed requests. |
| `DASHBOARD_LOGIN_ALLOWLIST` | empty (open) | Emails allowed to sign up and sign in to the console, by any method. Set, it pauses sign-up for everyone else: they get `403 beta_access_required`, which gives the contact address. |
| `GOOGLE_OAUTH_CLIENT_ID`, `GOOGLE_OAUTH_CLIENT_SECRET` | unset | Google sign-in. Register `<DASHBOARD_ORIGIN>/auth/oauth/google/callback` as the redirect URI. Unset hides the button and answers `503 oauth_provider_not_configured`. |
| `GITHUB_OAUTH_CLIENT_ID`, `GITHUB_OAUTH_CLIENT_SECRET` | unset | GitHub sign-in, from a GitHub OAuth app whose callback URL is `<DASHBOARD_ORIGIN>/auth/oauth/github/callback`. |
| `HIBP_RANGE_CHECK` | `off` | `on` checks new passwords against Have I Been Pwned's range API; off, signup reports `breach_check: "skipped"`. |
| `OPS_ALERT_AUTH_FAILURES_PER_HOUR` | `100` | Failed console sign-ins in an hour that fire the `auth_bruteforce` alert; `0` disables it. |
| `AUTH_FACTOR_ENCRYPTION_KEY` | unset | 32 random bytes, base64 (`openssl rand -base64 32`). Encrypts authenticator-app secrets with AES-256-GCM. Required in live; elsewhere a key derived from `JWT_SECRET` is used, with a startup warning. Replacing it without `AUTH_FACTOR_ENCRYPTION_KEY_PREVIOUS` breaks every authenticator app already set up. |
| `AUTH_FACTOR_ENCRYPTION_KEY_PREVIOUS` | unset | The old `AUTH_FACTOR_ENCRYPTION_KEY` during a rotation: values sealed under it still open, new ones use the new key. Run `node apps/api/scripts/reseal.mjs --key AUTH_FACTOR_ENCRYPTION_KEY` to re-seal the rest, then unset it. |
| `AUTH_TOTP_ISSUER` | `Provenance` | The name authenticator apps show for the account. |
| `OPS_ALERT_TWO_FACTOR_FAILURES_PER_HOUR` | `100` | Failed second-factor checks in an hour that fire the `two_factor_failures` alert; `0` disables it. |
| `OPS_ALERT_STEPUP_RATE_LIMITED_PER_HOUR` | `50` | Rate-limited checkout step-ups in an hour that fire the `approval_stepup_rate_limited_spike` alert; `0` disables it. |
| `OPS_ALERT_ISSUER_DEADLINE_MISSES_PER_HOUR` | `20` | Card authorizations answered after the processor's deadline in an hour that fire the `issuer_deadline_misses` alert; `0` disables it. |
| `OPS_ALERT_ISSUER_ASKS_ANSWERED_FLOOR` | `0.7` | The answered share of issuer approvals asked in an hour (at least 20) under which the `issuer_asks_under_floor` alert fires; `0` disables it. |
| `OPS_ALERT_NETWORK_DELIVERY_ERROR_RATIO` | `0.2` | The failed share of approver texts (at least 10 sent in 15 minutes) that fires the `network_delivery_failing` alert; `0` disables it. |
| `OPS_ALERT_DOCUMENT_CLASSIFIER_UNAVAILABLE_RATIO` | `0.2` | The share of document type checks on ID shots that couldn't reach the classifier (at least 10 in 15 minutes) that fires the `capture_document_classifier_failing` alert; `0` disables it. |
| `OPS_ALERT_APPROVER_IP_INTEL_ERROR_RATIO` | `0.2` | The failed share of IP lookups on cart approval decisions (at least 10 in 15 minutes) that fires the `approver_ip_intel_failing` alert; `0` disables it. |
| `ACCOUNT_CREATE_PER_IP_PER_DAY` | `20` | New accounts one IP can create in a day. |
| `ACCOUNT_EMAIL_ALLOW_DOMAINS`, `ACCOUNT_EMAIL_DENY_DOMAINS` | empty | Which email domains can sign up. |
| `SIGNUP_STARTS_PER_IP_PER_HOUR` | `10` | Sign-ups one IP can start in an hour (a password sign-up, or an emailed link sent from the Sign up page). The per-email limits still apply. |
| `SIGNUP_DISPOSABLE_EMAIL` | `flag` | Sign-ups from a throwaway-inbox domain on the bundled list: `flag` marks the sign-up, `block` refuses it with `400`, `off` ignores the list. |
| `SIGNUP_REQUIRE_PROFILE` | `on` | An account created through sign-up answers About you in the console before any other page opens, and can't create or rotate an API key until its name and company are saved (`403 profile_required`). `off` turns both off. Accounts created before About you existed, seeded and synthetic accounts, and members who joined by invite are never asked. |
| `SIGNUP_SUMMARY_HOUR_UTC` | `13` | The UTC hour (0–23) from which the daily sign-up summary goes to `INTERNAL_NOTIFY_EMAIL`, once a day across every replica. `off` sends none. |
| `SIGNUP_STALLED_DAYS` | `3` | Days without progress, before the first API call (or a person's passkey), after which the admin Sign-ups list and the summary call a sign-up stalled. |
| `OPS_ALERT_SIGNUP_STARTS_PER_HOUR` | `200` | New sign-ups in an hour that fire the `signup_spike` alert; `0` disables it. |
| `LAUNCH_DATE` | unset | The launch day, `YYYY-MM-DD` in UTC, for the Since launch range of Console › Ops › Launch. Unset, that range is hidden and `range=launch` answers `400`. |
| `PEOPLE_SIGNUP` | `invite` | `open` lets anyone set up Provenance for themselves at `/me/start`: a verified email, a verified mobile, then a passkey. `invite` pauses that; a person invite link still works. |
| `SIGNUP_TEXTS_PER_SIGNUP` | `3` | Code texts one personal sign-up can send after its email is verified. |
| `SIGNUP_TEXTS_PER_NUMBER_PER_DAY` | `3` | Sign-up code texts one mobile number can get in a day. |
| `SIGNUP_TEXTS_PER_DAY` | `500` | Sign-up code texts across the deployment in a day. At this cap the mobile step answers `429` and the `signup_texts_capped` alert fires. Without Twilio the mobile step is deferred: the person is created with a verified email and asked for the mobile once texting is set up. |
| `SIGNUP_TEXT_CONSENT_VERSION` | `draft-2026-11-10` | The wording version of the consent line above the mobile step's send button, recorded with each sign-up. Set it when the wording is signed. |
| `SIGNUP_TERMS_PUBLISHED` | `off` | `on` shows "By creating an account you agree to the Terms of Service, which include an arbitration agreement and a class action waiver." under the Sign up buttons, company and personal, on the web and in the app, with one link to the Terms of Service page (`TERMS_OF_SERVICE_URL`, else `NEXT_PUBLIC_SITE_URL` + `/legal/terms`), and records `TERMS_OF_SERVICE_VERSION` with each acceptance. A person who signed up under another version is asked once at the next open of the home or the app. Off, the line isn't shown and nothing is recorded or asked. |
| `PERSONAL_SIGNUP_COUNTRIES` | `US` | The countries a personal account's mobile number comes from, at sign-up and when one is added later, comma-separated two-letter codes. `US` covers Puerto Rico, Guam, the US Virgin Islands, American Samoa and the Northern Mariana Islands. Another number answers `400` and gets no text; numbers already on an account stay. Approval requests from companies reach people anywhere. |
| `CONSOLE_PRODUCTS_ACTIVITY_DAYS` | `14` | An account that ticked no product at Your products sees every product. Once it is this many days old, the products it used lead the console's sidebar and Get started and the rest sit under More products; with no activity, nothing changes. `0` applies it from the first day. |
| `API_MAINTENANCE` | `off` | `on` answers `503 service_unavailable_maintenance` on every route except health. |

## AI assists

The model endpoint behind [AI assists](https://provenanceauth.com/docs/account/ai-assists.md): checkout and traffic [rule suggestions](https://provenanceauth.com/docs/authorize/guides/rule-suggestions.md). With no provider set, every assist route answers `503 ai_assist_unconfigured`, the console says the assists aren't available on this deployment, and the nightly draft job skips.

| Variable | Default | What it controls |
| --- | --- | --- |
| `AI_ASSIST_PROVIDER` | `none` | `none`, `anthropic` (the Claude API), `http` (any other model host, the contract below) or `fake` (test drafts with no network, refused in a live posture). |
| `AI_ASSIST_URL` | unset | With `anthropic`, an optional base URL for a proxy in front of the Claude API. With `http`, the endpoint every assist call is sent to; it must pass the outbound URL guard. |
| `AI_ASSIST_TOKEN` | unset | The Claude API key (`anthropic`) or the bearer token (`http`). A secret: never logged. Without a token the provider counts as unconfigured. |
| `AI_ASSIST_MODEL` | `claude-haiku-5-5` | The model for every assist call. With `anthropic`, a model without a list price in the API leaves the assists unconfigured, so a call is never metered at a guessed price. |
| `AI_ASSIST_RETRY_MODEL` | `claude-sonnet-5-5` | One retry per account run when the first answer is declined, cut off, not JSON or doesn't match the schema. `none` turns the retry off. |
| `AI_ASSIST_TIMEOUT_MS` | `30000` | The deadline for one model call (1,000 to 120,000). |
| `AI_ASSIST_MAX_OUTPUT_TOKENS` | `4000` | The most tokens one answer may use (256 to 16,000). An answer cut off at the limit drops that run's drafts. |
| `AI_ASSIST_ACCOUNT_MONTHLY_USD` | `2` | Model cost per account per month, at list prices, after which that account's runs stop until the next month. A guard behind the draft cap. |
| `AI_ASSIST_DAILY_BUDGET_USD` | `25` | Model cost across the deployment per day. At the budget the job stops for the day. |
| `AI_ASSIST_DRAFT_CAP_PRO`, `AI_ASSIST_DRAFT_CAP_GROWTH`, `AI_ASSIST_DRAFT_CAP_ENTERPRISE` | `20`, `100`, `0` | Drafts shown per account per month on each plan. `0` means no cap. A Free account's trial allowance is fixed. |
| `AI_ASSIST_MAX_ASK_SHARE` | `0.1` | A checkout draft whose rule would decide more than this share of the orders in its 30-day backtest is dropped, and so is a traffic draft that would challenge, require an intent or block more than this share of requests. |
| `AI_ASSIST_JOB` | `on` | The nightly job that drafts for every account with an assist on. `off` leaves only the console's and the API's refresh. |
| `OPS_ALERT_AI_ASSIST_ERRORS_PER_CHECK` | `5` | Model calls that timed out or failed since the last alert check that raise `ai_assist_error_spike` (0 disables). Reaching the daily budget raises `ai_assist_budget_reached`. |
| `OPS_ALERT_INVESTIGATION_ERRORS_PER_CHECK` | `5` | [Investigation](https://provenanceauth.com/docs/account/investigations.md) model calls that timed out or failed since the last alert check that raise `investigation_error_spike` (0 disables). |

Only aggregated counts and rule conditions are sent; the prompt, the input and the raw answer are never stored or logged, only their hashes ([what is sent](https://provenanceauth.com/docs/account/ai-assists.md#what-is-sent)).

### The HTTP contract

With `AI_ASSIST_PROVIDER=http`, each assist call is one `POST` to `AI_ASSIST_URL`:

```http
POST /your/assist/endpoint HTTP/1.1
Authorization: Bearer <AI_ASSIST_TOKEN>
Content-Type: application/json

{
  "assist": "checkout_rule_drafts",
  "instructions": "The fixed instructions for this assist, versioned.",
  "input": { "totals": { "orders": 260, "flagged": 16 }, "segments": [] },
  "schema": { "type": "object" },
  "model": "claude-haiku-5-5"
}
```

| Field | What it is |
| --- | --- |
| `assist` | `checkout_rule_drafts` or `traffic_rule_drafts`. |
| `instructions` | The fixed instructions for the assist. Use them as the system prompt. |
| `input` | The account's aggregated input: totals, candidate segments with their counts, the field catalog and the current rules as conditions. |
| `schema` | The JSON schema the answer must match. |
| `model` | `AI_ASSIST_MODEL`, or `AI_ASSIST_RETRY_MODEL` on the retry. Your endpoint may map it to its own model. |

Answer `200` with the answer and what the call used:

```json
{
  "output": { "drafts": [], "none_reason": "no segment makes a sensible rule" },
  "model": "your-model-id",
  "usage": { "input_tokens": 9800, "output_tokens": 1200, "cache_read_tokens": 0 }
}
```

| Field | What it is |
| --- | --- |
| `output` | The answer object, or the same object as JSON text. Every draft in it is checked again before it is shown; one that fails is dropped. |
| `model` | The model that answered (at most 100 characters). Left out, the requested model is recorded. |
| `usage` | `input_tokens` and `output_tokens`; `cache_read_tokens` is optional. Missing counts read as 0. |

To decline, answer any `2xx` with `{"error": "declined"}`; for an answer cut off at the token limit, `{"error": "truncated"}`. Either gets one retry on the retry model; a second failure drops the run's drafts. Any other status, an answer that isn't JSON, or no `output` is a failed call: no draft is shown and the failure is counted.

The call goes through the same outbound guard as webhooks: in a production posture the host must resolve to public addresses only, redirects aren't followed, and the whole call has one deadline (`AI_ASSIST_TIMEOUT_MS`).

## Custom risk scores

The answering model behind custom risk scores: plain-English questions with the answers an account chooses, and a
probability for each answer that rules read. Reasons for an answer are written through the [AI assists](#ai-assists)
endpoint above, under its cost guards; with no assist endpoint, answers still work and reasons read unavailable.

| Variable | Default | What it controls |
| --- | --- | --- |
| `RISK_SCORE_PROVIDER` | `none` | Custom risk scores' answering model: `none`, `typed_decision` (Jev's System One API) or `mock` (deterministic test answers with no network, refused in a live posture). With `none`, every risk score fact reads unavailable and each rule's setting for that case decides. |
| `RISK_SCORE_DIALECT` | `jev_reseller` | Which host's API `typed_decision` speaks: `jev_reseller` (`POST {RISK_SCORE_URL}/api/v1/systemone/`) or `typesafe` (`POST {RISK_SCORE_URL}/v1/systemone`). Moving host changes this, the URL, the token, the model and the two limits, and nothing else. |
| `RISK_SCORE_URL` | unset | The host's base URL. It must pass the outbound URL guard. |
| `RISK_SCORE_TOKEN` | unset | The host's bearer token. A secret: never logged. Without it the provider counts as unconfigured. |
| `RISK_SCORE_MODEL` | unset | A versioned model id such as `jev-1.14.0`. An alias that moves when a release ships is refused in a live posture, and an answer from any other version is never used. A model without a list price leaves risk scores unconfigured. |
| `RISK_SCORE_TIMEOUT_MS` | `400` | The default answering deadline (50 to 10,000). Past it the risk score reads unavailable. |
| `RISK_SCORE_DAILY_BUDGET_USD`, `RISK_SCORE_ACCOUNT_MONTHLY_USD` | `25`, `25` | Model cost across the deployment per UTC day, and per account per month, at list prices. At either, calls stop before they are made. |
| `RISK_SCORE_DAILY_DECISIONS`, `RISK_SCORE_REQUESTS_PER_MINUTE` | `10000`, `60` with `jev_reseller`; no limit with `typesafe` | The key's limits. The day counts questions, not requests, and resets at 00:00 UTC; shadow, replay and eval runs stop at 80% of it. `0` means no limit. |
| `RISK_SCORE_MOCK_FIXTURES` | unset | With `mock` only: a JSON file of fixed answers by risk score key, each `{"probabilities": {...}}` by answer value or `{"fail": "timeout"}`, for demos and local runs. |
| `RISK_SCORE_MEMORY_ENCRYPTION_KEY` | unset | Seals the reasons a model writes for risk score answers (32 bytes, base64). Unset: a key derived from `JWT_SECRET` outside live; in live, reasons read unavailable until it is set. Answers are unaffected. |
| `RISK_SCORE_PERSONAL_CLEARED` | unset | `on` lets live risk scores bind raw personal fields (names, email addresses, free text) once the account accepted the data terms. Sandbox accepts them either way. |
| `ANALYSIS_DATABASE_URL` | unset | A read replica analysis queries read the account's records from (queries themselves run in a per-query sandbox, never on the database). Unset, the read runs on the primary with a 2-second timeout instead of 5. |
| `INVESTIGATION_MODEL` | `AI_ASSIST_RETRY_MODEL`, else `claude-sonnet-5-5` | The model [Investigations](https://provenanceauth.com/docs/account/investigations.md) answer with, through the assist endpoint above. Without a list price for it, Investigations answer 503 `investigation_unconfigured`. |
| `INVESTIGATION_MAX_TOKENS`, `INVESTIGATION_MAX_OUTPUT_TOKENS` | `60000`, `4000` | The input and output token budgets of one question, across its model calls. At either, the answer is what the queries found so far. |
| `INVESTIGATION_MARKUP_BPS` | `1000` | Answers are billed at the model's list price plus this many basis points (1000 is 10%). |
| `INVESTIGATION_CAP_FREE_USD`, `INVESTIGATION_CAP_TRIAL_USD` | `5`, `25` | The monthly spend cap on Free, and on a trial with a card on file. Paid plans have no cap. |
| `INVESTIGATION_THRESHOLDS_USD` | `50,100,250,500` | The month's spend at which a paid account is notified, once each a month. An account can set its own. |
| `INVESTIGATION_ENCRYPTION_KEY` | unset | Seals questions, answers and query results at rest (32 bytes, base64). Unset, a key derived from `JWT_SECRET` outside live; in live, Investigations answer 503 without it. `INVESTIGATION_ENCRYPTION_KEY_PREVIOUS` opens values sealed before a rotation. |

The model sees each answer under a neutral option name (`a`, `b`, …) defined by the account's words, and only the
fields a risk score binds. The question, the case and the answer are never logged.

## Billing

| Variable | Default | What it controls |
| --- | --- | --- |
| `STRIPE_MODE` | `test` | Which Stripe key set is active: `test` or `live`. Live mode needs a live API environment and a complete live set. |
| `STRIPE_TEST_SECRET_KEY`, `STRIPE_TEST_WEBHOOK_SECRET` | unset | The test-mode Stripe keys. The live set uses the `STRIPE_LIVE_` prefix. Unset answers `503 billing_not_configured` on billing routes. |
| `STRIPE_TEST_METER_ID_<EVENT>`, `STRIPE_TEST_PRICE_ID_<EVENT>` | unset | The meter and price for each metered event, printed by the Stripe bootstrap script. |

Create the Stripe product, meters and prices with the bootstrap script. It's safe to re-run, and prints the variable lines to set:

```bash norun
pnpm --filter @provenance/api stripe:bootstrap --mode test
pnpm --filter @provenance/api stripe:bootstrap --mode live --confirm-live
```

Register `/webhooks/stripe` as a webhook endpoint in both Stripe modes; events from the inactive mode are acknowledged and ignored. `GET /health/deep` reports which Stripe mode is active, or names the variable that's missing.

## Related

- [Trace worker](https://provenanceauth.com/docs/self-host/trace-worker.md)
- [Sidecar](https://provenanceauth.com/docs/self-host/sidecar.md)
- [Errors](https://provenanceauth.com/docs/platform/errors.md)
