Skip to content

About

Zero-dependency config auditor, drop-in AGENTS.md rules, and doc-verified fixes for Claude Code, Codex, Cursor, and MCP.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Coding Agent Tips & Config Auditor

CI License: MIT Python 3 stdlib

Zero-dependency local security auditor, drop-in AGENTS.md / CLAUDE.md rules, and doc-verified fixes for Claude Code, OpenAI Codex CLI, Cursor, and MCP servers. Every fix is verified word-for-word against official documentation or published studies.

1-Command Local Audit (Python 3 stdlib, read-only)

Run directly against any repository (zero installs, exit 0 when clean, 1 when findings exist; supports --json):

curl -fsSL https://raw.githubusercontent.com/seankwon816/ai-coding-agent-tips/main/scripts/audit_agent_configs.py | python3 - .

Or run from a local clone:

python3 scripts/audit_agent_configs.py .

Example output

[FAIL] Audited /path/to/your-project (4 finding(s))
  - [HIGH] MCP_AUTO_APPROVE_ALL_PROJECT_SERVERS (.claude/settings.local.json): .claude/settings.local.json sets enableAllProjectMcpServers=true, auto-approving every server in .mcp.json without prompting to inspect tools/list.
    Fix: Set enableAllProjectMcpServers to false (or remove it) and list vetted server names explicitly under enabledMcpjsonServers.
  - [HIGH] CLAUDE_LOCAL_INLINE_SECRET (.claude/settings.local.json): Found 2 inline credential pattern(s) (OpenAI/API key, Bearer/Authorization header; e.g. sk-p...abcd [REDACTED], Bear...abcd [REDACTED]).
    Fix: Run /permissions in Claude Code, remove literal secret allow rules, and pass $ENV_VAR names instead.
  - [HIGH] UNIGNORED_CLAUDE_LOCAL_SETTINGS (.gitignore): .claude/ exists without a .gitignore exclusion; future Option 2 rules can be committed by git add .
    Fix: Add '.claude/settings.local.json' (or '.claude/') to .gitignore before staging changes.
  - [MEDIUM] MCP_UNPINNED_NPX (.mcp.json): .mcp.json server 'docs' launches '@modelcontextprotocol/server-filesystem' via npx -y without a pinned @version.
    Fix: Pin exact package versions (pkg@1.2.3) or isolate sessions with managed-mcp.json and --strict-mcp-config.
What the auditor checks (16 built-in rules)
  • Secrets & leak hygiene: inline API keys/tokens in .claude/settings*.json and .mcp.json (redacted in output), missing .claude/ in .gitignore, Dockerfile COPY/ADD . . without .dockerignore exclusions.
  • Sandbox & approval gates: permissions.defaultMode: "bypassPermissions", blanket permissions.allow wildcards (*, Bash(*), WebFetch(*), mcp__*), sandbox.filesystem.denyRead not mirrored in permissions.deny, missing allowUnsandboxedCommands: false, broad sandbox.excludedCommands.
  • MCP server safety: enableAllProjectMcpServers: true, 0.0.0.0 wildcard bindings, unpinned npx -y packages without @version.
  • Hooks, context & prompt hygiene: blocking hooks using non-blocking exit 1 instead of exit 2, out-of-range autoCompactWindow settings, CLAUDE.local.md shadowing AGENTS.md without @AGENTS.md, codebase-ownership phrasing that triggers unrequested refactors.

Drop-In Starter Rules

  • rules/AGENTS.minimal-diffs.md: Ready-to-paste AGENTS.md / CLAUDE.md rules for surgical diffs, two-phase commits, $ENV_VAR command safety, and ignore hygiene.

Verified Field Fixes (23)

Security & Sandboxing

