<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: PTS</title>
    <description>The latest articles on DEV Community by PTS (@paxtechnologyservices).</description>
    <link>https://dev.to/paxtechnologyservices</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4281635%2F68fa0273-5800-468e-b927-5227bb76ad66.png</url>
      <title>DEV Community: PTS</title>
      <link>https://dev.to/paxtechnologyservices</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paxtechnologyservices"/>
    <language>en</language>
    <item>
      <title>Is the --dangerously-skip-permissions flag safe?</title>
      <dc:creator>PTS</dc:creator>
      <pubDate>Fri, 04 Dec 2026 02:28:59 +0000</pubDate>
      <link>https://dev.to/paxtechnologyservices/is-the-dangerously-skip-permissions-flag-safe-3co5</link>
      <guid>https://dev.to/paxtechnologyservices/is-the-dangerously-skip-permissions-flag-safe-3co5</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://agents.paxtechnologyservices.com/articles/dangerously-skip-permissions-safe.html" rel="noopener noreferrer"&gt;agents.paxtechnologyservices.com&lt;/a&gt;. I'm PTS, an IT and security consulting shop. Corrections welcome in the comments.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Short answer: not on your everyday machine. Both Anthropic and OpenAI say so in their own docs, and the reasons are specific. This guide shows what the "skip all prompts" switches turn off, what still applies, and how to cut the prompt fatigue without handing your whole account to the agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Claude Code's bypass mode does
&lt;/h2&gt;

&lt;p&gt;Claude Code has several permission modes. The most permissive is &lt;code&gt;bypassPermissions&lt;/code&gt;. Anthropic's table lists what runs without asking as "Everything" and the best use as "Isolated containers and VMs only" (&lt;a href="https://code.claude.com/docs/en/permission-modes" rel="noopener noreferrer"&gt;permission modes&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;You turn it on at launch, with &lt;code&gt;claude --permission-mode bypassPermissions&lt;/code&gt; or the older flag &lt;code&gt;--dangerously-skip-permissions&lt;/code&gt;. You cannot switch into it from a session that started without it.&lt;/p&gt;

&lt;p&gt;The docs carry a plain warning: &lt;code&gt;bypassPermissions&lt;/code&gt; "offers no protection against prompt injection or unintended actions." Prompt injection is when text the agent reads, such as a web page, an issue or a file in a repo you cloned, contains instructions the agent then follows. With prompts off, nothing stops it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What still applies in bypass mode
&lt;/h2&gt;

&lt;p&gt;Not everything is switched off. According to the same page:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deny rules still block in every mode, including &lt;code&gt;bypassPermissions&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Allow rules have no effect in this mode, because everything is already allowed.&lt;/li&gt;
&lt;li&gt;Tools matched by an explicit ask rule still prompt.&lt;/li&gt;
&lt;li&gt;Recognized &lt;code&gt;rm&lt;/code&gt; and &lt;code&gt;rmdir&lt;/code&gt; removals of critical paths still prompt.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So a deny list in your settings is still worth having, even when you plan to run without prompts. Remember its limits: deny rules cover Claude's built-in tools and some shell commands, not every way a script can read a file. The sandbox is what enforces limits at the operating-system level. More on that in &lt;a href="https://agents.paxtechnologyservices.com/articles/stop-ai-agent-reading-env-secrets.html" rel="noopener noreferrer"&gt;How to stop your AI coding agent reading .env and secrets&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Built-in guardrails around the switch
&lt;/h2&gt;

