Essential File Blocking for AI Coding Assistants: A Practical Security Checklist

AI coding assistants present a new security challenge: they read directly from your local filesystem, not just from your version-controlled repository. This means files protected by .gitignore from being pushed to GitHub remain accessible to the agent running on your machine.
Key Files to Block
Based on a Node/Firebase setup audit from the Reddit discussion, these are the critical files that should be blocked from AI coding assistants:
- AI Assistant Configs:
~/.claude/settings.json(contains MCP server API keys),~/.cursor/mcp.json - Service Credentials:
~/.npmrc(npm token for publishing packages), Firebase service account JSON files (with full project access),~/.config/gcloud/application_default_credentials.json(GCP credentials),~/.git-credentialsand~/.netrc(Git HTTPS tokens) - Common Oversights:
~/.ssh/id_*(SSH private keys),~/.bash_history(may contain pasted tokens),.envand.env.*files (gitignore doesn't protect from local agents), test files with hardcoded keys,.git/config(may contain HTTPS tokens),/proc/<pid>/environ(environment variables from running processes) - CI/CD Secrets: GitHub Actions, Vercel, and other CI/CD secrets that may appear in logs if echoed
Server-Specific Concerns
The discussion notes that on servers, additional files become vulnerable:
/etc/environment(global environment variables)/etc/ssl/private/*(TLS certificates)- Database configuration files with connection strings containing passwords
/var/log/*(logs that may accidentally contain tokens)- Crontabs with inline secrets in scheduled commands
The core issue highlighted is that traditional Git-based security measures like .gitignore don't protect against AI agents reading local files. Developers need to implement explicit blocking for sensitive files that AI coding assistants might access during their operation.
📖 Read the full source: r/ClaudeAI
👀 See Also

Cloak tool replaces chat passwords with self-destructing links for OpenClaw agents
Cloak is an open source tool that replaces passwords shared in chat with OpenClaw agents with self-destructing links. Each link can only be opened once, then the password disappears, preventing passwords from accumulating in chat histories.

The Uniformed Guard Problem: Why Agent Sandboxes Need Identity, Not Just Policy
Nemoclaw's openshell sandbox scopes policies to binaries, enabling malware to live-off-the-land using the same binaries as the agent. ZeroID, an open-source agent identity layer, applies security policies to agents backed by secure identities.

Agent-Drift: Security Monitoring Tool for AI Agents

Delimiter defense boosts Gemma 4 from 21% to 100% prompt injection defense in 6100+ test benchmark
A benchmark tested 15 models across 7 attack types (6100+ tests) using random delimiters around untrusted content. Gemma 4 E4B went from 21.6% to 100% defense rate with delimiter + strict prompt.