Approvals and sandbox

Approvals, sandbox and workspace trust.

Approvals

When the agent needs your OK, a card appears above the composer.

AnswerKeyDoes
RejectCmd-Shift-BackspaceRefuses the call. The agent carries on.
Allow onceCmd-Shift-EnterRuns this call.
Allow for threadCtrl-Shift-EnterStops asking about the same thing in this thread.
Allow alwaysCmd-Alt-Shift-EnterSaves the permission for every thread.

Sending a message instead of answering rejects the call.

Saved permissions

Allow always writes to agent.permissions in your user settings. You can edit the rules there:

"agent.permissions": {
  "allow": ["shell(npm test *)", "edit(src/**)", "mcp:linear/*"],
  "ask": ["shell(git push *)"],
  "deny": ["read(.env)"]
}

A rule is a tool name, optionally with a target in parentheses. Tools: read, edit, write, delete, shell, web, and mcp:<server>/<tool>. deny wins over ask, and ask over allow.

Auto mode

Sansa's review in Auto mode needs a Sansa sign-in with an active plan. Without one, edits still run and everything else asks.

Sandbox

Agent commands run in a macOS sandbox. A thread starts on a preset by folder trust:

Permissive (trusted folders)Restricted (other folders)
NetworkHosts in Hosts commands reach; others askEvery host asks
ReadsEverything except credential foldersThe project, toolchains and package caches
WritesThe project, temp folders and your home folderThe project and temp folders
  • Hosts commands reach starts with the npm, crates.io, PyPI, Go, RubyGems and Maven registries and GitHub.
  • Credential folders (~/.ssh, ~/.aws, ~/.kube, the Keychain, browser profiles and more) are closed under every preset.
  • When a command needs more, a card asks. Allow always saves the host or folder to settings.
  • The P or R icon in the thread header switches that thread's preset.

All of this is in Settings › Security. Terminal sandbox turns the sandbox off.

Safety checks

On by default, in Settings › Security › Safety checks:

  • Secret values in Private files (.env, keys, .npmrc, .netrc) are cut before the agent sees them. Credential-shaped values are also cut from what predictions and feedback send.
  • Changes to ngram's settings, rules, git hooks or git config ask.
  • Installing an MCP server asks.
  • High-impact commands always ask: sudo, force pushes, branch deletes on a remote, curl | sh, package publishing, docker push, kubectl, helm, terraform and pulumi changes, and disk tools.
  • Deleting a home, root or project folder is refused.

Turning Safety checks off turns off all of them.

Security settings are read from user settings only. A project's .ngram/settings.json can't change them.

Workspace trust

The first time you open a folder, ngram asks, for example, Allow my-app to run code? Until you allow it, the folder is Restricted, and these don't run:

  • Project settings (.ngram/settings.json)
  • Language servers
  • MCP servers the project defines
  • Commands from the project's hook rules
  • Git hooks
  • Tasks and package.json scripts
  • The project's Prettier
  • The folder's .envrc

Editing, search and the terminal work. The agent works too, on the Restricted sandbox preset.

  • Allow trusts the folder.
  • Don't Allow keeps it restricted, and ngram doesn't ask about it again.
  • Allow All Folders turns Restricted Mode off for every folder.

To change your answer, select the Restricted badge in the title bar. Settings › Security lists trusted folders. Trust a Folder… there trusts every folder inside one you pick, such as the folder you keep your projects in, including ones you add later. Trust all folders is the same switch as Allow All Folders.