Skip to content

Guide

How to make Cursor’s agent safe around production

Short answer: Never give the agent production credentials it doesn’t need, keep auto-run on an allowlist, and add a hook that blocks destructive commands before they run. Antelog adds that hook to Cursor with one command.

The risk

Cursor’s agent can run terminal commands and call tools. If your laptop can reach production, so can the agent. A delete command or an API call with a valid token is enough to remove a database and its backups.

1. Keep production keys away from the agent

  • Use a separate, read-only database user for local work.
  • Don’t keep production tokens in files inside the project folder.
  • Store backups somewhere the same token can’t delete.

2. Use the auto-run allowlist

In Cursor’s settings, set auto-run to an allowlist so only commands you trust run without asking. Cursor’s own docs say the allowlist is best effort, not a security boundary, so treat it as one layer, not the whole answer.

3. Add a hook that blocks dangerous commands

Cursor runs hooks before shell commands and tool calls. A hook can refuse a command before it runs, whatever the auto-run setting is.

Antelog is a ready-made hook. After installing, run antelog setup cursor. It blocks wiping databases and backups, deleting cloud resources, deleting your code, and leaking secrets, and lets everything else run.

Install Antelog

Free for developers. On macOS and Linux:

$ curl -fsSL https://antelog.dev/install.sh | sh

Windows and other tools: see the docs.

More guides