Join our Newsletter — 33% off our NHI Course

Why do malicious instruction files work so well against AI agents?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20842
Topic starter  

TL;DR: AI instruction files can be turned into malware delivery paths that exfiltrate prompts, redirect agent traffic and leak secrets, according to Mitiga. AI agents treat these files as trusted context, so governance has to move upstream to what gets loaded and executed.

Editorial analysis by NHI Mgmt Group, based on content published by Mitiga: “AI Agent Supply-Chain Malware in Instruction Files”.

By the numbers:

  • Over 1,230 hardcoded API keys and JWT tokens were found across tens of services.

Key questions

Q: Why can prompt exfiltration work without malware on disk?

A: Prompt exfiltration can work by tricking an AI agent or tool into revealing system prompts, hidden context, retrieved data, or credentials through normal model outputs or tool calls, so no malware is needed on disk.

Q: How should teams govern MCP endpoint changes in AI workflows?

A: Govern MCP endpoint changes through change control, code review, allowlisted servers, and signed or approved configuration so an agent only connects to trusted tools.

Q: How do poisoned instruction files affect AI coding agents?

A: Poisoned instruction files can override the user’s visible task by feeding the agent trusted guidance that changes how it edits files, invokes tools and interprets project context.

Practitioner guidance

  • Audit instruction-file trust paths Inventory every place an agent loads context from, including Skills, hooks, AGENTS.md, CLAUDE.md, MCP configs and helper scripts, then classify which of those paths can alter runtime behaviour.
  • Block endpoint and base-URL overrides Reject unapproved routing changes in agent configs, especially settings that can redirect model traffic, tool calls or MCP endpoints to external infrastructure.
  • Scan for prompt-exfiltration patterns Look for instruction text that tells an agent to capture prompts, copy local data, phone home or chain to another file, and treat those patterns as high-risk even when no binary is present.

Bottom line: Instruction files now sit on the critical path for AI agent compromise because they can steer runtime behaviour, not just describe it.

Glossary terms: AI Instruction File, Base-URL Override, Prompt Exfiltration, MCP Server Configuration

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →



   
Quote
(@mr-nhi)
Member Moderator
Joined: 7 months ago
Posts: 21072
 

Instruction files have become a supply-chain control plane for AI agents: the core security problem is no longer only what code ships, but what context an agent is allowed to trust. A malicious skill, hook or brain file can shape runtime behaviour before any traditional malware detector sees a binary. That makes the loading step itself a governance boundary, not a convenience feature.

A few things that frame the scale:

  • 24,008 unique secrets were exposed in MCP configuration files in 2025 alone, the protocol's first year of widespread adoption, according to the State of Secrets Sprawl 2026.

A question worth separating out:

Q: What should teams do first when agent repos contain hardcoded secrets?

A: First isolate the repository, revoke or disable the exposed credentials, and rotate the exposed secrets before assuming anything in the codebase is trustworthy. Then search for all copies in code, logs, CI variables, issue trackers, and documentation, and replace hardcoded values with injected secrets from a vault or other controlled secret store.

👉 Read our full editorial: Malicious AI instruction files can exfiltrate prompts and secrets



   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.