PTS security notes / Guides

A 10-minute AI coding agent permissions audit

By PTS · Published 2026-12-03 · Updated 2026-12-03 · Docs checked December 3, 2026

Once you have mapped what your coding agent can reach, spend ten minutes on the settings that are supposed to hold it back. This audit is a pass over Claude Code, Codex and Cursor, using only checks you can do on your machine and confirm in official docs.

Setting names were checked on December 3, 2026. Tools change fast. If a key does not match your version, trust the vendor docs over this page.

You will need the folder where you start the agent, and the settings files for each tool you actually use. Skip any tool you do not have. For the inventory that lists accounts and env names, use the 15-minute inventory.

1. Confirm where settings live

Write down which of those files exist. A missing file means you are on defaults, not on a locked-down profile.

2. Claude Code: five settings to read out loud

Open the project or user settings.json and check:

  1. permissions.deny includes your secret files (.env, .env.*, key directories) and the destructive commands you refuse to let an agent run. Remember the documented limit: deny rules are not a complete block, and a Bash(curl *) rule does not match /usr/bin/curl or sh -c 'curl …' (settings reference).
  2. permissions.ask covers git push, cloud CLIs, kubectl, terraform apply, npm publish and other actions you want to see first.
  3. permissions.disableBypassPermissionsMode is set to "disable" if you want bypass-permissions mode blocked, including the --dangerously-skip-permissions flag.
  4. sandbox.enabled is true. The sandbox is off by default. If you need the session to fail closed when the sandbox cannot start, also set sandbox.failIfUnavailable to true.
  5. sandbox.filesystem.denyRead includes credential paths. With the sandbox on, reads still include ~/.ssh and ~/.aws/credentials unless you deny them (sandboxing).

Also scan .claude/settings.local.json. That is where "don't ask again" approvals are saved (permissions). Make sure it is gitignored, and remove any approval you do not remember giving.

3. Codex: sandbox, approval and the retired setting

Open ~/.codex/config.toml and check:

  1. sandbox_mode is read-only or workspace-write, not danger-full-access (sandboxing).
  2. approval_policy is on-request for interactive work, not never, unless you are in a throwaway environment.
  3. If you use workspace-write, confirm [sandbox_workspace_write] has network_access = false unless you have a clear reason to open it.
  4. Search the file for approval_policy = "untrusted". That value is retired and can prevent Codex from starting. Remove it (agent approvals and security).
  5. List every [mcp_servers.*] entry. For each one, write down the account or token scope it can reach.

A starter config is in the open-source starter repo.

4. Cursor: ignore file, terminal and MCP

  1. Confirm .cursorignore exists if you have secrets that are not already covered by .gitignore or by Cursor's default list (which includes .env*).
  2. Read the ignore patterns. Cursor blocks Agent, Tab and @ mentions for those paths. It does not block the terminal or MCP tools (ignore file).
  3. Check your MCP config and write down each server's scope, the same way you would for Codex or Claude Code.
  4. Keep terminal command approval on unless you are in a disposable workspace. Cursor's agent security docs describe run modes as best-effort guardrails, not a hard security boundary, and note that workspace trust is disabled by default.

If a secret has to stay in the repo folder, ignore files are not enough. Use filesystem permissions, a secrets manager, or a dedicated environment that never sees production credentials.

5. A 60-second live check

In a non-production copy of the project:

If any of those fail open, fix the settings before you go back to a project that holds real keys. More detail on the controls themselves is in How to stop your AI coding agent reading .env and secrets.

6. Put a reminder on the calendar

Rerun this audit when you add an agent, an MCP server or a cloud account, and once a month otherwise. The blast radius changes when the logged-in accounts change, even if the settings file does not.

Get the worksheet

PTS publishes a free Agent Blast Radius Checklist with a 9-page worksheet and the starter files. Download it on Gumroad. This site has no forms and does not collect email.

This article was drafted with an AI assistant (Grox) and reviewed and published under the PTS name. It is educational, not legal advice. Test any change on a non-production project first. PTS is not affiliated with Anthropic, OpenAI or Cursor.

Get the free checklist

A 9-page worksheet plus starter files for Claude Code and Codex. Download it on Gumroad. This site does not collect email.

Get the free checklist

Keep reading