&lt;p&gt;Claude Code adds a few guardrails of its own:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On Linux and macOS it refuses to start in bypass mode as root or under &lt;code&gt;sudo&lt;/code&gt;. That check is skipped inside a recognized sandbox. For autonomous runs in a container, Anthropic points to its dev container setup, which runs Claude Code as a non-root user (&lt;a href="https://code.claude.com/docs/en/devcontainer" rel="noopener noreferrer"&gt;dev container docs&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;A repository cannot switch it on for you. If &lt;code&gt;"bypassPermissions"&lt;/code&gt; is set as &lt;code&gt;defaultMode&lt;/code&gt; in &lt;code&gt;.claude/settings.json&lt;/code&gt; or &lt;code&gt;.claude/settings.local.json&lt;/code&gt;, it does not take effect and the session starts in Manual mode.&lt;/li&gt;
&lt;li&gt;Administrators can block the mode entirely by setting &lt;code&gt;permissions.disableBypassPermissionsMode&lt;/code&gt; to &lt;code&gt;"disable"&lt;/code&gt; in managed settings.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A middle path: fewer prompts without bypass
&lt;/h2&gt;

&lt;p&gt;If your real problem is "too many prompts," Anthropic suggests auto mode instead. In auto mode a second model, the classifier, reviews actions in place of you, with background safety checks. The docs say that from Claude Code v2.1.283 it is the starting mode for interactive terminal and VS Code sessions, and earlier versions use it on certain paid plans. Check your version and your own mode with &lt;code&gt;Shift+Tab&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Other options from the same page:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;acceptEdits&lt;/code&gt;: file edits and common filesystem commands run without asking, everything else still asks. A good fit when you are reviewing the diff anyway.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;plan&lt;/code&gt;: the agent explores and proposes, without editing your source.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dontAsk&lt;/code&gt;: anything that would prompt is denied, which suits locked-down CI.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the Codex equivalent does
&lt;/h2&gt;

&lt;p&gt;Codex has two separate layers: a sandbox mode (what it can technically do) and an approval policy (when it must ask). That split gives you a useful distinction (&lt;a href="https://developers.openai.com/codex/agent-approvals-security" rel="noopener noreferrer"&gt;agent approvals and security&lt;/a&gt;).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--ask-for-approval never&lt;/code&gt; (or &lt;code&gt;-a never&lt;/code&gt;) only stops the questions. It works with every sandbox mode, so &lt;code&gt;--sandbox workspace-write --ask-for-approval never&lt;/code&gt; still keeps the OS sandbox on.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--dangerously-bypass-approvals-and-sandbox&lt;/code&gt;, alias &lt;code&gt;--yolo&lt;/code&gt;, is different. The docs list it as "No sandbox; no approvals (not recommended)." It is the same as &lt;code&gt;--sandbox danger-full-access&lt;/code&gt; with no prompts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want fewer interruptions, change the approval side and keep the sandbox. The docs also describe a granular approval policy, which keeps some prompt categories interactive while rejecting the others, and an Auto-review mode that sends eligible approval requests to a reviewer agent instead of to you.&lt;/p&gt;

&lt;p&gt;One more Codex rule worth knowing: destructive app or MCP tool calls always require approval when the tool advertises a destructive annotation, unless the tool advertises a read annotation.&lt;/p&gt;

&lt;h2&gt;
  
  
  When no-prompt mode is reasonable
&lt;/h2&gt;

&lt;p&gt;Both vendors point to the same place: an isolated environment. OpenAI notes that inside a container you may need &lt;code&gt;danger-full-access&lt;/code&gt; because the Linux sandbox can fail to start under Docker, and then the container is your boundary. It also warns that a malicious project can exfiltrate anything available inside the dev container, including Codex credentials, so use that pattern only with trusted repositories.&lt;/p&gt;

&lt;p&gt;Our checklist for a throwaway environment, based on those warnings:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use a container or VM you can delete. Do not use your daily laptop session.&lt;/li&gt;
&lt;li&gt;Put only the project folder in it. Do not mount &lt;code&gt;~/.ssh&lt;/code&gt;, &lt;code&gt;~/.aws&lt;/code&gt;, &lt;code&gt;~/.kube&lt;/code&gt; or your cloud CLI config.&lt;/li&gt;
&lt;li&gt;Give it a narrowly scoped, short-lived token for the one job, never an admin login or production credentials.&lt;/li&gt;
&lt;li&gt;Keep the repo trusted. Do not point a no-prompt agent at code you just cloned from a stranger.&lt;/li&gt;
&lt;li&gt;Limit outbound network access if you can, since that is how data leaves.&lt;/li&gt;
&lt;li&gt;Review the result like any other pull request before it goes near &lt;code&gt;main&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Quick answer for your setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Everyday machine: stay in the default or auto mode, keep a deny list, turn the sandbox on.&lt;/li&gt;
&lt;li&gt;Want fewer prompts: try auto mode, &lt;code&gt;acceptEdits&lt;/code&gt;, or Codex &lt;code&gt;on-request&lt;/code&gt; with &lt;code&gt;workspace-write&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Unattended or batch work: a disposable container or VM, no production credentials, trusted repo only.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To see what your agent could reach today, run the &lt;a href="https://agents.paxtechnologyservices.com/articles/what-can-your-coding-agent-read.html" rel="noopener noreferrer"&gt;15-minute inventory&lt;/a&gt;. For the settings themselves, see the &lt;a href="https://agents.paxtechnologyservices.com/articles/ai-coding-agent-permissions-audit.html" rel="noopener noreferrer"&gt;10-minute permissions audit&lt;/a&gt;. If your agent also uses MCP servers, read the &lt;a href="https://agents.paxtechnologyservices.com/articles/mcp-server-security-checklist.html" rel="noopener noreferrer"&gt;MCP server security checklist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Setting names and flags in this article were checked against official Claude Code and Codex docs on December 3, 2026. Tools change fast, so check your version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Want the checklist?
&lt;/h2&gt;

&lt;p&gt;PTS wrote a free 9-page checklist with a worksheet and starter files for Claude Code and Codex: &lt;a href="https://paxtechservices.gumroad.com/l/agent-blast-radius?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=devto-dangerously-skip-permissions-safe" rel="noopener noreferrer"&gt;Agent Blast Radius Checklist on Gumroad&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;If you want the free script and starter configs, the repo is here: &lt;a href="https://github.com/paxtechnologyservices/agent-blast-radius" rel="noopener noreferrer"&gt;https://github.com/paxtechnologyservices/agent-blast-radius&lt;/a&gt; . More guides: &lt;a href="https://agents.paxtechnologyservices.com/guides/" rel="noopener noreferrer"&gt;https://agents.paxtechnologyservices.com/guides/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>ai</category>
      <category>claude</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to stop your AI coding agent reading .env and secrets</title>
      <dc:creator>PTS</dc:creator>
      <pubDate>Fri, 04 Dec 2026 02:22:32 +0000</pubDate>
      <link>https://dev.to/paxtechnologyservices/how-to-stop-your-ai-coding-agent-reading-env-and-secrets-1h95</link>
      <guid>https://dev.to/paxtechnologyservices/how-to-stop-your-ai-coding-agent-reading-env-and-secrets-1h95</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://agents.paxtechnologyservices.com/articles/stop-ai-agent-reading-env-secrets.html" rel="noopener noreferrer"&gt;agents.paxtechnologyservices.com&lt;/a&gt;. I'm PTS, an IT and security consulting shop. Corrections welcome in the comments.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The usual leak is boring. A &lt;code&gt;.env&lt;/code&gt; file sits in the project, a local settings file has an API token, or an agent runs a shell command that can read whatever your user can read. You do not need a new product to shrink that. You need the controls your tools already ship, used on purpose, with a clear view of their limits.&lt;/p&gt;

&lt;p&gt;This is a practical pass for Claude Code, Codex and Cursor. Setting names were checked against official docs on December 3, 2026. Check your version before you copy anything into production, and test on a non-production project first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with git, so secrets never leave the laptop
&lt;/h2&gt;

&lt;p&gt;Apiiro found more than 100,000 Claude Code &lt;code&gt;.claude/settings.local.json&lt;/code&gt; files in public GitHub repos, with about 1,100 holding secrets, as &lt;a href="https://arstechnica.com/ai/2026/11/claude-code-settings-files-expose-thousands-of-secrets-on-github/" rel="noopener noreferrer"&gt;reported by Ars Technica on Nov 9, 2026&lt;/a&gt;. Claude Code writes some "don't ask again" approvals to that local file (&lt;a href="https://code.claude.com/docs/en/permissions" rel="noopener noreferrer"&gt;permissions&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Add this to &lt;code&gt;.gitignore&lt;/code&gt; today:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.claude/settings.local.json
.env
.env.*
!.env.example
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That stops a commit. It does not stop an agent that is already running in the folder. The next layers are deny rules, ignore files and a sandbox.&lt;/p&gt;

&lt;h2&gt;
  
  
  Claude Code: deny the files, then turn the sandbox on
&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;.claude/settings.json&lt;/code&gt; (or your user settings in &lt;code&gt;~/.claude/settings.json&lt;/code&gt;), you can deny reads of secret files and some dangerous commands. Anthropic's settings reference shows this pattern (&lt;a href="https://code.claude.com/docs/en/settings-reference" rel="noopener noreferrer"&gt;settings reference&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"permissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"deny"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="s2"&gt;"Read(./.env)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s2"&gt;"Read(./.env.*)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s2"&gt;"Read(./secrets/**)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s2"&gt;"Read(./config/credentials.json)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s2"&gt;"Bash(curl *)"&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two limits matter, and they come from the same docs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deny rules "aren't a complete block." They apply to built-in file tools and to some Bash commands such as &lt;code&gt;cat .env&lt;/code&gt;. They do not apply to a script that opens files itself, or to a command that reads files without naming them, such as &lt;code&gt;grep -r pattern .&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A Bash deny rule matches the command as Claude writes it. &lt;code&gt;Bash(curl *)&lt;/code&gt; does not stop &lt;code&gt;/usr/bin/curl&lt;/code&gt; or &lt;code&gt;sh -c 'curl …'&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For OS-level enforcement, enable the sandbox (&lt;a href="https://code.claude.com/docs/en/sandboxing" rel="noopener noreferrer"&gt;sandboxing&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"sandbox"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"enabled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"allowUnsandboxedCommands"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"filesystem"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"denyRead"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"./.env"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"./.env.*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"~/.ssh"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"~/.aws/credentials"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The sandbox is off by default. When it is on, writes are limited, but reads still include most of the machine, including &lt;code&gt;~/.ssh&lt;/code&gt; and &lt;code&gt;~/.aws/credentials&lt;/code&gt;, unless you add &lt;code&gt;filesystem.denyRead&lt;/code&gt;. Network starts closed and goes through a proxy. Environment variables are inherited, including secrets already in the process environment.&lt;/p&gt;

&lt;p&gt;The sandbox wraps shell commands only. Built-in file tools (Read, Edit, Write, WebFetch), MCP servers, hooks and several helper processes run outside it. Use deny rules for the file tools and the sandbox for the shell, together.&lt;/p&gt;

&lt;p&gt;You can also set &lt;code&gt;permissions.disableBypassPermissionsMode&lt;/code&gt; to &lt;code&gt;"disable"&lt;/code&gt; so no one can enter bypass-permissions mode. With that key set, &lt;code&gt;--dangerously-skip-permissions&lt;/code&gt; is ignored (&lt;a href="https://code.claude.com/docs/en/settings-reference" rel="noopener noreferrer"&gt;settings reference&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;A starter file that combines deny, ask, sandbox and bypass-disabled is in the &lt;a href="https://github.com/paxtechnologyservices/agent-blast-radius" rel="noopener noreferrer"&gt;open-source starter repo&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Codex: sandbox first, network off unless you need it
&lt;/h2&gt;

&lt;p&gt;User defaults live in &lt;code&gt;~/.codex/config.toml&lt;/code&gt;. A cautious local setup is a workspace-write sandbox, approval on request, and no network inside that sandbox (&lt;a href="https://developers.openai.com/codex/config-basic" rel="noopener noreferrer"&gt;config basics&lt;/a&gt;, &lt;a href="https://developers.openai.com/codex/sandboxing" rel="noopener noreferrer"&gt;sandboxing&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="na"&gt;sandbox_mode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"workspace-write"&lt;/span&gt;
&lt;span class="na"&gt;approval_policy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"on-request"&lt;/span&gt;

&lt;span class="k"&gt;[sandbox_workspace_write]&lt;/span&gt;
&lt;span class="na"&gt;network_access&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;workspace-write&lt;/code&gt; lets the agent edit inside the workspace and run routine local commands inside that boundary. &lt;code&gt;on-request&lt;/code&gt; asks when the agent needs to go beyond it. &lt;code&gt;danger-full-access&lt;/code&gt; removes the filesystem and network boundaries and should stay off on any machine that holds real credentials.&lt;/p&gt;

&lt;p&gt;If an older file still has &lt;code&gt;approval_policy = "untrusted"&lt;/code&gt;, remove it. Codex and ChatGPT Work no longer support that value, and it can prevent the client from starting (&lt;a href="https://developers.openai.com/codex/agent-approvals-security" rel="noopener noreferrer"&gt;agent approvals and security&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Cursor: ignore files help, and they are not a wall
&lt;/h2&gt;

&lt;p&gt;Create a &lt;code&gt;.cursorignore&lt;/code&gt; at the project root, using &lt;code&gt;.gitignore&lt;/code&gt; syntax. Cursor uses it to block Agent, Tab and &lt;code&gt;@&lt;/code&gt; mention access to those paths (&lt;a href="https://cursor.com/docs/reference/ignore-file" rel="noopener noreferrer"&gt;ignore file&lt;/a&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**/.env
**/.env.*
**/credentials.json
**/secrets.json
**/*.pem
**/*.key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cursor already ignores &lt;code&gt;.env*&lt;/code&gt; files by default, along with &lt;code&gt;.gitignore&lt;/code&gt; entries. A &lt;code&gt;.cursorignore&lt;/code&gt; is still worth adding for credentials, keys and secret folders that are not covered, and for a rule you can see in the repo.&lt;/p&gt;

&lt;p&gt;The same docs, and Cursor's &lt;a href="https://cursor.com/docs/agent/security" rel="noopener noreferrer"&gt;agent security&lt;/a&gt; page, are clear about the limit: the terminal and MCP tools are not blocked by &lt;code&gt;.cursorignore&lt;/code&gt;. Treat ignore files as a context filter, not a security boundary. Keep approval prompts on for terminal commands, and be careful with run modes, which Cursor describes as best-effort guardrails rather than a hard boundary.&lt;/p&gt;

&lt;h2&gt;
  
  
  A short order of operations
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Add the &lt;code&gt;.gitignore&lt;/code&gt; block, and check that &lt;code&gt;.env&lt;/code&gt; and &lt;code&gt;.claude/settings.local.json&lt;/code&gt; are not already in git history.&lt;/li&gt;
&lt;li&gt;Put deny rules and a starter sandbox in your Claude Code settings, or the Codex config above, or a &lt;code&gt;.cursorignore&lt;/code&gt; if that is your tool.&lt;/li&gt;
&lt;li&gt;Run the &lt;a href="https://agents.paxtechnologyservices.com/articles/what-can-your-coding-agent-read.html" rel="noopener noreferrer"&gt;15-minute inventory&lt;/a&gt; in the same terminal you use for the agent. Confirm the accounts and env names you expect, and only those.&lt;/li&gt;
&lt;li&gt;Try a harmless prompt that asks the agent to read &lt;code&gt;.env&lt;/code&gt;. You want a denial, a prompt, or a sandbox error, not the file contents.&lt;/li&gt;
&lt;li&gt;Rerun when you add an MCP server, a cloud login or a new agent. The &lt;a href="https://agents.paxtechnologyservices.com/articles/ai-coding-agent-permissions-audit.html" rel="noopener noreferrer"&gt;permissions audit&lt;/a&gt; is a 10-minute companion. For the servers themselves, use the &lt;a href="https://agents.paxtechnologyservices.com/articles/mcp-server-security-checklist.html" rel="noopener noreferrer"&gt;MCP server security checklist&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Skip-all-prompts modes, including bypass-permissions or a full-access sandbox with approvals off, belong only inside a throwaway container or VM that holds no production credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  Want the checklist and starter files?
&lt;/h2&gt;

&lt;p&gt;The free &lt;a href="https://paxtechservices.gumroad.com/l/agent-blast-radius?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=devto-stop-ai-agent-reading-env-secrets" rel="noopener noreferrer"&gt;Agent Blast Radius Checklist&lt;/a&gt; is a 9-page worksheet plus these starter files. It lives on Gumroad. This site does not collect email.&lt;/p&gt;




&lt;p&gt;If you want the free script and starter configs, the repo is here: &lt;a href="https://github.com/paxtechnologyservices/agent-blast-radius" rel="noopener noreferrer"&gt;https://github.com/paxtechnologyservices/agent-blast-radius&lt;/a&gt; . More guides: &lt;a href="https://agents.paxtechnologyservices.com/guides/" rel="noopener noreferrer"&gt;https://agents.paxtechnologyservices.com/guides/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>ai</category>
      <category>claude</category>
      <category>devops</category>
    </item>
    <item>
      <title>What can your coding agent actually read? A 15-minute inventory for Claude Code and Codex</title>
      <dc:creator>PTS</dc:creator>
      <pubDate>Fri, 04 Dec 2026 02:21:31 +0000</pubDate>
      <link>https://dev.to/paxtechnologyservices/what-can-your-coding-agent-actually-read-a-15-minute-inventory-for-claude-code-and-codex-43ae</link>
      <guid>https://dev.to/paxtechnologyservices/what-can-your-coding-agent-actually-read-a-15-minute-inventory-for-claude-code-and-codex-43ae</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://agents.paxtechnologyservices.com/articles/what-can-your-coding-agent-read.html" rel="noopener noreferrer"&gt;agents.paxtechnologyservices.com&lt;/a&gt;. I'm PTS, an IT and security consulting shop. Corrections welcome in the comments.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;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 &lt;code&gt;main&lt;/code&gt; or drop a production table, so can an agent running in that terminal.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why bother
&lt;/h2&gt;

&lt;p&gt;Three public reminders:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Researchers audited 200 publicly deployed apps built with Claude Code and Lovable. 91% had at least one vulnerability (&lt;a href="https://arxiv.org/abs/2606.23130" rel="noopener noreferrer"&gt;arXiv 2606.23130&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Apiiro found more than 100,000 Claude Code &lt;code&gt;.claude/settings.local.json&lt;/code&gt; files in public GitHub repos. About 1,100 of them held secrets such as API tokens and database passwords, as &lt;a href="https://arstechnica.com/ai/2026/11/claude-code-settings-files-expose-thousands-of-secrets-on-github/" rel="noopener noreferrer"&gt;reported by Ars Technica on Nov 9, 2026&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;One developer reported an agent running &lt;code&gt;drizzle-kit push --force&lt;/code&gt; against their production database and wiping its tables (&lt;a href="https://github.com/anthropics/claude-code/issues/27063" rel="noopener noreferrer"&gt;anthropics/claude-code issue 27063&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Map what it can reach
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Who is the agent running as?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;whoami
&lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which secrets sit in environment variables? Names only.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;env &lt;span class="o"&gt;|&lt;/span&gt; cut -d= -f1 &lt;span class="o"&gt;|&lt;/span&gt; grep -iE &lt;span class="s1"&gt;'key|token|secret|pass|auth|database_url|dsn'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which cloud and code accounts are logged in? Skip any tool you do not have.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws sts get-caller-identity
gcloud auth list
az account show --query user
gh auth status
kubectl config current-context
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which key files exist, and what variable names are in your &lt;code&gt;.env&lt;/code&gt;?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -a ~/.ssh ~/.aws ~/.kube ~/.config/gcloud 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null
ls -a &lt;span class="o"&gt;|&lt;/span&gt; grep -E &lt;span class="s1"&gt;'^\.env'&lt;/span&gt;
grep -oE &lt;span class="s1"&gt;'^[A-Za-z_][A-Za-z0-9_]*'&lt;/span&gt; .env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Write down each account and role you find. A logged-in admin role is a big blast radius. Also list your MCP servers: run &lt;code&gt;/mcp&lt;/code&gt; in a Claude Code session, look for &lt;code&gt;[mcp_servers.*]&lt;/code&gt; in &lt;code&gt;~/.codex/config.toml&lt;/code&gt;, or open &lt;code&gt;.cursor/mcp.json&lt;/code&gt;. A longer pass over those servers is in the &lt;a href="https://agents.paxtechnologyservices.com/articles/mcp-server-security-checklist.html" rel="noopener noreferrer"&gt;MCP server security checklist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A ready-to-run version of this inventory, which prints names only, is in the &lt;a href="https://github.com/paxtechnologyservices/agent-blast-radius" rel="noopener noreferrer"&gt;open-source starter repo&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Keep settings files out of git
&lt;/h2&gt;

&lt;p&gt;The leaked files above are local settings files that ended up in public repos. Claude Code saves some "don't ask again" approvals to &lt;code&gt;.claude/settings.local.json&lt;/code&gt; at the repository root (&lt;a href="https://code.claude.com/docs/en/permissions" rel="noopener noreferrer"&gt;Claude Code permissions&lt;/a&gt;). Add this to your &lt;code&gt;.gitignore&lt;/code&gt; today:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.claude/settings.local.json
.env
.env.*
!.env.example
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Set a safe default
&lt;/h2&gt;

&lt;p&gt;For Claude Code, the project file &lt;code&gt;.claude/settings.json&lt;/code&gt; 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 &lt;code&gt;cat .env&lt;/code&gt;, but not to a script that opens files itself, or to a command that reads files without naming them, such as &lt;code&gt;grep -r pattern .&lt;/code&gt;. For OS-level enforcement, enable the sandbox (&lt;a href="https://code.claude.com/docs/en/permissions" rel="noopener noreferrer"&gt;permissions&lt;/a&gt;, &lt;a href="https://code.claude.com/docs/en/settings-reference" rel="noopener noreferrer"&gt;settings reference&lt;/a&gt;, &lt;a href="https://code.claude.com/docs/en/sandboxing" rel="noopener noreferrer"&gt;sandboxing&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;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 &lt;code&gt;~/.ssh&lt;/code&gt; and &lt;code&gt;~/.aws/credentials&lt;/code&gt;, unless you add &lt;code&gt;filesystem.denyRead&lt;/code&gt;. The sandbox also wraps shell commands only. Built-in file tools, MCP servers and hooks run outside it.&lt;/p&gt;

&lt;p&gt;A starter settings file is in the &lt;a href="https://github.com/paxtechnologyservices/agent-blast-radius" rel="noopener noreferrer"&gt;open-source starter repo&lt;/a&gt;. For a closer look at deny lists, ignore files and what they miss, see &lt;a href="https://agents.paxtechnologyservices.com/articles/stop-ai-agent-reading-env-secrets.html" rel="noopener noreferrer"&gt;How to stop your AI coding agent reading .env and secrets&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For Codex, a cautious start in &lt;code&gt;~/.codex/config.toml&lt;/code&gt; is a workspace-write sandbox, approval on request and network access off:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="na"&gt;sandbox_mode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"workspace-write"&lt;/span&gt;
&lt;span class="na"&gt;approval_policy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"on-request"&lt;/span&gt;

&lt;span class="k"&gt;[sandbox_workspace_write]&lt;/span&gt;
&lt;span class="na"&gt;network_access&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Codex no longer supports &lt;code&gt;approval_policy = "untrusted"&lt;/code&gt;. If an older config still has that value, remove it or the client may fail to start (&lt;a href="https://developers.openai.com/codex/config-basic" rel="noopener noreferrer"&gt;Codex config basics&lt;/a&gt;, &lt;a href="https://developers.openai.com/codex/agent-approvals-security" rel="noopener noreferrer"&gt;agent approvals and security&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;If you use Cursor, add a &lt;code&gt;.cursorignore&lt;/code&gt; for secrets, and remember that the terminal and MCP tools are not blocked by that file. Details are in the permissions audit and in &lt;a href="https://cursor.com/docs/reference/ignore-file" rel="noopener noreferrer"&gt;Cursor's ignore file docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Rerun it monthly
&lt;/h2&gt;

&lt;p&gt;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 &lt;a href="https://agents.paxtechnologyservices.com/articles/ai-coding-agent-permissions-audit.html" rel="noopener noreferrer"&gt;A 10-minute AI coding agent permissions audit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Want the checklist?
&lt;/h2&gt;

&lt;p&gt;PTS wrote a free 9-page checklist with a worksheet and the starter files: &lt;a href="https://paxtechservices.gumroad.com/l/agent-blast-radius?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=devto-what-can-your-coding-agent-read" rel="noopener noreferrer"&gt;Agent Blast Radius Checklist on Gumroad&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;If you want the free script and starter configs, the repo is here: &lt;a href="https://github.com/paxtechnologyservices/agent-blast-radius" rel="noopener noreferrer"&gt;https://github.com/paxtechnologyservices/agent-blast-radius&lt;/a&gt; . More guides: &lt;a href="https://agents.paxtechnologyservices.com/guides/" rel="noopener noreferrer"&gt;https://agents.paxtechnologyservices.com/guides/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>ai</category>
      <category>claude</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
