# Environment Configuration

> DAIV provides a large number of environment variables that can be used to configure DAIV behavior. This page lists all supported environment variables.

- Skill: `tools-only/environment-configuration` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/environment-configuration`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/environment-configuration/raw
- Safety review: pending (external: skill-scanner PASS, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-29
- Page: https://skillmd.com/skills/tools-only/environment-configuration

---

# Environment Configuration

DAIV provides a large number of environment variables that can be used to configure DAIV behavior. This page lists all supported environment variables.

Variables marked with:

 * :material-lock: are sensitive (such as API keys, passwords, and tokens) and should be declared using Docker secrets or a secure credential manager.
 * :material-asterisk: are required and should be declared.

---

## Core

### General

| Variable                | Description                                         | Default                | Example                        |
|-------------------------|-----------------------------------------------------|:----------------------:|--------------------------------|
| `DJANGO_DEBUG`          | Toggle Django debug mode                            | `False`                | `True`                         |
| :material-asterisk: `DJANGO_SECRET_KEY`  :material-lock:     | Secret key for Django                              | *(none)*               | `super-secret-key`             |
| `DJANGO_ALLOWED_HOSTS`  | Comma-separated list of allowed hosts               | `*`                    | `example.com,localhost`        |

!!! danger
    Do not turn on `DJANGO_DEBUG` in production. It will **expose sensitive information** and **break the security of the application**.

!!! info
    The `DJANGO_ALLOWED_HOSTS` variable is used to specify the hosts that are allowed to access the application. Make sure to include the host where the application is running to increase security.

### Uvicorn

| Variable                | Description                                         | Default                | Example                        |
|-------------------------|-----------------------------------------------------|:----------------------:|--------------------------------|
| `UVICORN_HOST`          | Host to bind the Uvicorn server                     | `0.0.0.0`              | `0.0.0.0`                      |
| `UVICORN_PORT`          | Port to bind the Uvicorn server                     | `8000`                 | `8000`                         |


### Database

| Variable        | Description                                 | Default      | Example         |
|-----------------|---------------------------------------------|:------------:|-----------------|
| :material-asterisk: `DB_NAME`       | Database name                              | *(none)*     | `daiv`          |
| :material-asterisk: `DB_USER`        | Database user                              | *(none)*     | `daiv_admin`    |
| :material-asterisk: `DB_PASSWORD`  :material-lock:   | Database password                          | *(none)*     |                 |
| `DB_HOST`       | Database host                              | `localhost`  | `db`            |
| `DB_PORT`       | Database port                              | `5432`       | `5432`          |
| `DB_SSLMODE`    | PostgreSQL SSL mode                        | `require`    | `prefer`        |
| `DB_POOL_MAX_SIZE` | Maximum size of a connection pool | `15` | `30` |

### Redis

| Variable           | Description                | Default | Example |
|--------------------|----------------------------|:---------:|---------|
| :material-asterisk: `DJANGO_REDIS_URL`  :material-lock: | Redis connection URL | *(none)* | `redis://redis:6379/0` |


### Sentry

| Variable                | Description                        | Default        | Example         |
|-------------------------|------------------------------------|:--------------:|-----------------|
| `SENTRY_DSN` :material-lock:            | Sentry DSN                         | *(none)*       |                 |
| `SENTRY_DEBUG`          | Enable Sentry debug mode           | `False`        | `True`          |
| `SENTRY_ENABLE_LOGS`    | Enable Sentry logs                 | `False`        | `True`          |
| `SENTRY_TRACES_SAMPLE_RATE` | Sentry traces sample rate          | `0.0`          | `1.0`           |
| `SENTRY_PROFILES_SAMPLE_RATE` | Sentry profiles sample rate        | `0.0`          | `1.0`           |
| `SENTRY_SEND_DEFAULT_PII` | Enable Sentry default PII           | `False`        | `True`          |
| `NODE_HOSTNAME`         | Node hostname for Sentry           | *(none)*       |                 |
| `SERVICE_NAME`          | Service name for Sentry            | *(none)*       |                 |

!!! note
    `NODE_HOSTNAME` and `SERVICE_NAME` are used to identify the node and service that is reporting the error.

### Logging

| Variable                | Description                        | Default        | Example         |
|-------------------------|------------------------------------|:--------------:|-----------------|
| `DJANGO_LOGGING_LEVEL`  | Django logging level               | `INFO`         | `DEBUG`         |

### Monitoring (LangSmith)

