> ## 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 Cursor with Formal

> Apply process-aware rules to Cursor desktop, Cursor CLI, and cloud agents.

The Endpoint recognizes Cursor and its CLI on macOS and Linux.

## Use cases

| Use case | Guide |
| - | - |
| Block Git pushes from Cursor agents | [Block Agent Git Pushes](https://docs.formal.ai/docs/guides/example-use-cases/block-agent-git-pushes.md) |
| Stop Cursor Cloud Agents from merging PRs | [Prevent Cloud-Agent Auto-Merges](https://docs.formal.ai/docs/guides/example-use-cases/formal-endpoint-cloud-agents.md) |
| 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 |
| - | - |
| Cursor desktop and CLI | `process.is_cursor` |
| Browser and other clients | Hostname `cursor.sh` |
| Cloud agents | The Endpoint installed in the agent environment |
| 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 Cursor's LLM 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_cursor || hostname == "cursor.sh" ||
      hostname.endsWith(".cursor.sh"),
    "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 Cursor, 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.