Harness Notes

Permissions

Updated 2026-11-25,

On this page

How to stop an agent doing something, and what each harness gives you to control it. Permission rules decide what the agent may do; a sandbox limits what a command can reach even when it is allowed.

Block a command, for example git push

Cursor Agent
How

A deny rule in the permission settings

File.cursor/cli.json
Example
{
  "permissions": {
    "deny": [
      "Shell(git:push*)"
    ]
  }
}
How it matches

Shell(commandBase) with an optional command:args glob; exact argument-string behavior is not fully documented

What wins

deny takes precedence over allow and survives --force/--yolo

Watch out for

Matching details are only partly documented.

Shell(git) is the unambiguous declarative form but blocks every git command.

For exact git-push matching, use a beforeShellExecution hook that returns permission deny or exits 2; other non-zero hook exits fail open.

What you can control

Cursor Agent
Decisions

allow, ask, deny

Permission rules

Built in

Cover: shell, read, write, web fetch, MCP

Match by: permission tokens with patterns

Docs
Sandbox

Not established

Approval prompts

Not established

Skills granting tools

Not established

Hooks that decide

Built in

preToolUse, beforeShellExecution, beforeMCPExecution, beforeReadFile

Can: allow, deny, ask

Hook permission decisions are a separate surface from CLI permission files.

ask is not enforced for preToolUse.

Docs
Where rules live
  • <project>/.cursor/cli.json, project
  • ~/.cursor/cli-config.json, user

Project settings override global ones.

Sources

Cursor Agent