{/* T46：示意图是首屏最重的资源（2128×712 PNG，≈273 KB）。改为显式 <img>（markdown 语法不能带属性）：
    声明固有宽高（配合 Starlight 的 `height:auto` 避免 CLS/变形）、`decoding="async"`，
    并用 `fetchpriority="low"` 让它排在渲染关键资源之后（实测 docs 页 LCP 3307ms → ≈1813ms）。
    不 lazy：该图在移动视口内出现过 LCP 候选，lazy 加载 LCP 候选图是反模式（Lighthouse lcp-lazy-loaded）。 */}
<img src="/docs-assets/how-it-works.png" alt="Requests flow from a client into the local tokenhush gateway, which redacts outbound request bodies before they reach the upstream provider and restores them on the way back." width="2128" height="712" decoding="async" fetchpriority="low" />

tokenhush is a local, loopback-only gateway that sits between your AI tools and
their providers. It redacts request bodies on the way out and restores them on
the way back, so credentials and other sensitive values never leave your machine
in the clear. These pages are the open-source documentation that ships with the
core repository.

## Getting started

Install a tool, prove redaction locally, then run tokenhush as a service.

- [Tool setup and request routing](/docs/tool-setup/) — point any OpenAI-compatible or Anthropic client at the loopback gateway, with per-tool settings and the config reference.
- [Verify redaction with a local echo upstream](/docs/verify/) — prove the full round trip without contacting a real provider.
- [Deployment, install, and platforms](/docs/deployment/) — build or install the binary, and learn where it keeps config and data.
- [Configuration reference](/docs/configuration/) — the strict `tokenhush.yaml` schema: every key, its default, and upstream routing.

## Concepts

How the core is put together and how to extend it.

- [Architecture: layers and rule abstraction](/docs/architecture/) — the layering graph, the single rule abstraction, and the frozen byte surfaces.
- [Plugins and the Rule extension point](/docs/plugins/) — the one compile-time extension point and the constraints on signed rule packs.

## Security

The invariants tokenhush keeps and everything it can send off-box.

- [Security model and invariants](/docs/security/) — the eight invariants, the nine residual risks, and the tests that pin them.
- [Network egress disclosure](/docs/network-egress/) — every vendor-bound request tokenhush can make.

## Start from install

New here? Begin with [Tool setup and request routing](/docs/tool-setup/) to
install tokenhush and point your first client at the local gateway.
