Skip to content
securemyagent

Articles

Secure a Cursor agent

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

Plain Markdown for agents: /articles/secure-cursor.md

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:

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

Audit MCP servers

Global and per-project configs:

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.
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.

Secrets

sma fix --vault

Heartbeat

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.