# Secure a Cursor agent

Register Cursor with SMA, audit mcp.json, turn off blind auto-run, and add the heartbeat.

Cursor agents run terminal commands and MCP tools in your project. A poisoned tool description can read `.env` (CVE-2026-75130).

## Register and check

Open the Cursor terminal:

```bash
npx -y securemyagent register --name my-cursor
npx -y securemyagent checkup --upload
```

## Audit MCP servers

Global and per-project configs:

```bash
cat ~/.cursor/mcp.json
cat .cursor/mcp.json 2>/dev/null
```

For each entry:

- Pin an exact version. Replace `@latest`.
- Move keys out of `env`. A key in `mcp.json` is a plaintext secret.
- Delete servers you do not use.

```bash
grep -nE "sk-|ghp_|AKIA|Bearer " ~/.cursor/mcp.json .cursor/mcp.json 2>/dev/null | sed -E 's/(sk-|ghp_|AKIA).{4,}/\1…redacted/'
```

## Approvals

In Cursor Settings, turn off auto-run for terminal commands, or keep a short allowlist. Require approval for MCP tool calls.

Details: [fix tool scope](https://securemyagent.ai/articles/fix-tool-scope).

## Secrets

```bash
sma fix --vault
```

## Heartbeat

```bash
curl -sS -X POST https://api.securemyagent.ai/v1/heartbeat -H "Authorization: Bearer $SMA_API_KEY"
```

Every 4 to 24 hours. Cursor does not run in the background when closed, so use cron or launchd on the machine.

## Sources

- [OpenCVE CVE-2026-75130 (Context7)](https://app.opencve.io/cve/CVE-2026-75130)
- [OWASP MCP Top 10](https://owasp.org/projects/mcp-top-10)