| Variable                | Description                        | Default        | Example         |
|-------------------------|------------------------------------|:--------------:|-----------------|
| `LANGSMITH_TRACING`     | Enable LangSmith tracing (alternative) | `False`    | `true`          |
| `LANGSMITH_PROJECT`     | LangSmith project name (alternative) | `default`    | `daiv-production` |
| `LANGSMITH_API_KEY` :material-lock:    | LangSmith API key (alternative)    | *(none)*       | `lsv2_pt_...`   |
| `LANGSMITH_API_KEY_FILE` | Path to LangSmith API key file    | *(none)*       | `/run/secrets/langsmith_api_key` |
| `LANGSMITH_ENDPOINT`    | LangSmith API endpoint             | `https://api.smith.langchain.com` | `https://eu.api.smith.langchain.com` |

!!! note
    LangSmith provides comprehensive monitoring and observability for AI agents. For detailed setup instructions, see [Monitoring Configuration](monitoring.md).

### Sandbox (client-side)

| Variable                | Description                        | Default        | Example         |
|-------------------------|------------------------------------|:--------------:|-----------------|
| `DAIV_SANDBOX_URL`     | URL of the sandbox service    | `http://sandbox:8000` | `http://sandbox:8000` |
| `DAIV_SANDBOX_TIMEOUT` | Timeout for sandbox requests in seconds        | `600`          | `600`           |
| `DAIV_SANDBOX_API_KEY` :material-lock: | API key for sandbox requests        | *(none)*          | `random-api-key`           |
| `DAIV_SANDBOX_BASE_IMAGE` | Default base image for sandbox sessions (enables sandbox when set) | `python:3.12-alpine` | `python:3.14-alpine` |
| `DAIV_SANDBOX_EPHEMERAL` | Default ephemeral setting for sandbox sessions | `False` | `True` |
| `DAIV_SANDBOX_NETWORK_ENABLED` | Default network setting for sandbox sessions | `False` | `True` |
| `DAIV_SANDBOX_CPU` | Default CPU limit for sandbox sessions (CPUs) | `None` | `1.0` |
| `DAIV_SANDBOX_MEMORY` | Default memory limit for sandbox sessions (bytes) | `None` | `1073741824` |

