> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formation.texturehq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> What is configured by environment variables, what an owner sets during instance setup, and what belongs to each agent.

Formation has three levels of configuration. Each setting lives at exactly one of
them, and the level decides who can change it and how.

| Level | Where it is set | Who changes it | Examples |
| - | - | - | - |
| **Process** | Environment variables on the Formation container | Whoever deploys the service | `DATABASE_URL`, `PUBLIC_URL`, `MESH_AGENT_MASTER_KEY`, `MESH_ENV` |
| **Instance** | [Instance setup](https://docs.formation.texturehq.com/instance-onboarding.md) and **Settings**, or the [operator API](https://docs.formation.texturehq.com/operator-api.md) | Owners | AI inference provider, Temporal connection, sandbox backends, web providers, tool registry, memory, operators |
| **Agent** | The agent's pages in the dashboard, or the operator API | Owners and the agent's operators | Name and profile, models, connectors, tools and accounts, vault secrets, schedules |

Agents never read environment variables. There is no `SLACK_BOT_TOKEN` or
per-agent key in the environment: agents, their connectors and their credentials
are created at runtime and stored encrypted in PostgreSQL. Zero agents is the
normal first-boot state.

## Process settings

These have to exist before the process can start, or they describe the process
itself, so they can only come from the environment:

* `DATABASE_URL`: the PostgreSQL connection.
* `PUBLIC_URL`: the externally reachable HTTPS base URL (see
  [below](#features-that-need-a-public-url)).
* `MESH_AGENT_MASTER_KEY`: the key that decrypts stored credentials. It must
  never be stored in the database.
* `HTTP_ADDR`, `MESH_ENV`, `MESH_AUTO_MIGRATE`, `MESH_TIMEZONE`,
  `MESH_TRUSTED_PROXIES`, external sign-in (`MESH_AUTH_*`), telemetry (`OTEL_*`)
  and error tracking (`MESH_ERROR_TRACKER*`).

The [installation guide](https://docs.formation.texturehq.com/operations/installation.md#environment-variables) lists
every variable with its default.

## Services a deployment can supply

Five shared services can come from either level. A deployment can supply them
through environment variables (or, for a hosting control plane, through the
management API), or an owner can enter their own during instance setup or
later in **Settings**:

| Service | Supplied by the deployment with | Or set by an owner in | Which wins |
| - | - | - | - |
| AI inference | A key a control plane installs through the [management API](https://docs.formation.texturehq.com/operator-api.md#ai-inference-supplied-by-this-deployment). `OPENROUTER_API_KEY` is only a legacy fallback. | Setup step **AI inference**, **Settings → Models** | The owner's saved provider. A supplied key is kept so the owner can switch back. |
| Temporal | `MESH_TEMPORAL_*` | Setup step **Temporal**, **Settings → Temporal** | The connection selected in settings. The variables are adopted only while nothing is selected. |
| Execution | `MESH_EXECUTION_BROKER_*`, `MESH_MODAL_*` or `MESH_FLY_*` | Setup step **Execution**, **Settings → Agent runtimes** | Environment credentials, shown read-only. Owners can still enable other environments and choose the default. |
| Web and browser | `MESH_WEB_BROKER_*` or `MESH_CLOUDFLARE_*` | Setup step **Web & browser**, **Settings → Web access** | An owner's own account, per capability. The deployment account is the fallback. |
| Blob store | `FORMATION_BLOB_S3_*` or `FORMATION_BLOB_BROKER_*` | | The environment. There is no owner setting. |
| Tool registry | `MESH_MCP_REGISTRY_URL`, `MESH_TOOL_DISCOVERY_ENABLED` | **Settings → Tool discovery** | The environment. Setting either variable makes the section read-only. |

During instance setup, every service the deployment already supplies is folded
into one **Provided by this deployment** step, so a fully managed instance goes
straight to creating its first agent. Each supplied service has a **Use my own**
link that switches it to the owner's account. A self-hosted instance with none of
these variables walks through each step. See [Instance setup](https://docs.formation.texturehq.com/instance-onboarding.md).

Settings sections that the environment can supply report which source is in
effect: `environment`, `database` (saved by an owner), or unset. Error tracking
and telemetry variables also always win over **Settings → Observability**.

A setting the environment controls is shown read-only, and the API refuses to
save a value that would be ignored.

## Agent settings

Everything about an agent belongs to the agent: identity and profile, which
models it uses, which conversations it joins, which tools and accounts it holds,
its vault, schedules, memory and dreaming. An agent inherits the instance's
inference, execution and web infrastructure unless it is given its own. Website
accounts, cookies, OAuth grants and service credentials are always the agent's
own and are never shared with another agent.

The dashboard is for configuration. Day-to-day work happens in conversation: an
agent asks for what it needs in plain language (a secret through a
[vault link](https://docs.formation.texturehq.com/runtime/agent-vault.md), a drawing through a [sketch](https://docs.formation.texturehq.com/runtime/sketches.md),
a decision through your application), and improves itself between conversations
through [dreaming](https://docs.formation.texturehq.com/runtime/dreaming.md) without anyone reviewing its output.

## Features that need a public URL

`PUBLIC_URL` is required at boot. It is the address Formation puts in every link
and callback it hands out, so it only works if the people and services involved
can reach it. These features depend on that:

| Feature | Who must reach `PUBLIC_URL` |
| - | - |
| Slack, Microsoft Teams, Telegram and SMS webhooks | The messaging platform. Discord is the exception: it uses outbound Gateway connections and needs no inbound URL. |
| [Webhooks](https://docs.formation.texturehq.com/connectors/generic.md) and [application streaming](https://docs.formation.texturehq.com/connectors/application-streaming.md) | Your application's servers |
| OAuth sign-in for [MCP servers](https://docs.formation.texturehq.com/runtime/remote-mcp.md) and [account linking](https://docs.formation.texturehq.com/runtime/account-linking.md) | The person's browser, returning from the provider |
| [Vault](https://docs.formation.texturehq.com/runtime/agent-vault.md) one-time secret links | The person the agent sends the link to |
| [Sketches](https://docs.formation.texturehq.com/runtime/sketches.md) | The person the agent sends the link to |

When a host provides your instance, its public URL is already set and reachable.
When you host it yourself, put the instance behind a reverse proxy or platform
that terminates TLS, set `PUBLIC_URL` to that origin, and make sure the people who
will receive vault and sketch links can open it. A URL that only works inside
your office network works only for people inside it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.