Area Fix What it solves
Claude Code / Docker Inline API keys written by "Yes, and don't ask again" 31,088 GitHub secrets and 613 Docker Hub leaks from .claude/settings.local.json
Claude Code Mirror sandbox denyRead rules in permissions.deny and disable unsandboxed retries sandbox.filesystem.denyRead blocks bash only, leaving built-in Read and unsandboxed retries open
Claude Code Enforce hard tool and approval gates instead of relying on prompt-injection filters Prompt-injection detectors look for adversarial instructions inside tool results, not plausible numbers
Any agent Audit AI email connectors against indirect prompt injection Hidden instructions inside emails, calendar invites, or PDFs hijack connected OAuth tools (OWASP LLM01, CVE-2026-24301)
Any agent Isolate coding-agent containers with --network none, --read-only, and seccomp Local model weights do not isolate shell commands from host files, cloud metadata (169.254.169.254), or outbound exfiltration
Python / Security Audit site-packages .pth startup hooks in coding-agent Python environments Compromised Python wheels (agent-framework 1.26.1/1.26.2) harvest keys via .pth hooks even without import

MCP Servers & Tool Interfaces

Area Fix What it solves
MCP Bind local HTTP servers to 127.0.0.1 Local MCP servers open to your whole network
MCP Lock down MCP servers with headersHelper, allowlists, and strict-mcp-config In MCPTox tests across 45 live MCP servers, hidden rules in tool descriptions reached 72.8% attack success
Claude Code / MCP Audit MCP tools/list for credential exposure and avoid enableAllProjectMcpServers Prompt-injection scans miss benign-looking MCP tools that request or touch credentials
MCP Route all MCP stdio server logs to stderr so stdout carries JSON-RPC only Any non-JSON log line printed to stdout breaks newline-delimited MCP stdio framing
MCP Batch browser MCP form fills and return DOM deltas to cut replay tokens Multi-turn browser MCP form fills replay full ARIA trees each step, reaching 72,614 cumulative tokens
MCP Trim agent tool results to a 5-field allowlist to raise solve rate and cut token spend Raw REST or MCP list JSON payloads flood context with URLs, avatars, and nested metadata

Cost, Context & Token Control

Area Fix What it solves
Claude Code Run the Explore subagent on Haiku Codebase searches running on your biggest model
Claude Code Cap 1M auto-compaction earlier when long sessions drive up token spend On 1M-window models, waiting until ~967K tokens to compact pushes two thirds of spend into the tail
Claude Code Bound headless agent loops with --max-turns and --max-budget-usd Across 27,280 coding agent runs, step count drove inference cost while starting prompt size barely mattered
Any agent Separate AI project memory with a three-layer setup Global AI memory loads into every conversation thread

Workflow, Git & Prompt Hygiene

Area Fix What it solves
Claude Code AGENTS.md ignored when CLAUDE.local.md exists A personal file silently turns off your shared AGENTS.md
Claude / AGENTS.md Prompts claiming codebase ownership cause unrequested refactors Ownership prompts raise unrequested code consolidation from under 10% to about 75%
Any agent Surgical changes rule 3-line fixes that come back as 300-line diffs
Any agent Split coding-agent commits into prep and logic phases Oversized agent diffs that mix renames and formatting into feature logic
Claude Code .worktreeinclude and worktree.baseRef New worktrees with no .env that start from main
Claude Code Block unfinished agent edits with Stop hook exit code 2 before PR review AI coding PRs are 154% larger and carry up to 2.74x more security flaws, stalling human code review
Any agent Put a deterministic fail-before-fix proof gate ahead of human PR review 655-firm and 500k-dev studies show code review stalls and releases lag when vacuous agent PRs pass green CI

Last checked: 2026-11-22

How each tip is written

  • One concrete problem, one copy-pasteable fix, and a link to the exact official doc or study lines that prove it.
  • Automated verification (contributing guide) checks quote accuracy, table formatting, and auditor tests on every commit.

Running tests

python3 -m unittest discover -s tests -v

Community

Questions, edge cases, or new tip ideas: open a GitHub Discussion, file an Issue, or join the Discord community.

License

MIT

About

Zero-dependency config auditor, drop-in AGENTS.md rules, and doc-verified fixes for Claude Code, Codex, Cursor, and MCP.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages