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

# Govern Claude with Formal

> Route Claude traffic through Formal and apply process-aware policies.

The Endpoint recognizes Claude Desktop and Claude Code on macOS and Linux.

## Use cases

| Use case | Guide |
| - | - |
| Allow only your company's Anthropic organization | [Restrict Anthropic Sign-Ins](https://docs.formal.ai/docs/guides/example-use-cases/restrict-anthropic-sign-ins.md) |
| Block Claude Code in YOLO mode | [YOLO-mode policy](https://docs.formal.ai/docs/guides/policies/evaluation.md#example-block-claude-code-in-yolo-mode) |
| See which models and MCP servers people use | [AI Usage](https://docs.formal.ai/docs/guides/ai-governance/usage.md) |
| Block MCP servers and skills outside your Catalog | [Guardrails](https://docs.formal.ai/docs/guides/ai-governance/guardrails.md) |
| Cap token spend per user | [LLM Spend](https://docs.formal.ai/docs/guides/ai-governance/spend.md) |
| Redact SSNs from prompts | [Mask PII](https://docs.formal.ai/docs/guides/policies/mask-pii.md#4-redact-ssns-from-llm-requests) |

## What Formal sees

| Surface | Detected by |
| - | - |
| Claude Desktop | `process.is_claude_desktop` |
| Claude Code | `process.is_claude_cli` |
| Claude web and API | Hostnames `claude.ai` and `anthropic.com` |
| Apps and SDKs | An [LLM resource](https://docs.formal.ai/docs/guides/core-concepts/resources/llm.md) on a Connector |
| Remote MCP tools | [MCP Gateway](https://docs.formal.ai/docs/guides/core-concepts/connectors/mcp-gateway.md) |

## 1. Add a network rule

Create this [Network Rule](https://app.formal.ai/network-rules) to inspect Claude Desktop, Claude Code, and Claude web traffic, and set it to **Active**:

```cel theme={"languages":{"custom":["/languages/cel.json","/languages/rego.json"]}}
{
  "condition": {
    "pre_tcp": port == 443,
    "pre_tls": process.is_claude_cli || process.is_claude_desktop ||
      hostname == "claude.ai" || hostname.endsWith(".claude.ai") ||
      hostname == "anthropic.com" || hostname.endsWith(".anthropic.com"),
    "post_tls": technology == "llm"
  }
}
```

## 2. Check the logs

Enable [Transparent Mode](https://docs.formal.ai/docs/guides/client-apps/desktop-app.md#transparent-mode), send a prompt in Claude, then search [Logs](https://app.formal.ai/logs):

```text theme={"languages":{"custom":["/languages/cel.json","/languages/rego.json"]}}
source:desktop AND resource.technology:llm
```


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