---
title: Run weft in production
description: 'What changes between development and production for a weft service: named destinations and a content policy, a hosted Studio behind tokens, retention, a durable database and session store, known limits, and an ordered shutdown.'
url: https://weftgo.dev/docs/production/
type: concept
sources:
  - 'weft/otel/options.go:104-123 (DevMode), 169-198 (DevDetail, dev-gated); weft/otel/pipeline.go:241-311, 931-960 (the gate, its WARNs and the DevMode INFO lines); weft/obsdb/request.go:93, 149, 167-168 (the gap and raw_off fixes name otel.DevMode()); weft/CHANGELOG.md:124 (0.19.0: DevMode), 35 (0.20.0: DevDetail)'
  - weft/AGENTS.md:195-214 (block 6, the zero-config local sink and discovery), 204-218 and 343-352 (block 7, setups and tokens), 513-530 (block 9, destinations and content)
  - weft/studio/README.md:11-25 (setup A), 57-91 (setup B), 155-203 (setup C), 238-270 (Retention)
  - weft/otel/config.go:90-99 (content on for Local and Studio only)
  - weft/otel/pipeline.go:218-312 (RawBodies and Blocking refused outside WEFT_ENV=dev), 212-229 and 286-324 (the local sink only when no destination is configured)
  - weft/otel/env.go:158-182 (the discovery file's Studio); otel/config.go:159-164 (the default local path)
  - weft/AGENTS.md:450-453 (weft dev sets WEFT_STUDIO_URL and WEFT_STUDIO_TOKEN for its app)
  - weft/runtime/options.go:252, 289 (Enabled; WEFT_ENV=dev opens the link)
  - weft/studio/delete.go:112-139 (Retain off by default)
  - weft/core/env.go:1-20 (WEFT_MODEL_REQUESTS=deny)
---

# Run weft in production

In development weft needs no configuration. With no Studio running and no destination in the environment, `otel.Install()` writes the local sink (`$WEFT_DB`, else `./.weft/weft.db`). With `weft dev` or `weft studio` running on loopback behind its dev token, the app exports to that Studio instead: `weft dev` passes its own app `WEFT_STUDIO_URL` and `WEFT_STUDIO_TOKEN`, and any other app finds a running Studio through its discovery file. In production you name each of those choices: which destinations receive records and with what content, a Studio behind tokens, how long runs are kept, which database holds them, where sessions live, and the order the service shuts down in.

| In development | In production |
|---|---|
| `otel.Install()`: the local sink, or instead whatever the environment or a running Studio's discovery file adds | named destinations, content off for third parties, a `Redact` for the rest |
| `weft studio` on loopback, the dev token | `studio.New` behind `studio.Token` and `studio.IngestToken` (setup C) |
| runs kept forever | `studio.Retain(d)` or `weft vacuum --retain d` |
| SQLite in `./.weft` | SQLite on a volume, or ClickHouse for a fleet |
| `thread.Memory()` | `thread/jsonl` or `thread/sqlite`, one writer per session |
| `WEFT_ENV=dev`: lets `otel.RawBodies`, `otel.DevDetail` and `otel.Blocking` take effect and `runtime.Install` open its link | `WEFT_ENV` unset, and no `otel.DevMode()` in the binary |
| real model calls | `WEFT_MODEL_REQUESTS=deny` in CI |

## Pages in this section

- [Deploy an agent service with a hosted Studio](https://weftgo.dev/docs/production/deploying/): the pieces of a deployment, setup C, exporting with an ingest token, and an ordered shutdown.
- [Secure Studio: tokens, loopback and origins](https://weftgo.dev/docs/production/security/): what guards the API in each setup, panel tokens, the live grant.
- [Control what content leaves the process](https://weftgo.dev/docs/production/content-and-privacy/): content per destination, redaction, caps, the agent veto, raw bodies in development only.
- [Keep and delete recorded runs](https://weftgo.dev/docs/production/retention/): `Retain`, deleting a run or a session, `weft vacuum`.
- [Choose the observability database: SQLite or ClickHouse](https://weftgo.dev/docs/production/storage-backends/): the two obsdb backends, migrations and TTLs.
- [Limits and performance](https://weftgo.dev/docs/production/limits/): the caps, budgets, queues and timeouts, and what happens when one is hit.
- [Operate Studio: logs, restarts and the runtime link](https://weftgo.dev/docs/production/studio-operations/): what Studio logs and what survives a restart.
- [Upgrade weft](https://weftgo.dev/docs/production/upgrading/): breaking changes by version and the pre-1.0 stability policy.

Sessions have their own operations page: [Operate sessions in production](https://weftgo.dev/docs/sessions/operations/).
