Configuration reference β
Piwi is configured entirely through environment variables. It runs with zero configuration out of the box β SQLite and local file storage are created automatically under .data/. Set variables only to change a default.
Variables can go in apps/application/.env (see apps/application/.env.example) or be passed to the container/process. Where a value can also be set in the Settings UI, the environment variable always wins and the UI shows that field read-only.
Prefer a guided setup? The configuration generator builds a ready-to-paste .env, Docker, Kubernetes or systemd configuration from the same registry as this page β entirely in your browser.
Settings UI tooltips
In the dashboard, every overridable setting shows a help icon next to its label. Hover it to see which PIWI_* env var backs the field, a one-line description, and a link back to this page. Fields that are currently pinned by the environment show a lock badge with the variable name, and the Settings nav marks env-managed pages with a lock icon. This page is generated from the typed registry in apps/application/shared/piwi-env-vars.ts (version 0.77.0), the same source those tooltips use.
General β
| Variable | Default | Description |
|---|---|---|
PIWI_SITE_URL | β | Public base URL of the instance (e.g. https://piwi.example.com). Used to build links in emails, and the run links the reporter prints and writes to its output. When unset, links in emails point to http://localhost:3000 (on Fly.io, to https://<app>.fly.dev, from FLY_APP_NAME) and OAuth callback URLs are inferred from the request host β set it when running behind a reverse proxy. With authentication off, the dashboard answers only requests addressed to an IP address, localhost, a name under .localhost or the host of this URL: set it to the address you open the dashboard at when that is a name other than localhost, and list other names, a container's name included, in PIWI_ALLOWED_HOSTS (see Disabling authentication). A write from a page served over plain HTTP, whose browser sends no Sec-Fetch-Site, is then accepted only from the address the request names, the host and port of this URL or a name PIWI_ALLOWED_HOSTS lists. A reverse proxy in front must forward the Host header the browser sent (nginx proxy_set_header Host $http_host;, Apache ProxyPreserveHost On), since the host check reads that header alone. Named on Settings β Pull requests, Settings β Auto-heal. |
PIWI_ALLOWED_HOSTS | β | Comma-separated host names the dashboard also answers with authentication off, beside its local addresses (an IP address, localhost, a name under .localhost) and the host of PIWI_SITE_URL: a container name another container reaches it by (piwi), host.docker.internal for a reporter in a container, a Kubernetes service name, a LAN name. An entry starting with a dot (.example.lan) allows that domain and every name under it. Names are compared lowercased, without the port. With authentication off, a page at one of these names may also write when its browser sends no Sec-Fetch-Site (a page served over plain HTTP). The single entry * answers every host, which removes the protection against DNS rebinding: any web page on a domain that points at the server's address can then use the dashboard as an administrator. It never lets a page at another host write. Used only when PIWI_AUTH_ENABLED is false. Added in 0.65.0. See details. |
PIWI_SECRET_KEY | β | Master key for AES-256-GCM encryption of secrets stored in the database (AI API keys, credentials, webhook and integration secrets). Required before the dashboard can save any of them. Unset, or set to the built-in development key, the dashboard cannot save a secret: the save answers HTTP 409 with a message naming this variable. Generate one with node -e "console.log(require('node:crypto').randomBytes(32).toString('hex'))". Secret: never logged or returned by the API. |
PIWI_METRICS_ENABLED | false | Set to "true" to serve GET /api/metrics: the metric catalog's current values per project in the OpenMetrics text format, for a Prometheus or a Grafana you run to pull (Piwi sends nothing anywhere). Off by default. With authentication on, the scraper sends an API key, and sees the projects of its user. Added in 0.39.0. See details. |
Localization β
Controls how dates and times are formatted (day/month order, 12h vs 24h) and which time zone they display in. When set, these lock the instance-default fields in Settings β Localization; each viewer can still pick their own format there, overriding the instance default in their own browser.
| Variable | Default | Description |
|---|---|---|
PIWI_LOCALE | β | Instance-default BCP-47 locale for formatting dates and times (e.g. "fr-FR" β 22/09/2026 14:30). The keyword "auto" follows each viewer's browser. Unset keeps the built-in en-US format. When set, the instance-default locale is locked in Settings β Localization (read-only), but each viewer can still override the format for their own browser. Any valid BCP-47 tag works, not only the ones the settings dropdown lists. Named on Settings β Localization. Added in 0.36.0. See details. |
PIWI_TIME_ZONE | β | Instance-default IANA time zone dates and times are shown in (e.g. "Europe/Paris"). The keyword "auto" (the default) uses each viewer's own browser time zone. When set, the instance-default time zone is locked in Settings β Localization (read-only), but each viewer can still override it for their own browser. Named on Settings β Localization. Added in 0.36.0. See details. |
Values are a BCP-47 locale (e.g. fr-FR) or an IANA time zone (e.g. Europe/Paris); the keyword auto follows the viewer's browser. See Localization.
Database β
Piwi uses SQLite by default. Setting PIWI_DATABASE_URL switches it to PostgreSQL; migrations run automatically on startup.
| Variable | Default | Description |
|---|---|---|
PIWI_DATABASE_PATH | .data/piwi.db | Path to the SQLite database file (used when PIWI_DATABASE_URL is not set). Used only when PIWI_DATABASE_URL is unset. |
PIWI_DATABASE_URL | β | PostgreSQL connection string. When set, PostgreSQL is used instead of SQLite and migrations run automatically on startup. Secret: never logged or returned by the API. See details. |
PIWI_DATABASE_POOL_MAX | 10 | Most connections the server opens to PostgreSQL at once. A max in PIWI_DATABASE_URL, then postgres.jsβs PGMAX, set it too; this variable wins over both. Range: 1 to 1000. Used only when PIWI_DATABASE_URL is set. Added in 0.72.0. See details. |
PIWI_RETENTION_DAYS | β | Days of test-run history the nightly retention sweep keeps. Unset or 0 disables automatic run pruning (the default β pruning is opt-in). Kept runs are never pruned. Minimum: 0. Named on Settings β Storage. See details. |
PIWI_RETENTION_MIN_RUNS | 0 | Newest runs of each project that age-based pruning (the nightly sweep and the manual cleanup) always leaves in place, however old β so a project that stops reporting keeps its last runs. Unset or 0 sets no floor. Minimum: 0. Named on Settings β Storage. Added in 0.38.0. See details. |
PIWI_RETENTION_NOTIFICATION_DAYS | 30 | Days to keep sent/failed notification outbox rows before the nightly sweep prunes them (default 30; 0 keeps them forever). Settled auto-heal and integration actions, the agents' write log and run requests that ended or expired follow the same horizon. Minimum: 0. |
PIWI_RETENTION_REPORT_DAYS | 365 | Days to keep report snapshots (the stored quality reports on the Quality reports page) before the nightly sweep prunes them (default 365; 0 keeps them forever). Minimum: 0. Added in 0.39.0. See details. |
PIWI_ASSISTANT_RETENTION_DAYS | 90 | Days an assistant conversation is kept after its last message before the nightly sweep deletes it (default 90; 0 keeps them forever). The assistant usage counted in Settings β AI follows the same horizon. Minimum: 0. Added in 0.59.0. See details. |
PIWI_RETENTION_CREDENTIAL_LOG_DAYS | 365 | Days the log of every credential use (Settings β Credentials) is kept before the nightly sweep deletes it (default 365; 0 keeps it forever). Minimum: 0. Named on Settings β Credentials. Added in 0.72.0. See details. |
PIWI_RETENTION_DIAGNOSIS_VERSIONS | 20 | AI-diagnosis history versions kept per diagnosis by the nightly sweep (default 20; 0 disables capping). Minimum: 0. |
See Database for SQLite versus PostgreSQL and Storage β Data retention for how the nightly sweep works.
Storage β
Controls where test artifacts (HTML reports, traces, attachments) are stored.
| Variable | Default | Description |
|---|---|---|
PIWI_STORAGE_TYPE | local | Storage backend for test artifacts (HTML reports, traces, attachments): "local" or "s3". Only the exact value s3 selects S3; any other value falls back to local storage. Values: local, s3. |
PIWI_STORAGE_PATH | .data/storage | Directory for local file storage (when PIWI_STORAGE_TYPE is "local"). Used only when PIWI_STORAGE_TYPE is local. |
PIWI_S3_BUCKET | β | S3 bucket name for artifact storage (when PIWI_STORAGE_TYPE is "s3"). Required when PIWI_STORAGE_TYPE is s3. See details. |
PIWI_S3_REGION | β | S3 bucket region (when PIWI_STORAGE_TYPE is "s3"). Required when PIWI_STORAGE_TYPE is s3. |
PIWI_S3_ACCESS_KEY_ID | β | Optional static S3 access key id. When omitted, the AWS SDK default credential chain is used. Used only when PIWI_STORAGE_TYPE is s3. Secret: never logged or returned by the API. |
PIWI_S3_SECRET_ACCESS_KEY | β | Optional static S3 secret access key. Set it together with PIWI_S3_ACCESS_KEY_ID. Used only when PIWI_STORAGE_TYPE is s3. Secret: never logged or returned by the API. |
PIWI_S3_ENDPOINT | β | Custom endpoint for S3-compatible services (MinIO, R2, Spaces). Used only when PIWI_STORAGE_TYPE is s3. |
PIWI_S3_FORCE_PATH_STYLE | β | Use path-style addressing (required by some S3-compatible services). Defaults to on when a custom endpoint is set, off otherwise; only the exact value false turns it off explicitly. Used only when PIWI_STORAGE_TYPE is s3. |
Full details and IAM examples: Storage & retention.
Authentication β
Authentication is optional and off by default. When disabled, all endpoints behave as a single virtual administrator.
| Variable | Default | Description |
|---|---|---|
PIWI_AUTH_ENABLED | false | Set to "true" to enable role-based access control and API keys. Off by default. |
PIWI_AUTH_SECRET | β | Secret used to sign/encrypt session cookies, at least 32 characters. Required when PIWI_AUTH_ENABLED is true. The server refuses to start when auth is enabled and this is unset or shorter than 32 characters. Secret: never logged or returned by the API. |
PIWI_SETUP_TOKEN | β | A token the first-admin form asks for (setupToken in POST /api/auth/setup), so only whoever can read the server's settings creates the first administrator. The one-click deploy templates generate it. Unset, the first visitor to an instance with no administrator can create one. Used only when PIWI_AUTH_ENABLED is true. Secret: never logged or returned by the API. Added in 0.55.1. |
PIWI_SHARE_LINKS_ENABLED | false | Set to "true" to allow minting read-only public share links for executions, failure clusters, report snapshots and saved dashboards. Off by default; turning it off again immediately dead-ends every outstanding link without deleting anything. Added in 0.26.0. |
PIWI_SHARE_LINK_MAX_TTL_DAYS | 30 | Longest allowed share-link lifetime, in days. The creation dialog offers expiries up to this; 0 lifts the cap and allows links with no expiry, which work until they are revoked or their creator loses access to what they open. Range: 0 to 3650. Used only when PIWI_SHARE_LINKS_ENABLED is true. Added in 0.26.0. |
PIWI_MCP_CLIENT_METADATA_DOCUMENTS | false | Set to "true" to accept MCP clients that sign in with a client ID metadata document: an HTTPS URL as their client_id, naming the JSON document that describes them, which the server then fetches from a public address when the client asks for authorization, and advertises in the authorization server metadata. Off by default: the instance then makes no such request, and clients register on their own (dynamic client registration), which stays on either way. Turn it on only for an instance that can reach the internet: a client that sees it advertised signs in through it alone. Used only when PIWI_AUTH_ENABLED is true. Added in 0.75.0. See details. |
PIWI_TRUST_PROXY | false | Set to "true" when a reverse proxy sits in front of Piwi, so per-IP rate limits on the auth endpoints key on the client address your proxy appends to X-Forwarded-For instead of on the proxy's own address (which would pool every client into one bucket). Leave off when clients connect directly: the header is client-controlled then, and trusting it would let a caller choose its own bucket. While it is unset, the server logs a warning the first time a request carries X-Forwarded-For. Added in 0.26.0. |
PIWI_OAUTH_GOOGLE_CLIENT_ID | β | Google OAuth client id (optional single sign-on). Required when PIWI_OAUTH_GOOGLE_CLIENT_SECRET is set. Used only when PIWI_AUTH_ENABLED is true. Named on Settings β Account. See details. |
PIWI_OAUTH_GOOGLE_CLIENT_SECRET | β | Google OAuth client secret. Required when PIWI_OAUTH_GOOGLE_CLIENT_ID is set. Used only when PIWI_AUTH_ENABLED is true. Secret: never logged or returned by the API. Named on Settings β Account. |
PIWI_OAUTH_GITHUB_CLIENT_ID | β | GitHub OAuth client id (optional single sign-on). Required when PIWI_OAUTH_GITHUB_CLIENT_SECRET is set. Used only when PIWI_AUTH_ENABLED is true. Named on Settings β Account. See details. |
PIWI_OAUTH_GITHUB_CLIENT_SECRET | β | GitHub OAuth client secret. Required when PIWI_OAUTH_GITHUB_CLIENT_ID is set. Used only when PIWI_AUTH_ENABLED is true. Secret: never logged or returned by the API. Named on Settings β Account. |
PIWI_OAUTH_ALLOWED_DOMAINS | β | Comma-separated verified email domains allowed to sign in via OAuth (all providers). Only verified emails in these domains are accepted. Empty means no domain restriction. Used only when PIWI_AUTH_ENABLED is true. Named on Settings β Account. |
PIWI_OAUTH_GITHUB_ALLOWED_ORGS | β | Comma-separated GitHub org logins a user must belong to (requests read:org scope). Used only when PIWI_OAUTH_GITHUB_CLIENT_ID is set. Named on Settings β Account. |
Behind a reverse proxy, set
PIWI_SITE_URLso the OAuthredirect_uriis built from your public URL and matches what you registered with the provider (instead of being inferred from the requestHost).
See Authentication for instance roles, API keys for keys, and Access, roles and groups for project roles and groups.
Wasted time β
Controls which Playwright wait steps are counted as "wasted time" on the run timeline and in per-test/run totals. Classification happens when a run is viewed, so changing it re-classifies historical runs immediately.
| Variable | Default | Description |
|---|---|---|
PIWI_WASTED_WAIT_PATTERNS | Wait for timeout*,*waitForTimeout* | Glob patterns (comma or newline separated) defining which wait steps count as wasted time. Locks the UI when set. Case-insensitive globs (* and ?) matched against a wait stepβs title or source location. Use * to count every wait. Named on Settings β Performance. |
PIWI_CI_MINUTE_COST | β | Cost of one CI minute as an amount and an ISO 4217 currency code (e.g. "0.008 USD"). When set, every wasted-time number in the analytics widgets and quality reports is followed by its cost, and the setting in Settings β Performance is read-only. Unset shows minutes only. Named on Settings β Performance. Added in 0.39.0. See details. |
When unset, configure the patterns from Settings β Performance (administrator only). The default counts only explicit waitForTimeout sleeps, since framework-injected waits (load-state, wait-for-function) are usually unavoidable.
AI diagnosis β
PIWI_AI_PROVIDER is the master switch: when it is set, AI configuration is environment-managed (the Settings UI shows the fields read-only) and the other PIWI_AI_* variables apply. When it is unset, AI diagnosis is configured from Settings β AI instead and the variables below are ignored.
| Variable | Default | Description |
|---|---|---|
PIWI_AI_PROVIDER | β | AI provider for failure diagnosis: "anthropic", "openai" (OpenAI-compatible), "codex-cli" (the local Codex CLI), "deepseek-cli" (official DeepSeek Harness), or "claude-cli" (the local Claude Code CLI β offered in the desktop app, or wherever PIWI_CLAUDE_CLI_PATH points at it). Values: anthropic, openai, claude-cli, codex-cli, deepseek-cli. Named on Settings β AI. |
PIWI_AI_API_KEY | β | API key for the diagnosis provider, used while PIWI_AI_PROVIDER is set. It shows as a read-only credential (Settings β Credentials) that reads it from here at each use. Optional for OpenAI-compatible providers that need no key (e.g. a local model). Unused by "claude-cli", "codex-cli", and "deepseek-cli" β the CLI carries its own login. Required when PIWI_AI_PROVIDER is anthropic. Used only when PIWI_AI_PROVIDER is set. Secret: never logged or returned by the API. Named on Settings β AI. |
PIWI_AI_MODEL | β | Diagnosis model name (default: claude-opus-4-8 for Anthropic; for "claude-cli" an alias like "opus"/"sonnet", or empty for the CLI default). Required when PIWI_AI_PROVIDER is openai. Used only when PIWI_AI_PROVIDER is set. Named on Settings β AI. |
PIWI_AI_BASE_URL | β | Base URL of the provider API. Required for "openai" β OpenAI itself (https://api.openai.com/v1) as well as compatible servers (e.g. http://localhost:11434/v1); optional for "anthropic" (a gateway or proxy). Required when PIWI_AI_PROVIDER is openai. Used only when PIWI_AI_PROVIDER is set. Named on Settings β AI. |
PIWI_AI_TEMPERATURE | β | Sampling temperature override for the diagnosis model (OpenAI-compatible only), range 0-2. Omitted from requests when unset (provider default applies). Reasoning models (o1, o3, GPT-5-class) reject any explicit value β leave this unset for them. Range: 0 to 2. Used only when PIWI_AI_PROVIDER is openai. Named on Settings β AI. Added in 0.27.0. |
PIWI_AI_AUTO_DIAGNOSE | false | Set to "true" to diagnose, when a run finishes, the failure clusters that failed in it and have no completed diagnosis yet (up to PIWI_AI_AUTO_DIAGNOSE_MAX). Used only when PIWI_AI_PROVIDER is set. Named on Settings β AI. |
PIWI_AI_LANGUAGE | β | Language for AI-written prose (diagnosis, root cause, cluster titles), e.g. "French". Unset keeps English. Code, locators, paths and error text stay verbatim. Added in 0.29.0. See details. |
PIWI_AI_AUTO_DIAGNOSE_MAX | 3 | Max clusters auto-diagnosed per finished run (budget cap; default 3). Minimum: 1. Used only when PIWI_AI_AUTO_DIAGNOSE is true. Named on Settings β AI. |
PIWI_AI_RESEARCH_PROVIDER | β | Provider for the optional research (pre-analysis) stage. Falls back to PIWI_AI_PROVIDER. Values: anthropic, openai, claude-cli, codex-cli, deepseek-cli. Used only when PIWI_AI_RESEARCH_MODEL is set. Named on Settings β AI. |
PIWI_AI_RESEARCH_MODEL | β | Cheaper/faster model for the research stage. Empty disables the two-stage pipeline. Used only when PIWI_AI_PROVIDER is set. Named on Settings β AI. |
PIWI_AI_RESEARCH_BASE_URL | β | Base URL for the research-stage provider. Falls back to PIWI_AI_BASE_URL. Used only when PIWI_AI_RESEARCH_MODEL is set. Named on Settings β AI. |
PIWI_AI_RESEARCH_API_KEY | β | API key for the research-stage provider. Falls back to PIWI_AI_API_KEY. It shows as a read-only credential that reads it from here. Used only when PIWI_AI_RESEARCH_MODEL is set. Secret: never logged or returned by the API. Named on Settings β AI. |
PIWI_AI_RESEARCH_TEMPERATURE | β | Sampling temperature override for the research model (OpenAI-compatible only), range 0-2. Omitted from requests when unset (provider default applies). Reasoning models (o1, o3, GPT-5-class) reject any explicit value β leave this unset for them. Range: 0 to 2. Used only when PIWI_AI_RESEARCH_MODEL is set. Named on Settings β AI. Added in 0.27.0. |
PIWI_AI_EMBEDDING_PROVIDER | β | Provider for embeddings (semantic failure clustering). Falls back to PIWI_AI_PROVIDER. Must resolve to an OpenAI-compatible provider β Anthropic has no embeddings API β so the fallback only helps when the main provider is "openai". Values: openai. Used only when PIWI_AI_EMBEDDING_MODEL is set. Named on Settings β AI. |
PIWI_AI_EMBEDDING_MODEL | β | Embedding model name (e.g. text-embedding-3-small). Empty disables semantic clustering (and the embedding fallbacks). Used only when PIWI_AI_PROVIDER is set. Named on Settings β AI. |
PIWI_AI_EMBEDDING_BASE_URL | β | Base URL for the embedding provider. Falls back to PIWI_AI_BASE_URL. Used only when PIWI_AI_EMBEDDING_MODEL is set. Named on Settings β AI. |
PIWI_AI_EMBEDDING_API_KEY | β | API key for the embedding provider. Falls back to PIWI_AI_API_KEY. It shows as a read-only credential that reads it from here. Used only when PIWI_AI_EMBEDDING_MODEL is set. Secret: never logged or returned by the API. Named on Settings β AI. |
PIWI_AI_ASSISTANT_PROVIDER | β | Provider for the assistant. Falls back to PIWI_AI_PROVIDER. Values: anthropic, openai, claude-cli, codex-cli, deepseek-cli. Used only when PIWI_AI_ASSISTANT_MODEL is set. Named on Settings β AI. Added in 0.59.0. |
PIWI_AI_ASSISTANT_MODEL | β | Model the in-app assistant answers with. Empty uses the diagnosis model. Used only when PIWI_AI_PROVIDER is set. Named on Settings β AI. Added in 0.59.0. See details. |
PIWI_AI_ASSISTANT_BASE_URL | β | Base URL for the assistant provider. Falls back to PIWI_AI_BASE_URL. Used only when PIWI_AI_ASSISTANT_MODEL is set. Named on Settings β AI. Added in 0.59.0. |
PIWI_AI_ASSISTANT_API_KEY | β | API key for the assistant provider. Falls back to PIWI_AI_API_KEY. It shows as a read-only credential that reads it from here. Used only when PIWI_AI_ASSISTANT_MODEL is set. Secret: never logged or returned by the API. Named on Settings β AI. Added in 0.59.0. |
PIWI_AI_ASSISTANT_TEMPERATURE | β | Sampling temperature override for the assistant model (OpenAI-compatible only), range 0-2. Omitted from requests when unset (provider default applies). Reasoning models (o1, o3, GPT-5-class) reject any explicit value β leave this unset for them. Range: 0 to 2. Used only when PIWI_AI_ASSISTANT_MODEL is set. Named on Settings β AI. Added in 0.59.0. |
PIWI_DEEPSEEK_CLI_PATH | β | Absolute path to the official DeepSeek Harness dsh launcher. Enables deepseek-cli outside the desktop app. Uses only DeepSeek credentials. Added in 0.61.0. See details. |
PIWI_CODEX_CLI_PATH | `` | Absolute path to the local Codex CLI. Enables codex-cli outside the desktop app. Uses the local file-backed ChatGPT login without an API key. Added in 0.61.0. See details. |
PIWI_CLAUDE_CLI_PATH | β | Absolute path to the claude binary for the "claude-cli" provider. Set only when the CLI is not on PATH, or to enable the provider outside the desktop app, where Claude Code must sign in with an Anthropic API key or a cloud provider: a Claude subscription runs only in the desktop app. Auto-detected otherwise. Added in 0.30.0. |
See AI diagnosis for how diagnosis, the research stage, and semantic clustering work.
AI context limits β
Cap how much evidence (and how many tokens) go into each AI diagnosis. Resolution order: defaults β values stored from Settings β AI β environment; the environment wins and locks the field in the UI. Values are clamped to the minβmax range; a 0 disables a section only where the minimum is 0.
| Variable | Default | Description |
|---|---|---|
PIWI_AI_MAX_SAMPLE_ERROR_CHARS | 10000 | Max characters of raw error text (per error block). Range: 200 to 50000. Named on Settings β AI. |
PIWI_AI_MAX_SCM_PATCH_BUDGET | 15000 | Total characters of diff patches across changed files. Range: 0 to 50000. Named on Settings β AI. |
PIWI_AI_MAX_AFFECTED_TESTS | 30 | Max affected tests listed in the diagnosis context. Range: 1 to 200. Named on Settings β AI. |
PIWI_AI_MAX_STEPS | 50 | Max recent test steps included. Range: 1 to 200. Named on Settings β AI. |
PIWI_AI_MAX_CONSOLE_ENTRIES | 30 | Max console error/warning entries included. Range: 0 to 200. Named on Settings β AI. |
PIWI_AI_MAX_CONSOLE_ENTRY_CHARS | 1000 | Max characters per console entry. Range: 50 to 5000. Named on Settings β AI. |
PIWI_AI_MAX_NETWORK_REQUESTS | 25 | Max failed network requests included. Range: 0 to 200. Named on Settings β AI. |
PIWI_AI_MAX_ARIA_SNAPSHOT_CHARS | 12000 | Max characters of the page ARIA snapshot. Range: 0 to 50000. Named on Settings β AI. |
PIWI_AI_MAX_TEST_SOURCE_CHARS | 8000 | Max characters of the test source snippet. Range: 0 to 50000. Named on Settings β AI. |
PIWI_AI_MAX_SOURCE_FILES | 4 | Max full source files fetched from SCM to ground patches (0 disables). Range: 0 to 20. |
PIWI_AI_MAX_SOURCE_FILE_CHARS | 12000 | Max characters per fetched full source file. Range: 0 to 50000. |
PIWI_AI_MAX_SERVER_LOG_ENTRIES | 50 | Max backend server log entries (from X-Piwi-Logs header) included. Range: 0 to 200. Named on Settings β AI. |
PIWI_AI_MAX_SERVER_LOG_ENTRY_CHARS | 1000 | Max characters per backend server log entry. Range: 50 to 5000. Named on Settings β AI. |
PIWI_AI_MAX_SERVER_TRACE_SPANS | 40 | Max backend server spans (from X-Piwi-Trace header) included in AI diagnosis (0 disables). Range: 0 to 500. Added in 0.16.0. |
PIWI_AI_MAX_STEP_INTENTS | 20 | Max AI-step intent mappings (natural-language prompt β compiled locator) included in a diagnosis (0 disables the section). Range: 0 to 100. Added in 0.24.0. |
PIWI_AI_MAX_IMAGES | 5 | Max screenshots auto-included in the diagnosis context. Range: 0 to 20. Named on Settings β AI. |
PIWI_AI_MAX_PASSED_PEERS | 20 | Max peer tests in the same file listed when they passed. Range: 0 to 100. Named on Settings β AI. |
PIWI_AI_MAX_CONSOLE_WINDOW | 50 | Max console entries of any type in the window before failure. Range: 0 to 200. Named on Settings β AI. |
PIWI_AI_SLOW_REQUEST_MS | 1500 | Network request duration (ms) threshold for flagging as slow. Range: 100 to 30000. Named on Settings β AI. |
PIWI_AI_MAX_TRACE_ACTIONS | 10 | Max actions extracted from trace ZIP for failing-action context (0 disables). Range: 0 to 50. |
PIWI_AI_TRACE_DOM_CHARS | 6000 | Max characters for the trace-derived DOM/ARIA excerpt in failing-action context. Range: 0 to 20000. |
PIWI_AI_MAX_TRACE_STACK_FRAMES | 10 | Max call-stack frames (with source windows) from the trace call-stack section (0 disables). Range: 0 to 50. Named on Settings β AI. |
PIWI_AI_MAX_TRACE_NETWORK_REQUESTS | 20 | Max requests included from the trace network stream (0 disables). Range: 0 to 200. Named on Settings β AI. |
PIWI_AI_MAX_DOM_SNAPSHOT_CHARS | 8000 | Max characters of the failure-time DOM snapshot rendered from the trace (0 disables). Range: 0 to 50000. |
PIWI_AI_IMAGE_MAX_EDGE | 1920 | Screenshots are downscaled to at most this many pixels on the long edge before being sent. Range: 512 to 8192. |
See AI provider β Context limits for how the caps work.
AI steps β
Bounds on the reporter's AI-step authoring pass (page.piwiLocator(...) / page.piwiRun(...) in resolve/heal mode), which calls the model through this server. They cap how much of the page snapshot and how many output tokens go into each authoring iteration. They never apply during normal replay runs, which make no model calls. Values are clamped to the minβmax range.
| Variable | Default | Description |
|---|---|---|
PIWI_AI_STEP_MAX_SNAPSHOT_CHARS | 24000 | Max characters of the page ARIA snapshot the reporter sends per AI-step authoring iteration. Range: 0 to 100000. Added in 0.24.0. |
PIWI_AI_STEP_MAX_OUTPUT_TOKENS | 1024 | Max output tokens the model may return per AI-step authoring iteration. Reasoning models count hidden chain-of-thought against this, so raise it (up to 8192) when authoring with one. Range: 256 to 8192. Added in 0.24.0. |
Reasoning models spend output tokens on hidden chain-of-thought, so raise PIWI_AI_STEP_MAX_OUTPUT_TOKENS for them. See AI steps for the full authoring/replay model and the reporter-side PIWI_AI* options.
Assistant β
Bounds on the in-app assistant: how many tools it may call and how long it may take for one question, how many tokens one model call may write, and how many tokens it may spend in 24 hours, per user and for the instance. A cap reached stops the turn before the next model call. Values are clamped to the minβmax range; 0 turns a daily cap off. The assistant's model is the PIWI_AI_ASSISTANT_* role above.
| Variable | Default | Description |
|---|---|---|
PIWI_AI_ASSISTANT_MAX_TOOL_CALLS | 8 | Max tool calls the assistant makes to answer one question. Range: 1 to 30. Added in 0.59.0. |
PIWI_AI_ASSISTANT_MAX_OUTPUT_TOKENS | 2048 | Max output tokens of one assistant model call. Reasoning models count hidden chain-of-thought against this. Range: 256 to 16384. Added in 0.59.0. |
PIWI_AI_ASSISTANT_TURN_TIMEOUT_SECONDS | 180 | Seconds the assistant may spend answering one question, model calls and tool calls together. Range: 15 to 900. Added in 0.59.0. |
PIWI_AI_ASSISTANT_DAILY_TOKENS_PER_USER | 1000000 | Tokens (input and output) one user may spend on the assistant in 24 hours. 0 sets no cap. Range: 0 to 1000000000. Added in 0.59.0. |
PIWI_AI_ASSISTANT_DAILY_TOKENS | 5000000 | Tokens (input and output) the whole instance may spend on the assistant in 24 hours. 0 sets no cap. Range: 0 to 1000000000. Added in 0.59.0. |
See Assistant for what it reads and what leaves the instance.
Ingest limits β
Caps applied to per-execution payloads (console output, steps, ARIA snapshots, error text, source snippets) before they are stored. They bound database growth against verbose or hostile submitters; values above each limit are truncated with a visible marker. Distinct from the PIWI_AI_MAX_* limits, which bound what enters an AI diagnosis prompt β the storage defaults sit at or above the AI defaults, so at their defaults the AI limits stay the binding constraint for prompts. Environment-only (no settings UI).
| Variable | Default | Description |
|---|---|---|
PIWI_INGEST_MAX_CONSOLE_ENTRIES | 200 | Max console entries stored per test execution. Range: 10 to 5000. |
PIWI_IMPORT_MAX_BYTES | 524288000 | Max size of a single multipart upload, in bytes: one report or the files of one test, which the reporter sends in a request of their own, or an imported blob report or trace. Lower it to match a reverse proxy that rejects large bodies, so the import page rejects an oversized archive before uploading it. An import reads its archive whole, so it takes archives under 2 GiB whatever this allows. Range: 1048576 to 5368709120. Added in 0.19.0. |
PIWI_SUBMIT_MAX_BYTES | 268435456 | Max size of a run's results sent as one JSON document, in bytes: the reporter's batch submit and the results it sends ahead of a run's files. A larger body is refused (413) before it is read. The server reads and parses the document in memory, so this bounds what one delivery costs it. Range: 1048576 to 536870912. Added in 0.65.0. |
PIWI_INGEST_MAX_CONSOLE_ENTRY_CHARS | 2000 | Max characters stored per console entry. Range: 200 to 20000. |
PIWI_INGEST_MAX_STEPS | 500 | Max test steps stored per execution. Past it, the steps that failed are kept first, and one marker step counts the steps dropped. Range: 20 to 5000. |
PIWI_INGEST_MAX_STEP_PARAM_KEYS | 20 | Max param keys stored per step. Range: 1 to 100. Added in 0.27.0. |
PIWI_INGEST_MAX_STEP_PARAM_VALUE_CHARS | 200 | Max characters stored per step param value. Range: 20 to 2000. Added in 0.27.0. |
PIWI_INGEST_MAX_STEP_EVENTS | 1000 | Max step events stored per execution. Range: 20 to 10000. |
PIWI_INGEST_MAX_LOCKS | 20 | Max lock names stored per execution. Range: 1 to 100. Added in 0.27.0. |
PIWI_INGEST_MAX_DIALOGS | 50 | Max browser dialogs stored per execution. Range: 1 to 500. Added in 0.27.0. |
PIWI_INGEST_MAX_ARIA_CHARS | 100000 | Max characters of the ARIA snapshot stored per failing execution. Range: 1000 to 1000000. |
PIWI_INGEST_MAX_ERROR_CHARS | 20000 | Max characters of error text stored per execution (head and tail are kept). Range: 1000 to 100000. |
PIWI_INGEST_MAX_SAMPLE_ERROR_CHARS | 50000 | Max characters of the sample error stored per failure cluster. Range: 1000 to 200000. |
PIWI_INGEST_MAX_TEST_SOURCE_CHARS | 50000 | Max characters of the test source snippet stored per failing execution. Range: 1000 to 200000. |
PIWI_INGEST_MAX_SOURCE_FRAMES | 8 | Max source stack frames stored per failing execution. Range: 1 to 32. |
PIWI_INGEST_MAX_SOURCE_FRAME_CHARS | 4000 | Max characters per stored source frame snippet. Range: 500 to 20000. |
Offline export β
Bounds on the offline export of a test execution or a failure cluster (HTML, ZIP, PDF). Evidence that does not fit is listed in the report as omitted rather than dropped silently. The total cap is also the memory an export costs to build, since the archive is assembled before it is sent.
| Variable | Default | Description |
|---|---|---|
PIWI_EXPORT_MAX_INLINE_BYTES | 8388608 | Max size of a single evidence file embedded as a data: URI in an HTML export, in bytes. Larger files are left out of the single-file HTML (and listed as omitted); the ZIP export still carries them at full size. Range: 65536 to 536870912. Added in 0.19.0. |
PIWI_EXPORT_MAX_BYTES | 524288000 | Max total size of one export, in bytes. Evidence is added in order (each execution's attachments, then its traces); a file that would pass the budget is left out and listed as omitted. The archive is built in memory, so this also bounds what a single export costs the server. Range: 1048576 to 4294967296. Added in 0.19.0. |
PIWI_EXPORT_MAX_CASES | 25 | Max executions carrying full evidence in a failure-cluster export (its affected tests) or a run export (its failing tests). The rest are listed by name without their evidence. Range: 1 to 200. Added in 0.19.0. |
Timeline markers β
| Variable | Default | Description |
|---|---|---|
PIWI_AUTO_MARKERS | true | Automatically create a timeline marker when a runβs Playwright or reporter version differs from the previous run in the same environment, when its runner, browser or a server under test differs from the previous run on the same branch and environment, and when a run is flagged as an environment incident (default: enabled). Set to false to disable. Only the exact value false disables auto-markers. See details. |
Email (SMTP) β
Required for email notifications and account flows (verification, password reset, invites). Set via environment only.
| Variable | Default | Description |
|---|---|---|
PIWI_SMTP_HOST | β | SMTP server hostname for outbound email. |
PIWI_SMTP_PORT | 587 | SMTP port (default 587; 465 for implicit TLS). Range: 1 to 65535. Used only when PIWI_SMTP_HOST is set. |
PIWI_SMTP_USER | β | SMTP username. Optional β only when the server requires authentication. Used only when PIWI_SMTP_HOST is set. |
PIWI_SMTP_PASS | β | SMTP password. Optional β only when the server requires authentication. Never returned by the API. Used only when PIWI_SMTP_HOST is set. Secret: never logged or returned by the API. |
PIWI_SMTP_FROM | β | From address for outbound email (e.g. [email protected]). Required when PIWI_SMTP_HOST is set. |
PIWI_SMTP_FROM_NAME | Piwi Dashboard | Display name for the from address (optional). Used only when PIWI_SMTP_HOST is set. |
PIWI_SMTP_SECURE | β | Set to "true" for implicit TLS (port 465), "false" for STARTTLS or plain SMTP. Unset, it is on when PIWI_SMTP_PORT is 465 and off otherwise. Used only when PIWI_SMTP_HOST is set. |
Email sending activates once PIWI_SMTP_HOST and PIWI_SMTP_FROM are set; add PIWI_SMTP_USER/PIWI_SMTP_PASS when the server requires authentication. See Notifications for channels and subscriptions.
Integrations β
Connect an issue tracker so pinned links unfurl and stay in sync. Setting PIWI_JIRA_BASE_URL, PIWI_JIRA_EMAIL and PIWI_JIRA_API_TOKEN creates a read-only, environment-managed Jira Cloud connection, and PIWI_ZEPHYR_API_TOKEN one for Zephyr Scale Cloud; otherwise connections are managed from Settings β Integrations.
| Variable | Default | Description |
|---|---|---|
PIWI_SCM_GITLAB_HOSTS | β | Self-hosted GitLab host names (comma-separated, e.g. gitlab.example.com) Piwi may send an SCM credential to. The GitLab cloud needs no entry; a self-hosted GitLab not listed here is not read. Added in 0.43.0. See details. |
PIWI_CI_SERVER_URL | β | Base URL of the instance's CI server (e.g. https://jenkins.example.com/), where a project's CI re-run goes when it dispatches through a CI server and sets no base URL of its own. The instance token is sent only to URLs under it, so a path confines it (https://jenkins.example.com/job/qa/ sends it only to the jobs of the qa folder). It goes only with a preset's request, never a Custom one. Added in 0.67.0. See details. |
PIWI_CI_SERVER_USER | β | User name the instance CI server token belongs to, paired with it as an HTTP Basic credential (Jenkins). Used only when PIWI_CI_SERVER_URL is set. Added in 0.67.0. |
PIWI_CI_SERVER_TOKEN | β | API token of the instance's CI server, sent only to URLs under PIWI_CI_SERVER_URL, by a CI server action that names no credential. It is listed in Settings β Credentials as a read-only credential, and its uses are logged there. Give it to a CI user allowed to build only the jobs Piwi should start. Never returned by the API. Used only when PIWI_CI_SERVER_URL is set. Secret: never logged or returned by the API. Named on Settings β Credentials. Added in 0.67.0. |
PIWI_CI_SERVER_HOSTS | β | CI server hosts (comma-separated, e.g. jenkins.internal:8080) a CI re-run may reach on a private address, besides the host and port of PIWI_CI_SERVER_URL. A name without a port allows every port of that host. Any other host must resolve to public addresses only. A listed host may also be reached over http. Added in 0.67.0. See details. |
PIWI_CI_SERVER_ALLOWED_INPUTS | β | Input names (comma-separated, e.g. TARGET_ENV,SUITE) a CI action may send to a request that carries the instance CI server token. A request under PIWI_CI_SERVER_URL with that token sends the Playwright arguments and the dispatch id and no other input, so a project admin cannot set other parameters on jobs the token can build; names listed here are sent. A credential saved in Settings β Credentials has its own list. Names are case-sensitive; empty by default. Used only when PIWI_CI_SERVER_URL is set. Added in 0.70.0. See details. |
PIWI_JIRA_BASE_URL | β | Base URL of the Jira Cloud site to connect (e.g. https://your-team.atlassian.net). Named on Settings β Integrations. Added in 0.29.0. See details. |
PIWI_JIRA_EMAIL | β | Atlassian account email the API token belongs to. Required when PIWI_JIRA_BASE_URL is set. Named on Settings β Integrations. Added in 0.29.0. |
PIWI_JIRA_API_TOKEN | β | Jira Cloud API token (from id.atlassian.com). With the other PIWI_JIRA_* variables it creates a read-only Jira connection, whose read-only credential (Settings β Credentials) reads the token from here. Never returned by the API. Required when PIWI_JIRA_BASE_URL is set. Secret: never logged or returned by the API. Named on Settings β Integrations. Added in 0.29.0. |
PIWI_ZEPHYR_API_TOKEN | β | Zephyr Scale Cloud API access token (Jira: profile picture β Zephyr API keys). Setting it creates a read-only, environment-managed Zephyr Scale connection, whose read-only credential (Settings β Credentials) reads the token from here. Never returned by the API. Secret: never logged or returned by the API. Named on Settings β Integrations. Added in 0.68.0. See details. |
PIWI_ZEPHYR_REGION | us | Region of the Zephyr Scale Cloud host the token belongs to: "us", "eu", "au" or "de". Any other value is logged and ignored, and the region stays us. Values: us, eu, au, de. Used only when PIWI_ZEPHYR_API_TOKEN is set. Named on Settings β Integrations. Added in 0.68.0. |
PIWI_TEST_MANAGEMENT_REQUESTS_PER_MINUTE | 20 | How many requests a minute Piwi sends to a test management tool (Zephyr Scale Cloud) per connection: the test case catalog read, the pickers and the Refresh catalog button share this budget. A value that is not a whole number in range is logged once and the default is used. Range: 1 to 600. Added in 0.68.0. See details. |
PIWI_INTEGRATIONS_SYNC_MINUTES | 15 | How often, in minutes, Piwi reads ticket statuses back from the tracker. Range: 1 to 1440. Added in 0.29.0. See details. |
A connection base URL is administrator-supplied and trusted, so a self-hosted Jira on a private host works. See Jira Cloud.
Failure clustering β
Tunes the similarity thresholds used when grouping failures into clusters by their error fingerprint (and optional embeddings). Only used when an embedding model is configured.
| Variable | Default | Description |
|---|---|---|
PIWI_CLUSTER_SIMILARITY_THRESHOLD | 0.92 | Cosine similarity (0β1) above which two failure embeddings merge into one cluster. Must be greater than 0 and at most 1; invalid values fall back to the default. Range: 0 to 1. Used only when PIWI_AI_EMBEDDING_MODEL is set. |
PIWI_CLUSTER_SUGGEST_THRESHOLD | 0.80 | Similarity at which a failure is suggested (not auto-merged) as related to a cluster. Capped at the merge threshold. Range: 0 to 1. Used only when PIWI_AI_EMBEDDING_MODEL is set. |
See Failure clusters β How failures are grouped.
Backend logs β
Controls the X-Piwi-Logs response-header capture that attaches backend logs to test failures. See Backend logs.
| Variable | Default | Description |
|---|---|---|
PIWI_TEST_LOGS_DISABLED | β | Disable X-Piwi-Logs response header emission (default: on in development and test, off elsewhere). Set on the instrumented backend (Nitro or ASP.NET Core). Unset: capture is on in development and test (Nitro: NODE_ENV is development or test; ASP.NET Core: the environments the app or PIWI_TEST_LOGS_ENVIRONMENTS names, Development and Test by default); true forces it off everywhere, false forces it on in any environment. Overrides every other environment setting. See details. |
PIWI_TEST_LOGS_ENVIRONMENTS | β | Comma-separated ASP.NET Core environment names the X-Piwi-Logs middleware is active in (default: Development,Test). Set on the ASP.NET Core backend. Used only when the app configures no environments itself (a UsePiwiTestLogs argument or PiwiTestLogsOptions). Names match case-insensitively. Added in 0.39.0. See details. |
PIWI_APP_COMMIT | β | The commit the application under test was built from, which its server reports as appCommit at /__piwi/environment (7 to 40 hexadecimal characters). Set on the instrumented backend (Nitro or ASP.NET Core) by its deploy. The packageβs option wins over it; unset, ASP.NET Core reads the source revision the .NET SDK writes into the entry assemblyβs informational version, and Nitro the commit variable of its hosting platform (VERCEL_GIT_COMMIT_SHA, RENDER_GIT_COMMIT, RAILWAY_GIT_COMMIT_SHA, SOURCE_COMMIT). Any other value is ignored. Served only where capture is on: a production deploy posts a deploy marker with the commit instead. Added in 0.73.0. See details. |
PIWI_APP_VERSION | β | The version of the application under test, which a Nitro server reports as appVersion at /__piwi/environment. Set on a Nitro backend; the pluginβs appVersion option wins over it. ASP.NET Core reports the entry assemblyβs informational version instead. Added in 0.73.0. See details. |
Build-time β
These affect how the app is built rather than how a running instance behaves, and are mostly for contributors.
| Variable | Default | Description |
|---|---|---|
PIWI_BUILD_DIR | β | Overrides the Nuxt build output directory. Used by the test harness to isolate parallel builds. |
PIWI_BUILD_SHA | β | Commit SHA baked into the build for provenance. Shown on Settings β About. Set as a build-time arg. |
PIWI_DEMO_MODE | β | Set to "true" to build the standalone client-side demo SPA (no server). |
TIP
PIWI_BASE_URL, PIWI_POSTGRES_TEST_URL, PIWI_S3_TEST_BUCKET, PIWI_S3_TEST_REGION, PIWI_S3_TEST_ACCESS_KEY_ID, PIWI_S3_TEST_SECRET_ACCESS_KEY, PIWI_S3_TEST_ENDPOINT, PIWI_LIVE_JIRA_PROJECT_KEY, PIWI_TEST_CLEANUP_ENABLED, PIWI_DESKTOP_TOKEN exist only for the functional test harness and are not used by a normal deployment.