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

BlindKey: Blind Credential Injection for AI Agents
BlindKey is a security tool that prevents AI agents from accessing plaintext API credentials by using encrypted vault tokens and a local proxy. Agents reference tokens like bk://stripe, and the proxy injects the real credential at request time.

pi-governance: RBAC, DLP, and audit logging for OpenClaw coding agents
pi-governance is a plugin that sits between AI coding agents and your system, classifying tool calls and blocking risky operations. It provides bash command blocking, DLP scanning for secrets and PII, role-based access control, and structured audit logging with zero configuration.

Claw Hub and Hugging Face hit with 575 malicious skill packages
Both Claw Hub and Hugging Face were compromised, hosting 575 malicious skill packages. Developers are warned to verify any skills they use from these platforms.

Open Source AI Tools Pose Security Risks Through 'Illusory Security Through Transparency'
A Reddit post warns about malware disguised as open-source AI agents and tools, where malicious code can be hidden in large codebases that users assume are safe because they're on GitHub. The post describes how 'vibe-coding' and autonomous AI agents condition users to run unknown programs without review.