Yeda AI Tips · #170

Español

Your Agent Config Is an Attack Surface

Attackers are not just going after your code anymore. They are going after your AI's config files.

Your project instruction files, tool settings, and MCP (Model Context Protocol) server configs are not documentation. They are executable policy: they tell the agent what it may run, which servers it may call, and how to behave. A hidden instruction smuggled into a rules file, an over-broad allow list, or a hardcoded token in an MCP config is a direct breach path, and most teams never review these files with the same rigor they apply to source code.

Why config is a breach path

The agent trusts these files by design. That trust is the vulnerability:

The mechanism: scan them like code

Treat every file that steers the agent as security-relevant and review it before it merges. Cover the whole set: the rules/instruction file, settings, MCP configs, and hooks.

# 1. Flag wildcard / auto-approve permissions
grep -rEn 'Bash\(\*\)|"?allow"?.*\*|autoApprove|--dangerously' .claude .mcp.json

# 2. Flag hardcoded secrets in configs and hooks
grep -rEn '(api[_-]?key|token|secret|password)\s*[:=]\s*["'\''][A-Za-z0-9_\-]{16,}' \
  .claude .mcp.json

# 3. Diff instruction files on every PR — an injected line is a code review event
git diff --stat origin/main -- '**/CLAUDE.md' '**/*.mdc' '.claude/**'

Then read the MCP server list and confirm every endpoint is one you trust, with its credentials pulled from the environment or a secrets manager, never inlined.

The payoff

You catch the overly permissive allow list and the smuggled prompt before they ever run. The audit turns a silent, trusted breach path into a normal code-review finding, checked on the same PR gate as the rest of your changes.

Power moves

Resources

Shipping AI or cloud systems? Yeda AI audits and hardens production LLM and container pipelines. Talk to us · Read the blog