Skip to the content
AI and Cybersecurity Learning and Practice Center Test automation Open the Learning Center

WeaknessASC-2026-0016Major weakness

Poisoned agent configuration and instruction files

HighMitigated

Coding agents trust files in the repository: rules files, AGENTS.md, CLAUDE.md, .cursor and .claude settings, hooks and editor tasks. A malicious commit or dependency that writes them plants instructions or runs code the next time someone opens the project.

How to detect it

  • Agent instruction or settings files changed by a dependency, a bot or an outside contributor
  • Hooks or tasks that run on session start or folder open
  • Hidden Unicode or very long lines in rules files

How to resolve it

  • Review agent configuration files like CI configuration, with CODEOWNERS on .claude/, .cursor/, .vscode/, AGENTS.md and rules files
  • Keep workspace trust prompts on and do not auto-run hooks in untrusted repositories
  • Scan these files in CI for hidden characters, network commands and hooks
  • Install dependencies with lifecycle scripts disabled so packages cannot write them

How to investigate

  1. Inspect git history of agent configuration files for unexpected authors and recent changes
  2. Check which machines opened the project after the change and what the hooks ran
  3. Rotate credentials available on those machines

Sources

Open it in the Learning Center's vulnerability database