Environment variables configure both the InferenceWall server and SDK behavior. Set them in your shell, pass them to Docker with -e, or load them from .env.local via source .env.local before running inferwall serve.
Variable Reference
Details
Authentication keys (IW_API_KEY, IW_ADMIN_KEY)
InferenceWall uses two separate keys with distinct roles:
IW_API_KEY — authorizes scan requests (/v1/scan/input, /v1/scan/output). Include it as Authorization: Bearer <key> in HTTP requests.
IW_ADMIN_KEY — authorizes admin endpoints. Keep this key restricted to operators.
When neither key is set, authentication is completely disabled. This is intended for local development only — never run without keys in production.
Detection profile (IW_PROFILE)
The profile controls which detection engines are active and which signatures are evaluated:
TLS mode (IW_TLS)
Redis (IW_REDIS_URL)
Set IW_REDIS_URL to a Redis connection string (e.g., redis://localhost:6379) when running multiple InferenceWall instances that need to share session state. Without it, sessions are stored in process memory.
Custom signatures (IW_SIGNATURES_DIR)
By default, InferenceWall loads custom signatures from ~/.inferwall/signatures/. All .yaml files in that directory are merged with the built-in catalog at startup. A custom signature with the same id as a built-in signature replaces it entirely.
Set IW_SIGNATURES_DIR to point at a different directory:
Custom policy (IW_POLICY_PATH)
By default, InferenceWall auto-discovers policy files from ~/.inferwall/policies/. Set IW_POLICY_PATH to load a specific policy file instead:
ELK observability (IW_ELK_URL)
Set this to your Logstash HTTP input endpoint to ship scan events and server logs to an ELK stack. Requires the observability extra:
Generating keys
Use inferwall admin setup to generate both keys and write them to .env.local:
Add .env.local to your .gitignore immediately. It contains secrets and must never be committed to source control.
Docker example