!!! info
    Check the [daiv-sandbox](https://github.com/daiv/daiv-sandbox) repository for server-side configuration of the sandbox service.

### Other

| Variable                | Description                        | Default        | Example         |
|-------------------------|------------------------------------|:--------------:|-----------------|
| `DAIV_EXTERNAL_URL`     | External URL of the application.   | `https://app:8000` | `https://daiv.example.com` |

!!! note
    The `DAIV_EXTERNAL_URL` variable is used to define webhooks on Git platform. Make sure that the URL is accessible from the Git platform.

---

## Codebase

### General

| Variable            | Description                              | Default   | Example   |
|---------------------|------------------------------------------|:---------:|-----------|
| `CODEBASE_CLIENT`   | Client to use for codebase operations    | `gitlab`  | `gitlab`, `github`, or `swe`  |

!!! note
    Set `CODEBASE_CLIENT` to either `gitlab`, `github`, or `swe` depending on which platform you want to use. Only one platform can be active at a time.

    The `swe` client type is designed for SWE-bench style evaluations and clones public OSS repositories to temporary directories without requiring credentials. It uses ephemeral temporary clones per run and does not cache repositories across runs. Repository identifiers should be in the format `owner/name` (e.g., `psf/requests`).

### GitLab Integration

| Variable                        | Description                                 | Default   | Example              |
|---------------------------------|---------------------------------------------|:---------:|----------------------|
| :material-asterisk: `CODEBASE_GITLAB_URL`            | URL of the GitLab instance                  | *(none)*  | `https://gitlab.com` |
| :material-asterisk: `CODEBASE_GITLAB_AUTH_TOKEN`  :material-lock:    | Authentication token for GitLab             | *(none)*  | `glpat-xyz`          |
| `CODEBASE_GITLAB_WEBHOOK_SECRET` :material-lock:| Secret token for GitLab webhook validation  | *(none)*  | `random-webhook-secret` |

!!! note
    The `CODEBASE_GITLAB_AUTH_TOKEN` is used to authenticate with the GitLab instance using a personal access token with the `api` scope.

### GitHub Integration

| Variable                        | Description                                 | Default   | Example              |
|---------------------------------|---------------------------------------------|:---------:|----------------------|
| `CODEBASE_GITHUB_URL`           | URL of the GitHub instance                  | *(none)*  | `https://github.com` |
| :material-asterisk: `CODEBASE_GITHUB_APP_ID`               | GitHub App ID                               | *(none)*  | `123456`             |
| :material-asterisk: `CODEBASE_GITHUB_INSTALLATION_ID`      | GitHub App Installation ID                  | *(none)*  | `789012`             |
| :material-asterisk: `CODEBASE_GITHUB_PRIVATE_KEY` :material-lock:         | GitHub App private key (PEM format)         | *(none)*  |                      |
| `CODEBASE_GITHUB_WEBHOOK_SECRET` :material-lock:| Secret token for GitHub webhook validation  | *(none)*  | `random-webhook-secret` |

!!! note
    GitHub uses GitHub App authentication. You must create a GitHub App in your account or organization settings. The private key is a multi-line PEM file that should be stored securely using Docker secrets.

!!! info
    For GitHub Enterprise Server, set `CODEBASE_GITHUB_URL` to your GitHub Enterprise URL (e.g., `https://github.your-company.com`). For GitHub.com, this variable can be omitted.

---

## Automation: LLM Providers

This section documents the environment variables for each LLM provider.

!!! note
    At least one of the [supported providers](../getting-started/supported-providers.md) should be configured to use the automation features.

### OpenRouter (*default*)

| Variable                        | Description                | Default                        | Example |
|---------------------------------|----------------------------|:------------------------------:|---------|
| `OPENROUTER_API_KEY` :material-lock: | OpenRouter API key         | *(none)*                       |         |
| `OPENROUTER_API_BASE`| OpenRouter API base URL    | `https://openrouter.ai/api/v1` |         |

### Anthropic

| Variable                        | Description                | Default    | Example |
|---------------------------------|----------------------------|:----------:|---------|
| `ANTHROPIC_API_KEY` :material-lock:  | Anthropic API key          | *(none)*   |         |

### OpenAI

| Variable                        | Description                | Default    | Example |
|---------------------------------|----------------------------|:----------:|---------|
| `OPENAI_API_KEY` :material-lock:     | OpenAI API key             | *(none)*   |         |

### Google

| Variable                        | Description                | Default    | Example |
|---------------------------------|----------------------------|:----------:|---------|
| `GOOGLE_API_KEY` :material-lock:     | Google API key             | *(none)*   |         |

## Automation: Tools

This section documents the environment variables for each tool configuration used by AI agents.

### Web Search

| Variable                        | Description                                                    | Default        | Example |
|---------------------------------|----------------------------------------------------------------|:--------------:|---------|
| `AUTOMATION_WEB_SEARCH_MAX_RESULTS` | Maximum number of results to return from web search      | `5`            |         |
| `AUTOMATION_WEB_SEARCH_ENGINE`  | Web search engine to use (`duckduckgo`, `tavily`)              | `duckduckgo`   | `tavily`|
| `AUTOMATION_WEB_SEARCH_API_KEY` :material-lock: | Web search API key (required if engine is `tavily`)            | *(none)*       |         |

### Web Fetch

The native `web_fetch` tool fetches a URL, converts HTML to markdown, then uses a small/fast model to answer a prompt about the page content.

| Variable                        | Description                                                    | Default        | Example |
|---------------------------------|----------------------------------------------------------------|:--------------:|---------|
| `AUTOMATION_WEB_FETCH_ENABLED`  | Enable/disable the native `web_fetch` tool                     | `true`         | `false` |
| `AUTOMATION_WEB_FETCH_MODEL_NAME` | Model used by `web_fetch` to process page content with the prompt | `openrouter:openai/gpt-4.1-mini` | `openrouter:anthropic/claude-haiku-4.5` |
| `AUTOMATION_WEB_FETCH_CACHE_TTL_SECONDS` | Cache TTL (seconds) for repeated fetches                | `900`          | `900` |
| `AUTOMATION_WEB_FETCH_TIMEOUT_SECONDS` | HTTP timeout for fetching (seconds)                      | `30`           | `10` |
| `AUTOMATION_WEB_FETCH_PROXY_URL` | Optional proxy URL for web fetch HTTP requests                 | *(none)*       | `http://proxy:8080` |
| `AUTOMATION_WEB_FETCH_MAX_CONTENT_CHARS` | Max page content size (characters) to analyze in one pass | `80000` | `120000` |

### MCP Tools

MCP (Model Context Protocol) tools extend agent capabilities by providing access to external services and specialized functionality.

| Variable                        | Description                                                    | Default                        | Example |
|---------------------------------|----------------------------------------------------------------|:------------------------------:|---------|
| `MCP_PROXY_HOST`                | Host URL for the MCP proxy server                             | `http://mcp-proxy:9090`        | `http://localhost:9090` |
| `MCP_PROXY_ADDR`                | Address for the MCP proxy to listen on                        | `:9090`                        | `:9090` |
| `MCP_PROXY_AUTH_TOKEN` :material-lock: | Authentication token for MCP proxy                             | *(none)*                       | `secure-auth-token` |
| `MCP_SENTRY_ENABLED`            | Enable/disable Sentry MCP server for error monitoring         | `true`                         | `false` |
| `MCP_SENTRY_VERSION`            | Version of the Sentry MCP server                              | `0.17.1`                       | `0.17.1` |
| `MCP_SENTRY_ACCESS_TOKEN` :material-lock: | Sentry API access token                                        | *(none)*                       | `sntryu_abc123...` |
| `MCP_SENTRY_HOST`               | Sentry instance hostname                                       | *(none)*                       | `your-org.sentry.io` |

!!! info
    MCP tools are currently available in the **Plan and Execute** agent. The Sentry server enables error monitoring integration. For detailed configuration, see [MCP Tools](../ai-agents/mcp-tools.md).

!!! note
    Sentry MCP server requires both `MCP_SENTRY_ACCESS_TOKEN` and `MCP_SENTRY_HOST` to be configured for functionality.

---

## Automation: AI Agents

This section documents the environment variables for each automation agent. Each agent uses a unique prefix for its variables.

All the default models where chosen to be the most effective models. You can change the models to use other models by setting the corresponding environment variables.

### Plan and Execute

| Variable | Description | Default |
|----------------------------------------|----------------------------------------------------------|------------------------|
| `PLAN_AND_EXECUTE_PLANNING_RECURSION_LIMIT` | Recursion limit for planning steps each. | `100` |
| `PLAN_AND_EXECUTE_PLANNING_MODEL_NAME` | Model for planning tasks. | `openrouter:anthropic/claude-sonnet-4.5` |
| `PLAN_AND_EXECUTE_PLANNING_FALLBACK_MODEL_NAME` | Fallback model for planning tasks. | `openrouter:openai/gpt-5.2` |
| `PLAN_AND_EXECUTE_PLANNING_THINKING_LEVEL` | Thinking level for planning tasks. | `medium` |
| `PLAN_AND_EXECUTE_EXECUTION_MODEL_NAME`| Model for executing tasks. | `openrouter:anthropic/claude-sonnet-4.5` |
| `PLAN_AND_EXECUTE_EXECUTION_FALLBACK_MODEL_NAME`| Fallback model for executing tasks. | `openrouter:openai/gpt-5.2` |
| `PLAN_AND_EXECUTE_EXECUTION_THINKING_LEVEL` | Thinking level for execution tasks. | `None` (disabled) |
| `PLAN_AND_EXECUTE_EXECUTION_RECURSION_LIMIT` | Recursion limit for execution steps each. | `100` |
| `PLAN_AND_EXECUTE_CODE_REVIEW_MODEL_NAME` | Model for code review tasks. | `openrouter:openai/gpt-5.1-codex-mini` |
| `PLAN_AND_EXECUTE_CODE_REVIEW_THINKING_LEVEL` | Thinking level for code review tasks. | `medium` |
| `PLAN_AND_EXECUTE_MAX_PLANNING_MODEL_NAME` | Model for planning tasks when `daiv-max` label is present. | `openrouter:anthropic/claude-opus-4.5` |
| `PLAN_AND_EXECUTE_MAX_PLANNING_THINKING_LEVEL` | Thinking level for planning tasks when `daiv-max` label is present. | `high` |
| `PLAN_AND_EXECUTE_MAX_EXECUTION_MODEL_NAME` | Model for execution tasks when `daiv-max` label is present. | `openrouter:anthropic/claude-opus-4.5` |
| `PLAN_AND_EXECUTE_MAX_EXECUTION_THINKING_LEVEL` | Thinking level for execution tasks when `daiv-max` label is present. | `high` |

### Diff to Metadata

| Variable | Description | Default |
|-------------------------------|----------------------------------------------|------------------------|
| `DIFF_TO_METADATA_MODEL_NAME` | Model for diff to metadata. | `openrouter:anthropic/claude-haiku-4.5` |
| `DIFF_TO_METADATA_FALLBACK_MODEL_NAME` | Fallback model for diff to metadata. | `openrouter:openai/gpt-4.1-mini` |

### Codebase Chat

| Variable | Description | Default |
|----------------------------------------|----------------------------------------------------------|--------------------|
| `CODEBASE_CHAT_MODEL_NAME` | Model for codebase chat. | `openrouter:anthropic/claude-haiku-4.5` |
| `CODEBASE_CHAT_TEMPERATURE` | Temperature for codebase chat. | `0.2` |
| `CODEBASE_CHAT_RECURSION_LIMIT` | Recursion limit for the codebase chat agent. | `50` |

