Skip to content

Configuration

PromptGate is configured via the backend/.env file (or via environment: in Docker Compose). This page is the complete reference — every var that ships in .env.example plus the feature-specific ones added by guardrails, OAuth, SSRF, and the contextual PII detector.

Anything not listed here is either a Laravel internal you can ignore, or a sensible Laravel default.

VariableDefaultNotes
APP_NAME"PromptGate v2"Shown in browser title and emails.
APP_ENVlocallocal / staging / production. Set to production in prod.
APP_KEY(generate it)32-byte AES key in base64:… format. Encrypts every credential, OAuth token, and MCP server bearer. Losing it = unrecoverable secrets.
APP_DEBUGtrueSet to false in production.
APP_URLhttp://localhost:8000Public URL. Used in OAuth callback, MCP bridge URL, curl examples shown in the UI.
APP_LOCALEenDefault UI language. (Currently English only.)
APP_TIMEZONEUTCUsed for log timestamps and audit entries.
BCRYPT_ROUNDS12Password hash cost. 4 in tests, 12 in prod.

To generate a fresh one:

Terminal window
docker compose exec app php artisan key:generate

PromptGate supports SQLite (default), MySQL 8+, and PostgreSQL 14+. See Database Setup for the swap procedure.

VariableDefaultNotes
DB_CONNECTIONsqlitesqlite / mysql / pgsql.
DB_DATABASEdatabase/database.sqliteSQLite file path or database name for MySQL/Postgres.
DB_HOST127.0.0.1Ignored for SQLite.
DB_PORT3306 (mysql) / 5432 (pgsql)
DB_USERNAMEroot
DB_PASSWORD(empty)
VariableDefaultNotes
SESSION_DRIVERdatabasedatabase / redis / array (test only) / file.
SESSION_LIFETIME120Minutes of session idle before logout.
SESSION_ENCRYPTfalseEncrypt session payloads (small CPU cost).
CACHE_STOREdatabasedatabase / redis / file / array (tests). Used by rate limits for the per-minute / per-hour bucket counters.
QUEUE_CONNECTIONdatabasedatabase / redis / sync. Webhooks dispatch through this.
BROADCAST_CONNECTIONlogNot currently wired to live UI.

For production, Redis for cache + sessions + queue is recommended:

Terminal window
CACHE_STORE=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=
VariableDefaultNotes
LOG_CHANNELstackstack / single / daily / stderr. Set to stderr in Docker so logs land in docker logs.
LOG_STACKsingleChannels combined when LOG_CHANNEL=stack.
LOG_LEVELdebugdebug / info / warning / error. Set to warning in prod.
LOG_DEPRECATIONS_CHANNELnullWhere deprecations go.

Used by webhooks (in the future) and password-reset emails. Defaults are off-line / safe.

VariableDefaultNotes
MAIL_MAILERloglog writes mails to the log file (great for dev). smtp / ses / mailgun / postmark for prod.
MAIL_HOST127.0.0.1
MAIL_PORT2525
MAIL_USERNAMEnull
MAIL_PASSWORDnull
MAIL_FROM_ADDRESShello@example.comSet this.
MAIL_FROM_NAME${APP_NAME}
VariableDefaultNotes
FILESYSTEM_DISKlocalWhere backups land if you ever store them in-place (default behaviour streams the ZIP directly).
VariableDefaultNotes
AWS_ACCESS_KEY_ID(empty)
AWS_SECRET_ACCESS_KEY(empty)
AWS_DEFAULT_REGIONus-east-1
AWS_BUCKET(empty)
AWS_USE_PATH_STYLE_ENDPOINTfalse

Used only if you point FILESYSTEM_DISK=s3.

These are the env variables that control PromptGate features beyond what Laravel provides out of the box.

Used by PII Filter when person_name or address types are enabled.

VariableDefaultNotes
PII_CONTEXTUAL_ENABLEDtrueMaster switch. Set to false to disable contextual detection even if a credential is configured.
PII_CONTEXTUAL_CREDENTIAL_ID(unset)DB id of the App\Models\Credential row to use for the LLM call. The credential’s provider_key picks the adapter.
PII_CONTEXTUAL_MODELgpt-4o-miniModel identifier passed to the provider. Should be cheap + fast.
PII_CONTEXTUAL_MAX_CHARS8000Inputs longer than this skip contextual detection (regex still runs).
Terminal window
PII_CONTEXTUAL_ENABLED=true
PII_CONTEXTUAL_CREDENTIAL_ID=3
PII_CONTEXTUAL_MODEL=gpt-4o-mini

Used by the local Ollama adapter.

VariableDefault
OLLAMA_BASE_URLhttp://localhost:11434/v1

Set to your Ollama instance’s URL if it isn’t on the same host.

Used by SSRF Protection to permit specific internal hosts.

VariableDefaultNotes
SSRF_ALLOWED_HOSTS(empty)Comma-separated host list. * disables the SSRF guard entirely (only used by the test suite).
Terminal window
# Allow an internal API on a docker bridge network
SSRF_ALLOWED_HOSTS=internal-api.svc.local,10.0.0.42
VariableDefaultNotes
PULSE_ENABLEDfalseLaravel Pulse (not currently used).
TELESCOPE_ENABLEDfalseLaravel Telescope (not currently used).
NIGHTWATCH_ENABLEDfalseLaravel Nightwatch (not currently used).

Leave these false unless you know you need them.

Drop-in template for a real deployment:

Terminal window
APP_NAME="PromptGate"
APP_ENV=production
APP_KEY=base64:... # generate with `php artisan key:generate`
APP_DEBUG=false
APP_URL=https://gateway.your-domain.com
APP_TIMEZONE=Europe/Berlin
DB_CONNECTION=pgsql
DB_HOST=db.internal
DB_PORT=5432
DB_DATABASE=promptgate
DB_USERNAME=promptgate
DB_PASSWORD=...
CACHE_STORE=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis
REDIS_HOST=redis
REDIS_PORT=6379
LOG_CHANNEL=stderr
LOG_LEVEL=warning
MAIL_MAILER=smtp
MAIL_HOST=smtp.your-provider.com
MAIL_PORT=587
MAIL_USERNAME=...
MAIL_PASSWORD=...
MAIL_FROM_ADDRESS=noreply@your-domain.com
MAIL_FROM_NAME="PromptGate"
# Optional features
PII_CONTEXTUAL_CREDENTIAL_ID=3
PII_CONTEXTUAL_MODEL=gpt-4o-mini
SSRF_ALLOWED_HOSTS=

When you change .env, the changes take effect on the next request — but if you have config caching enabled (php artisan config:cache), you need to clear it:

Terminal window
docker compose exec app php artisan config:clear
docker compose restart app

Next: Database Setup — switching from SQLite to MySQL or PostgreSQL.


© Akyros Labs LLC. All rights reserved.