# Environment and precedence

Source: https://usecns.dev/engram-topic-environment-and-precedence/

[Start here](https://usecns.dev/manual-engram/)
[CLI commands](https://usecns.dev/commands-engram/)
[Configuration & integration](https://usecns.dev/engram-topics/)

These are the 14 names directly read by the CLI/core/MCP implementation. Blank handling differs by setting: use an unset variable, not an empty string, to request defaults. Never print token/secret values in diagnostics or examples.

| Names | Selection and boundary |
| --- | --- |
| `ENGRAM_OTE_PATH`, `ENGRAM_DB_PATH` | Flags win, then nonempty environment, then discovery/defaults as [above](https://usecns.dev/engram-topic-configure-workspaces-and-mounted-scopes/). |
| `ENGRAM_KNOWLEDGE_DIR` | After `--knowledge-dir` / `--vault-path`; selects local hydration before any hub URL. Unset it deliberately for remote hydration. |
| `ENGRAM_HUB_URL`, `ENGRAM_HUB_TOKEN` | Sync push/pull/remote hydration use flags first, then environment; conformance uses only its explicit `--token`. Bearer authorizes exchange, not evidence. |
| `ENGRAM_RIG_SECRET`, `ENGRAM_SEAT_TOKEN` | Nonblank secret enables HMAC seat capability checks for record/distill/complete/outcome MCP mutations; sleep, probe and transcript import check separately with optional CLI `--seat-token`. Argument `seat_token` wins over token environment in MCP; CLI record forwards it, distill/complete/ordinary outcome do not. `sign-seat --secret` wins over secret environment. Not an SSH attestation or general authorization layer for every CLI verb. |
| `ENGRAM_EMBEDDING_ENDPOINT`, `ENGRAM_EMBEDDING_MODEL` | Nonempty environment overrides OTE embedding endpoint/model. Does not enable the remote provider by itself. |
| `ENGRAM_RERANKER_ENDPOINT`, `ENGRAM_RERANKER_MODEL` | Nonempty environment overrides OTE reranker endpoint/model; enablement/provider are still required. |
| `THALAMUS_URL` | Last endpoint fallback after specific environment and OTE; append `/v1/embeddings` or `/v1/rerank`. Supplies no model default. |
| `CNS_VITALS_PATH`, `CNS_HOOK_NONCE` | Optional append-only diagnostic destination and correlation nonce. Errors/recoveries can include content-bearing messages and store identity; authorize the destination. They do not change fail-open exit policy. |

Platform TLS `SSL_CERT_FILE` / `SSL_CERT_DIR` are not Engram configuration fields; see [transport security](https://usecns.dev/engram-topic-replicate-facts-and-check-conformance/). Remote embedding/reranking and failed-command diagnostic retrieval may transmit corpus/query/error material, not only identifiers.