Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agents/set-up-agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ The org key is used for chat and agent utility calls only. The following continu

- Embeddings
- The [evaluation](/agents/create-evaluation-suites) judge
- [AI writeback](/agents/ai-writeback) (configured separately via `AI_WRITEBACK_ANTHROPIC_API_KEY`)
- [AI writeback](/agents/ai-writeback) (uses the instance-wide `ANTHROPIC_API_KEY`)

Automatic [issue filing](/agents/issues) is paused while an org has any BYO provider key set, so agent turns never route through the instance provider for issue classification. Remove all BYO keys to re-enable automatic issue filing.

Expand Down
3 changes: 1 addition & 2 deletions self-host/customize-deployment/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,12 @@ The AI Analyst supports multiple providers. Provide credentials for the provider

| Variable | Description |
| ---------------------------- | ------------------------------------------------------------------------------------------- |
| `ANTHROPIC_API_KEY` | (Required when using Anthropic) API key for Anthropic |
| `ANTHROPIC_API_KEY` | (Required when using Anthropic, and for AI writeback) API key for Anthropic |
| `ANTHROPIC_MODEL_NAME` | Anthropic model name to use (default=claude-sonnet-4-5) |
| `ANTHROPIC_BASE_URL` | Optional HTTP(S) base URL for an Anthropic-compatible gateway. Configure the base before `/v1`; the configured `ANTHROPIC_API_KEY` is sent as a bearer token. |
| `ANTHROPIC_AVAILABLE_MODELS` | Comma-separated list of models available in the model picker (default=All supported models) |
| `ANTHROPIC_CUSTOM_HEADERS` | JSON object of extra HTTP headers to send with every Anthropic request |
| `ANTHROPIC_SUPPORTS_STREAMING` | Set to `false` if your Anthropic endpoint or gateway doesn't support streaming (SSE) completions — Lightdash will make non-streaming requests instead (default=true) |
| `AI_WRITEBACK_ANTHROPIC_API_KEY` | (Required for AI writeback) Dedicated Anthropic API key used by the AI writeback feature. Kept separate from `ANTHROPIC_API_KEY` so writeback and AI Analyst have independent spend caps and fail independently. |

#### Azure AI Configuration

Expand Down
6 changes: 3 additions & 3 deletions self-host/enterprise-features/ai-writeback.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Add the following environment variables to your Lightdash deployment:
| Variable | Example | Purpose |
| --- | --- | --- |
| `E2B_AI_WRITEBACK_TEMPLATE_NAME` | `lightdash/lightdash-ai-writeback` | Lightdash's public E2B template for writeback — pulls our prebuilt sandbox image so you don't have to build one yourself. The `lightdash/` prefix points at our public team template; without it E2B looks in your own team and won't find the image. |
| `AI_WRITEBACK_ANTHROPIC_API_KEY` | `<your-anthropic-api-key>` | Dedicated [Anthropic](https://console.anthropic.com/) API key used by the writeback agent. Kept separate from `ANTHROPIC_API_KEY` so writeback and AI Analyst have independent spend caps and fail independently. |
| `ANTHROPIC_API_KEY` | `<your-anthropic-api-key>` | Your [Anthropic](https://console.anthropic.com/) API key. Used by the writeback agent, the same key [data apps](/self-host/enterprise-features/data-apps) and AI Analyst use. |

Restart the backend. Users with AI Analyst access on a project connected to a supported git host will see the agent offer to open a pull request when they ask for a change that belongs in the dbt repo.

Expand All @@ -54,7 +54,7 @@ Self-hosting AI writeback means you pay your sandbox provider and Anthropic dire
- **Your sandbox provider** bills for sandbox runtime. A typical writeback runs for 1–5 minutes while the agent inspects files, edits them, and runs `lightdash compile`.
- **Anthropic** bills per token. Each writeback sends the project's dbt catalog and the self-contained instruction generated from the user's request to Claude, plus any files the agent reads while making the change.

Both providers expose usage dashboards. We recommend setting spend limits on both — and using `AI_WRITEBACK_ANTHROPIC_API_KEY` rather than reusing `ANTHROPIC_API_KEY` — so writeback spend can be capped independently of AI Analyst.
Both providers expose usage dashboards. We recommend setting spend limits on both. Writeback shares `ANTHROPIC_API_KEY` with AI Analyst and data apps, so Anthropic spend limits apply across those features.

## Permissions

Expand All @@ -72,7 +72,7 @@ Check that `LIGHTDASH_LICENSE_KEY` is set and the project's dbt connection is Gi
Check your [sandbox provider's](/self-host/customize-deployment/sandboxes) credentials, and verify `E2B_AI_WRITEBACK_TEMPLATE_NAME` is set to `lightdash/lightdash-ai-writeback` (the `lightdash/` prefix is required to pull our public template — a bare name resolves to your own team). If you've overridden `E2B_AI_WRITEBACK_TEMPLATE_TAG`, double-check the tag exists.

**Writebacks fail mid-run with an Anthropic error.**
Check your Anthropic account usage limits and confirm `AI_WRITEBACK_ANTHROPIC_API_KEY` is valid. Long-running writebacks can hit rate limits on lower-tier Anthropic plans.
Check your Anthropic account usage limits and confirm `ANTHROPIC_API_KEY` is valid. Long-running writebacks can hit rate limits on lower-tier Anthropic plans.

**The agent surfaces a `GitHub App is not installed` or `GitLab App is not installed` error.**
Install the Lightdash GitHub App on the repository (from the project's dbt connection settings) or connect the Lightdash GitLab App for your organization, then ask the agent to try again.
Loading