Full example config
Using flags instead of a file
You can pass every option as a CLI flag when you start Permify:Configuration reference
server
Controls how the HTTP and gRPC servers are exposed.Host or interface the server binds to. Empty string binds to all interfaces.
Maximum number of requests handled per second across the server.
Enable the HTTP/REST API listener.
Port for the HTTP listener. Default convention is
3476.Host the HTTP gateway uses when forwarding requests to the local gRPC server.
Enable TLS on the HTTP endpoint.
Path to the TLS certificate file for the HTTP endpoint.
Path to the TLS private key file for the HTTP endpoint.
Port for the gRPC listener. Default convention is
3478.Enable TLS on the gRPC endpoint.
Path to the TLS certificate file for the gRPC endpoint.
Path to the TLS private key file for the gRPC endpoint.
| Flag | ENV | Type |
|---|---|---|
server-host | PERMIFY_SERVER_HOST | string |
rate-limit | PERMIFY_RATE_LIMIT | int |
grpc-port | PERMIFY_GRPC_PORT | string |
grpc-tls-enabled | PERMIFY_GRPC_TLS_ENABLED | boolean |
grpc-tls-cert-path | PERMIFY_GRPC_TLS_CERT_PATH | string |
grpc-tls-key-path | PERMIFY_GRPC_TLS_KEY_PATH | string |
http-enabled | PERMIFY_HTTP_ENABLED | boolean |
http-port | PERMIFY_HTTP_PORT | string |
http-grpc-target-host | PERMIFY_HTTP_GRPC_TARGET_HOST | string |
http-tls-cert-path | PERMIFY_HTTP_TLS_CERT_PATH | string |
http-tls-key-path | PERMIFY_HTTP_TLS_KEY_PATH | string |
http-cors-allowed-origins | PERMIFY_HTTP_CORS_ALLOWED_ORIGINS | string array |
http-cors-allowed-headers | PERMIFY_HTTP_CORS_ALLOWED_HEADERS | string array |
logger
Permify uses zerolog for structured logging.Log verbosity. Accepted values:
error, warn, info, debug.Log output format. Accepted values:
text, json.Path to a log file. Defaults to stdout when empty.
| Flag | ENV | Type |
|---|---|---|
log-level | PERMIFY_LOG_LEVEL | string |
log-output | PERMIFY_LOG_OUTPUT | string |
profiler
Exposes Go’s built-in pprof endpoints for performance analysis.Enable the pprof profiling HTTP server.
Port the pprof server listens on.
| Endpoint | Purpose |
|---|---|
GET /debug/pprof/profile?seconds=30 | CPU profile over a sampling window |
GET /debug/pprof/trace?seconds=5 | Goroutine scheduling and GC trace |
GET /debug/pprof/heap | Heap allocation snapshot |
GET /debug/pprof/goroutine | All goroutines and their stack traces |
GET /debug/pprof/ | Index of all available profiles |
| Flag | ENV | Type |
|---|---|---|
profiler-enabled | PERMIFY_PROFILER_ENABLED | boolean |
profiler-port | PERMIFY_PROFILER_PORT | string |
authn
Controls whether API requests must be authenticated. Two methods are supported: pre-shared keys and OpenID Connect.Enable API authentication. When
false, all requests are accepted without credentials.Authentication method. Accepted values:
preshared, oidc.Pre-shared keys
One or more private keys clients must supply to authenticate. Permify does not generate these keys — you must provide them.
OpenID Connect (OIDC)
URL of the Identity Provider. Used to discover JWKS and validate tokens.
Expected audience claim in tokens. Ensures tokens were issued for this service.
How often to refresh the JWKS from the provider.
Initial delay between JWKS fetch retries on failure.
Duration to wait before retrying after a failed authentication attempt.
Maximum number of JWKS fetch retries before giving up.
Allowed JWT signing algorithms. Tokens signed with other algorithms are rejected.
| Flag | ENV | Type |
|---|---|---|
authn-enabled | PERMIFY_AUTHN_ENABLED | boolean |
authn-method | PERMIFY_AUTHN_METHOD | string |
authn-preshared-keys | PERMIFY_AUTHN_PRESHARED_KEYS | string array |
authn-oidc-issuer | PERMIFY_AUTHN_OIDC_ISSUER | string |
authn-oidc-audience | PERMIFY_AUTHN_OIDC_AUDIENCE | string |
authn-oidc-refresh-interval | PERMIFY_AUTHN_OIDC_REFRESH_INTERVAL | duration |
authn-oidc-backoff-interval | PERMIFY_AUTHN_OIDC_BACKOFF_INTERVAL | duration |
authn-oidc-backoff-frequency | PERMIFY_AUTHN_OIDC_BACKOFF_FREQUENCY | duration |
authn-oidc-backoff-max-retries | PERMIFY_AUTHN_OIDC_BACKOFF_RETRIES | int |
authn-oidc-valid-methods | PERMIFY_AUTHN_OIDC_VALID_METHODS | string array |
tracer
Permify integrates with Jaeger, Zipkin, SigNoz, and OTLP for distributed tracing.Enable distributed trace export.
Trace exporter backend. Accepted values:
jaeger, otlp, signoz, zipkin.Endpoint URL for the trace exporter.
Override the default URL path for the OTLP exporter.
Use HTTP instead of HTTPS when exporting traces.
| Flag | ENV | Type |
|---|---|---|
tracer-enabled | PERMIFY_TRACER_ENABLED | boolean |
tracer-exporter | PERMIFY_TRACER_EXPORTER | string |
tracer-endpoint | PERMIFY_TRACER_ENDPOINT | string |
tracer-urlpath | PERMIFY_TRACER_URL_PATH | string |
tracer-insecure | PERMIFY_TRACER_INSECURE | boolean |
meter
Observability metrics: check counts, cache hit rates, and session info (Permify version, hostname, OS, architecture).Enable metrics export.
Metrics exporter.
otlp is the standard choice.Endpoint for the metrics exporter.
Override the default URL path for the OTLP metrics exporter.
Use HTTP instead of HTTPS when exporting metrics.
| Flag | ENV | Type |
|---|---|---|
meter-enabled | PERMIFY_METER_ENABLED | boolean |
meter-exporter | PERMIFY_METER_EXPORTER | string |
meter-endpoint | PERMIFY_METER_ENDPOINT | string |
meter-urlpath | PERMIFY_METER_URL_PATH | string |
meter-insecure | PERMIFY_METER_INSECURE | boolean |
service
Tunes runtime behavior: circuit breaking, cache sizes, and permission evaluation limits.Enable the circuit breaker pattern for internal service calls.
Enable the configuration watcher for live reloading.
Number of counters used by the schema cache eviction policy.
Maximum memory budget for the schema cache.
Maximum number of permission checks in a single bulk request.
Maximum number of concurrent permission evaluations.
Number of counters used by the permission cache eviction policy.
Maximum memory budget for the permission cache.
| Flag | ENV | Type |
|---|---|---|
service-circuit-breaker | PERMIFY_SERVICE_CIRCUIT_BREAKER | boolean |
service-watch-enabled | PERMIFY_SERVICE_WATCH_ENABLED | boolean |
service-schema-cache-number-of-counters | PERMIFY_SERVICE_SCHEMA_CACHE_NUMBER_OF_COUNTERS | int |
service-schema-cache-max-cost | PERMIFY_SERVICE_SCHEMA_CACHE_MAX_COST | int |
service-permission-bulk-limit | PERMIFY_SERVICE_PERMISSION_BULK_LIMIT | int |
service-permission-concurrency-limit | PERMIFY_SERVICE_PERMISSION_CONCURRENCY_LIMIT | int |
service-permission-cache-max-cost | PERMIFY_SERVICE_PERMISSION_CACHE_MAX_COST | int |
database
Specifies where Permify stores relation tuples, schemas, audit logs, and decision logs.PostgreSQL 13.8+ is the supported production database. The
memory engine is available for local testing only — data is lost on restart.Storage backend. Use
postgres for production, memory for local development.PostgreSQL connection URI. Example:
postgres://user:password@host:5432/db_name.Separate write connection URI. Falls back to
uri when not set. Useful for primary/replica setups.Separate read connection URI. Falls back to
uri when not set.Run schema migrations automatically at startup. Set to
false if you manage migrations externally.Maximum connections in the pool (maps to pgxpool
MaxConns). Replaces the deprecated max_open_connections.Minimum connections kept in the pool (maps to pgxpool
MinConns). If 0 and max_idle_connections is set, that value is used instead.Minimum idle connections in the pool (maps to pgxpool
MinIdleConns).Maximum lifetime of a connection before it is closed and replaced.
Maximum time a connection may remain idle before it is closed.
Interval between health checks on idle connections.
0 uses the pgxpool default of 1 minute.Random jitter added to
max_connection_lifetime to prevent thundering-herd connection expiry. 0 defaults to 20% of max_connection_lifetime.Maximum time to wait when establishing a new connection.
0 uses the pgx default (no timeout).Maximum number of relation tuples written in a single database operation.
Maximum number of retries for failed database operations.
Buffer size for change-stream watch operations.
database.garbage_collection
Periodically removes stale relation tuples to keep the database size under control.Enable the garbage collection job.
How often the garbage collection job runs.
How far back in time the job looks when cleaning stale data.
Maximum time a single garbage collection run may take.
Production connection pooling with pgcat
For multi-replica deployments, connect Permify through pgcat (a PostgreSQL connection pooler) rather than directly to Postgres. This prevents connection exhaustion when many Permify pods are running.| Flag | ENV | Type |
|---|---|---|
database-engine | PERMIFY_DATABASE_ENGINE | string |
database-uri | PERMIFY_DATABASE_URI | string |
database-writer-uri | PERMIFY_DATABASE_WRITER_URI | string |
database-reader-uri | PERMIFY_DATABASE_READER_URI | string |
database-auto-migrate | PERMIFY_DATABASE_AUTO_MIGRATE | boolean |
database-max-connections | PERMIFY_DATABASE_MAX_CONNECTIONS | int |
database-min-connections | PERMIFY_DATABASE_MIN_CONNECTIONS | int |
database-min-idle-connections | PERMIFY_DATABASE_MIN_IDLE_CONNECTIONS | int |
database-max-connection-lifetime | PERMIFY_DATABASE_MAX_CONNECTION_LIFETIME | duration |
database-max-connection-idle-time | PERMIFY_DATABASE_MAX_CONNECTION_IDLE_TIME | duration |
database-health-check-period | PERMIFY_DATABASE_HEALTH_CHECK_PERIOD | duration |
database-max-connection-lifetime-jitter | PERMIFY_DATABASE_MAX_CONNECTION_LIFETIME_JITTER | duration |
database-connect-timeout | PERMIFY_DATABASE_CONNECT_TIMEOUT | duration |
database-max-data-per-write | PERMIFY_DATABASE_MAX_DATA_PER_WRITE | int |
database-max-retries | PERMIFY_DATABASE_MAX_RETRIES | int |
database-watch-buffer-size | PERMIFY_DATABASE_WATCH_BUFFER_SIZE | int |
database-garbage-collection-enabled | PERMIFY_DATABASE_GARBAGE_COLLECTION_ENABLED | boolean |
database-garbage-collection-interval | PERMIFY_DATABASE_GARBAGE_COLLECTION_INTERVAL | duration |
database-garbage-collection-timeout | PERMIFY_DATABASE_GARBAGE_COLLECTION_TIMEOUT | duration |
database-garbage-collection-window | PERMIFY_DATABASE_GARBAGE_COLLECTION_WINDOW | duration |
distributed
Enables consistent hashing across multiple Permify instances so that permission cache lookups are routed to the same pod for a given key, improving cache efficiency.Enable distributed mode.
Address of the distributed service. For Kubernetes, use the DNS name of the headless service, e.g.
kubernetes:///permify.default:5000.Port the distributed service is exposed on.
| Flag | ENV | Type |
|---|---|---|
distributed-enabled | PERMIFY_DISTRIBUTED_ENABLED | boolean |
distributed-address | PERMIFY_DISTRIBUTED_ADDRESS | string |
distributed-port | PERMIFY_DISTRIBUTED_PORT | string |