What can your coding agent actually read? A 15-minute inventory for Claude Code and Codex
Originally published on agents.paxtechnologyservices.com. I'm PTS, an IT and security consulting shop. Corrections welcome in the comments. Your coding agent can do whatever your user account can do, from the folder you
Originally published on agents.paxtechnologyservices.com. I'm PTS, an IT and security consulting shop. Corrections welcome in the comments.
Your coding agent can do whatever your user account can do, from the folder you start it in. That is the whole risk in one sentence. If your terminal can read your cloud keys, push to main or drop a production table, so can an agent running in that terminal.
None of this means "don't use agents." It means deciding, on purpose, what the agent can touch. This takes about 15 minutes to map and 30 to fix. The same idea applies whether you use Claude Code, Codex or Cursor.
Why bother
Three public reminders:
- Researchers audited 200 publicly deployed apps built with Claude Code and Lovable. 91% had at least one vulnerability (arXiv 2606.23130).
- Apiiro found more than 100,000 Claude Code
.claude/settings.local.jsonfiles in public GitHub repos. About 1,100 of them held secrets such as API tokens and database passwords, as reported by Ars Technica on Nov 9, 2026. - One developer reported an agent running
drizzle-kit push --forceagainst their production database and wiping its tables (anthropics/claude-code issue 27063).
Step 1: Map what it can reach
Run these in the same terminal and folder where you start your agent. They print names and identities only. Do not paste secret values into an AI chat, a ticket or a worksheet.
Who is the agent running as?
whoami
pwd
Which secrets sit in environment variables? Names only.
env | cut -d= -f1 | grep -iE 'key|token|secret|pass|auth|database_url|dsn'
Which cloud and code accounts are logged in? Skip any tool you do not have.
aws sts get-caller-identity
gcloud auth list
az account show --query user
gh auth status
kubectl config current-context
Which key files exist, and what variable names are in your .env?
ls -a ~/.ssh ~/.aws ~/.kube ~/.config/gcloud 2>/dev/null
ls -a | grep -E '^\.env'
grep -oE '^[A-Za-z_][A-Za-z0-9_]*' .env
Write down each account and role you find. A logged-in admin role is a big blast radius. Also list your MCP servers: run /mcp in a Claude Code session, look for [mcp_servers.*] in ~/.codex/config.toml, or open .cursor/mcp.json. A longer pass over those servers is in the MCP server security checklist.
A ready-to-run version of this inventory, which prints names only, is in the open-source starter repo.
Step 2: Keep settings files out of git
The leaked files above are local settings files that ended up in public repos. Claude Code saves some "don't ask again" approvals to .claude/settings.local.json at the repository root (Claude Code permissions). Add this to your .gitignore today:
.claude/settings.local.json
.env
.env.*
!.env.example
Step 3: Set a safe default
For Claude Code, the project file .claude/settings.json can deny reads of key files and dangerous commands, ask before risky ones, turn the sandbox on, and disable bypass-permissions mode. Anthropic's own docs say deny rules are not a complete block: they apply to built-in file tools and to some Bash commands such as cat .env, but not to a script that opens files itself, or to a command that reads files without naming them, such as grep -r pattern .. For OS-level enforcement, enable the sandbox (permissions, settings reference, sandboxing).
The sandbox is off by default. Even when it is on, sandboxed commands can still read most of the machine by default, including credential files such as ~/.ssh and ~/.aws/credentials, unless you add filesystem.denyRead. The sandbox also wraps shell commands only. Built-in file tools, MCP servers and hooks run outside it.
A starter settings file is in the open-source starter repo. For a closer look at deny lists, ignore files and what they miss, see How to stop your AI coding agent reading .env and secrets.
For Codex, a cautious start in ~/.codex/config.toml is a workspace-write sandbox, approval on request and network access off:
sandbox_mode = "workspace-write"
approval_policy = "on-request"
[sandbox_workspace_write]
network_access = false
Codex no longer supports approval_policy = "untrusted". If an older config still has that value, remove it or the client may fail to start (Codex config basics, agent approvals and security).
If you use Cursor, add a .cursorignore for secrets, and remember that the terminal and MCP tools are not blocked by that file. Details are in the permissions audit and in Cursor's ignore file docs.
A deny list is a seatbelt, not a wall. The sandbox is what stops a process from reaching outside its box, so use both. Skip-all-prompts modes belong only inside a throwaway container or VM that holds no production credentials.
Step 4: Rerun it monthly
Rerun the inventory whenever you add a new agent, an MCP server or a cloud account. Everything on the list should be something you recognize, with a token scoped to what it needs. A 10-minute pass over the settings themselves is in A 10-minute AI coding agent permissions audit.
Setting names in this article were checked against official Claude Code, Codex and Cursor docs on December 3, 2026. Tools change fast, so check your version.
Want the checklist?
PTS wrote a free 9-page checklist with a worksheet and the starter files: Agent Blast Radius Checklist on Gumroad.
If you want the free script and starter configs, the repo is here: https://github.com/paxtechnologyservices/agent-blast-radius . More guides: https://agents.paxtechnologyservices.com/guides/
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.