Close Menu
Tech Nova Mindset – Empower Innovation and Forward Thinking

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    How ideas of a vast censorship network moved from the online fringe to Trump policy

    August 8, 2026

    The Pivot From Tech Expert to Organizational Leader

    August 7, 2026

    Scientists Used AI to Create 16 New Viruses

    August 7, 2026
    Facebook X (Twitter) Instagram
    Trending
    • How ideas of a vast censorship network moved from the online fringe to Trump policy
    • The Pivot From Tech Expert to Organizational Leader
    • Scientists Used AI to Create 16 New Viruses
    • The Download: a censorship conspiracy theory and the first virus created by AI
    • V2X Technology Gets a 5G Cellphone Network Solution
    • AI may respond differently to bosses and subordinates
    • Sam Altman Says We’re ‘in the Singularity’ With AI. Here’s Why He’s Wrong.
    • The Hottest New AI Chatbot Is Just a Guy Answering Your Questions
    Tech Nova Mindset – Empower Innovation and Forward Thinking
    • Home
    • Gadgets
    • Reviews
    • Tech News
    • Future Tech
    • AI & Robotics
    • How-To Guides
    • More
      • Cybersecurity
      • Startups & Innovation
    Tech Nova Mindset – Empower Innovation and Forward Thinking
    Home»Cybersecurity»Claude Code ignores ignore rules meant to block secrets • The Register
    Cybersecurity

    Claude Code ignores ignore rules meant to block secrets • The Register

    kirklandc008@gmail.comBy kirklandc008@gmail.comJanuary 28, 2026No Comments4 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Claude Code ignores ignore rules meant to block secrets • The Register
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Don’t you hate it when machines can’t follow simple instructions? Anthropic’s Claude Code can’t take “ignore” for an answer and continues to read passwords and API keys, even when your secrets file is supposed to be blocked.

    Software developers often store secrets – passwords, tokens, API keys, and other credentials – in .env files within project directories. And if they do so, they’re supposed to ensure that the .env file does not get posted in a publicly accessible .git repository.

    A common way to do this is to create an entry in a .gitignore file that tells the developer’s Git software to ignore that file when copying a local repo to a remote server.

    Claude implements something similar, a .claudeignore file. 

    When asked, “If I make a .env file, how do I keep you from reading it?”, Claude responded, “You can add .env to a .claudeignore file in your project root. This works like .gitignore — Claude Code will refuse to read any files matching patterns listed there.”

    But Claude is incorrect. As described in this Pastebin post, Claude can read the contents of an .env file despite an entry in the .claudeignore file that ought to prevent access. 

    The Register reproduced this result. We created a directory, created an .env file with sample secrets, added a .claudeignore file with “.env” and “.env.*” and then started Claude Code (v2.1.12) via the CLI. We asked Claude to read the .env file and it did so – which would not happen if Claude respected .claudeignore entries.

    This has potential security implications, particularly for agents – these tool-enabled AI models could be induced to share stored secrets via indirect prompt injection.

    What’s more, Claude will also ignore the presence of “.env” in a .gitignore file. It does so despite a default /config flag that sets “Respect .gitignore in file picker” to “true.”

    In fact, when asked to read the .env file in a project with a .gitignore entry that includes “.env”, Claude dutifully prints the secrets within to the console, with the following warning: “Note: This file contains credentials. Be cautious about committing it to version control — make sure .env is listed in your .gitignore.”

    Claude’s willingness to ignore .claudeignore directives is cited in an open issue post in Claude Code’s GitHub repository, “[HIGH PRIORITY] Claude exposes secrets/tokens in tool output – no redaction.” The individual who opened the issue two days ago notes, “This is a security-critical issue that should be addressed urgently.”

    It hasn’t been. Two posts from November 2025 raise the same concern. Another open issue created two weeks ago also flags Claude’s willingness to display secrets. As does yet another bug report from three weeks ago that says, “Claude should refrain from reading or even being aware of anything in the .claudeignore file, using [the] same standard parsing rules as a .gitignore file.”

    There are ways to direct Claude to keep away from secrets that appear to work, such as specifying permissions within a settings.json file in a project’s .claude directory. 

    When we created that file as described in the documentation, Claude reported an error: “The .env file is blocked by permission settings. This is expected behavior — .env files typically contain secrets (API keys, passwords, database credentials), so they are excluded from tool access as a security measure.”

    But configuring these settings permissions can be tricky – a bug report raising this concern includes a response that explains Claude’s syntax for absolute paths begins with two “//” instead of “/” as Linux and macOS users might expect. Developers have also opened issues reporting problems with the @ file reference syntax in settings.json. And there are other problems, like permissions.deny not preventing files from being loaded into memory.

    Anthropic did not respond to a request for comment.

    If settings.json is intended to be the only supported way of denying Claude file access, Anthropic should make it clearer that .claudeignore is not an option. The model’s own recommendations should align with best practices, instead of leading people astray. ®

    block Claude Code ignore ignores meant Register Rules Secrets
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    kirklandc008@gmail.com
    • Website

    Related Posts

    The Download: Montana’s new experimental drug rules

    July 31, 2026

    Anthropic Says Claude Hacked 3 Organizations During Cybersecurity Tests

    July 31, 2026

    Private Claude Chats Exposed in Google and Bing Search Results

    July 27, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Nothing CEO says phone prices are going to keep going up

    June 12, 20267 Views

    Google DeepMind Plans to Track AGI Progress With These 10 Traits of General Intelligence

    March 21, 20263 Views

    The AirPods 4 and Lego’s brick-ified Grogu are our favorite deals this week

    October 12, 20253 Views
    Stay In Touch
    • Facebook
    • YouTube
    • TikTok
    • WhatsApp
    • Twitter
    • Instagram
    Latest Reviews

    Subscribe to Updates

    Get the latest tech news from FooBar about tech, design and biz.

    Recent Posts
    • How ideas of a vast censorship network moved from the online fringe to Trump policy
    • The Pivot From Tech Expert to Organizational Leader
    • Scientists Used AI to Create 16 New Viruses
    • The Download: a censorship conspiracy theory and the first virus created by AI
    • V2X Technology Gets a 5G Cellphone Network Solution

    How ideas of a vast censorship network moved from the online fringe to Trump policy

    August 8, 2026

    The Pivot From Tech Expert to Organizational Leader

    August 7, 2026

    Scientists Used AI to Create 16 New Viruses

    August 7, 2026

    The Download: a censorship conspiracy theory and the first virus created by AI

    August 7, 2026
    Facebook X (Twitter) Instagram Pinterest
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms and Conditions
    • Disclaimer
    © 2026 TechNovaMindset. Designed by By Pro.

    Type above and press Enter to search. Press Esc to cancel.