Skip to main content

Overview

The LLM Gateway puts Formal in the path of traffic to LLM providers such as api.anthropic.com and chatgpt.com. Formal logs each request and response, evaluates your , and forwards the request to the provider. Formal can proxy LLM traffic in two places.

What Formal captures

  • Model and provider for each request
  • Messages: the full prompt and completion text
  • Tool calls, with names, arguments, and results
  • Token usage: prompt, completion, and total tokens
Streaming responses are reassembled before logging. To encrypt or drop LLM content in logs, create a log schema.

What you can enforce

Policies run on LLM traffic at the session, request, and response stages.

Get started

1

Create an LLM resource

Add one resource per provider API. See Creating LLM Resources.
2

Route traffic

On devices, enable Transparent Mode and add a network rule for llm traffic. For applications, point them at a Connector. See Connecting.
3

Verify

Send a prompt from an AI harness. Open Logs and filter on resource.technology:llm.

Govern AI Harnesses

Formal recognizes these harnesses by their signed process identity, so rules and policies can target each one. A network rule with process.is_agent covers every harness in this table at once. See Write Network Rules.

Next Steps

Monitor AI Usage

Chart clients, models, and providers

Insights

Triage AI-generated findings about LLM traffic

Seal Claude Code OAuth tokens

Keep provider tokens encrypted on the device

MCP Gateway

Govern the tools those models call