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

# Self-hosting overview — the Naive region

> What a Naive region is, the open/closed line (plumbing is open; anything that decides or holds keys is closed), and the cloud → Tower driver map that lets the same code run on your hardware.

A **region** is the whole of Naive running on hardware you control: the same
primitives, the same API, the same governance — just pointed at local substrates
instead of AWS. The shippable artifact is a **Tower**: a bootable golden image
that comes up as a configured, self-governing region.

The design goal is that the cloud codebase and the Tower codebase are the *same*
codebase. The parts that differ are swapped behind **driver interfaces**
(`@usenaive/region-core`), so no service imports a provider SDK directly and the
cloud code paths port without behavior change.

## The open / closed line

Naive is open-core. The line is drawn on a single question: **does this
component decide, or does it hold keys?**

<CardGroup cols={2}>
  <Card title="Open (Apache-2.0) — plumbing" icon="box-open">
    The parts that carry data and calls but never make the trust decision:

    * the **region API** surface and its request handling
    * the **driver substrate** (secrets/queue/inference/storage/runtime) and every
      driver implementation
    * the **SDK, CLI, and IaC** clients
    * the **panel** (operator/owner UI)
    * the **data model** — schema and migrations

    These are readable, forkable, and swappable.
  </Card>

  <Card title="Closed (proprietary) — decides or holds keys" icon="lock">
    The parts whose integrity is the product:

    * the **governor** — the enforcement engine. Every gated action is a wire call
      to it; it returns `allow | deny | freeze` and it owns replay + budget.
    * **vaultd** — the TPM-rooted secrets daemon. It holds the root key and derives
      per-tenant KEKs; plaintext never leaves it.
    * the **egress-gateway** — the single egress-capable process on a Tower. It
      asks the governor before any real call and injects credentials only where it
      terminates a provider connection.
  </Card>
</CardGroup>

<Note>
  Enforcement lives in the **closed engine**, never in the open plumbing. The
  region API is a thin client: on a gated action it calls the governor and does
  what the verdict says. Stop the governor and the region is inert — gated
  actions return `403 enforcement_unavailable`. See
  [Security model](/docs/self-hosting/security-model) and
  [Open core](/docs/architecture/open-core).
</Note>

## The cloud → Tower driver map

Each substrate is chosen by a `NAIVE_*_DRIVER` env var (documented in full on
the [Drivers](/docs/self-hosting/drivers) page). Cloud defaults are the existing
production config; `NAIVE_BUILD=tower` flips the defaults to the on-box set.

| Substrate       | Cloud default     | Tower default                    | Selector                 |
| :-------------- | :---------------- | :------------------------------- | :----------------------- |
| Secrets / vault | `kms` (AWS KMS)   | `vaultd` (TPM-rooted daemon)     | `NAIVE_SECRETS_DRIVER`   |
| Queue           | `sqs`             | `pg` (Postgres, pgmq semantics)  | `NAIVE_QUEUE_DRIVER`     |
| Inference       | `openrouter`      | `auto` (local vLLM ↦ OpenRouter) | `NAIVE_INFERENCE_DRIVER` |
| Object storage  | `s3`              | `fs` (HMAC-signed local files)   | `NAIVE_STORAGE_DRIVER`   |
| Runtime pool    | `ecs` (warm pool) | `local` (compose instances)      | `NAIVE_RUNTIME_DRIVER`   |

The runtime pool is a selectable driver like any other: cloud uses the ECS warm
pool, a Tower uses `local`. `secrets` also has a keyless `file` driver for
compose/CI development (no TPM).

## Where to go next

<CardGroup cols={2}>
  <Card title="Drivers" icon="plug" href="/docs/self-hosting/drivers">
    Every `NAIVE_*_DRIVER` value, defaults, parity notes, the GovernorClient
    contract, and how to write your own driver.
  </Card>

  <Card title="Security model" icon="shield-halved" href="/docs/self-hosting/security-model">
    The compose topology, the four load-bearing assertions, vaultd internals, and
    the egress gateway's paths and limits.
  </Card>

  <Card title="Conformance" icon="clipboard-check" href="/docs/self-hosting/conformance">
    The capability-tagged suite, KEYS.md gating, the two legs, and the two-tier CI.
  </Card>

  <Card title="Quickstart (compose)" icon="rocket" href="/docs/self-hosting/quickstart-compose">
    Run a full region on one Linux box in \~10 minutes.
  </Card>
</CardGroup>
