Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Shashank-H/gaiter-gaurd/llms.txt
Use this file to discover all available pages before exploring further.
Overview
GaiterGuard is configured entirely through environment variables. All variables are validated at startup, and the server will refuse to start if required variables are missing or invalid.Environment File
Create a.env file in the backend/ directory:
Required Variables
These variables must be set or the backend will not start.PostgreSQL connection string in the format:Example:Docker Compose:
Use the service name
db as the host when running in Docker Compose.Secret key for signing JWT access and refresh tokens. Must be a long, random string.Security: Use a cryptographically secure random string of at least 32 characters.Generate:Example:
Master key for encrypting service credentials in the vault. Used with AES-256-GCM.Security:Example:
- Must be at least 32 characters long (enforced)
- Use a cryptographically secure random string
- If changed, existing credentials become unreadable
Base URL for the LLM API used for risk assessment. Must be OpenAI-compatible.Supported providers:
- OpenAI:
https://api.openai.com/v1 - Azure OpenAI:
https://{resource}.openai.azure.com/openai/deployments/{deployment} - Local models (Ollama):
http://localhost:11434/v1 - Any OpenAI-compatible endpoint
API key for authenticating with the LLM service.Example:
For local Ollama instances, you can use a placeholder value like
"ollama" since authentication is not required.Optional Variables
These variables have sensible defaults but can be customized.Port the backend API server listens on.Example:
Access token expiration time. Accepts time units:
s (seconds), m (minutes), h (hours), d (days).Recommended: 15 minutes to 1 hour for security.Examples:Refresh token expiration time. Users must log in again after this period.Recommended: 7 to 30 days.Examples:
Salt value used in credential encryption key derivation. Change this to rotate the encryption scheme.Example:
Changing this requires re-encrypting all credentials. Use the same value across backend instances.
LLM model name to use for risk assessment.Recommended models:
gpt-4o-mini- Fast, cost-effective, good accuracygpt-4o- Highest accuracy, more expensivegpt-3.5-turbo- Faster, lower cost, slightly less accurate
Timeout for LLM API requests in milliseconds.Recommended: 10000-30000 (10-30 seconds)Example:
If risk assessment times out, the request is rejected as a safety measure.
Risk score threshold (0.0 to 1.0) above which requests require human approval.
- 0.0 - Block nothing (all requests pass)
- 0.3 - Block high-risk operations (PUT, DELETE)
- 0.5 - Balanced (recommended)
- 0.7 - Aggressive (blocks most POST/PATCH)
- 1.0 - Block everything
Hours after approval before the execution window expires. Agents must execute approved requests within this time.Recommended: 1-24 hoursExample:
After expiry, the action transitions to
EXPIRED status. Agents must resubmit via POST /proxy.Node.js environment mode. Set to
production in production deployments.Values:development- Enables debug loggingproduction- Production optimizations, reduced logging
Example Configurations
Validation Rules
GaiterGuard validates all environment variables at startup (seebackend/src/config/env.ts:1):
- DATABASE_URL: Must be a valid PostgreSQL connection string
- JWT_SECRET: Required, no minimum length (but use 32+ chars)
- ENCRYPTION_SECRET: Must be at least 32 characters
- RISK_THRESHOLD: Must be a number between 0.0 and 1.0
- PORT: Must be a valid integer
- LLM_TIMEOUT_MS: Must be a valid integer
- APPROVAL_EXECUTE_TTL_HOURS: Must be a valid integer
Security Best Practices
Next Steps
Deployment
Deploy to production with Docker Compose
Agent Integration
Integrate AI agents with the gateway