Add ATR-derived skill manifest and MCP tool security rules#3842
Open
eeee2345 wants to merge 1 commit into
Open
Add ATR-derived skill manifest and MCP tool security rules#3842eeee2345 wants to merge 1 commit into
eeee2345 wants to merge 1 commit into
Conversation
Add five rules under ai/ai-best-practices targeting agent skill manifests and MCP tool definitions. skill-md-prompt-injection-generic detects override directives (ignore previous instructions, persona switching, IMPORTANT delimiters) inside SKILL.md or AGENT.md frontmatter descriptions. skill-md-data-exfiltration-generic detects directives that instruct an agent to send results, contents, or credentials to an external endpoint. skill-md-base64-payload-generic detects encoded payload smuggling via base64 or hex inside skill bodies. skill-md-sensitive-file-access-generic detects directives that read ~/.ssh, ~/.aws/credentials, .env, /etc/shadow, or browser cookie stores. mcp-typosquatted-tool-name-python detects MCP tool functions and tool name aliases that resemble typosquatted variants of well-known tools (filesystem, github, database). Patterns are derived from the open Agent Threat Rules detection standard at https://github.com/Agent-Threat-Rule/agent-threat-rules (Apache-2.0). ATR rule packs are shipped in production at Cisco AI Defense and Microsoft agent-governance-toolkit. All five rules pass semgrep test and semgrep validate.
|
Panguard AI seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
1 similar comment
|
Panguard AI seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Author
|
@CLAassistant recheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds five rules under ai/ai-best-practices targeting two attack surfaces that are not covered by the existing ai-best-practices rules: agent skill manifests (SKILL.md, AGENT.md, AGENTS.md) and MCP tool name typosquatting.
The four skill manifest rules use generic mode and run on *.md skill files. They detect prompt-injection markers in frontmatter descriptions, exfiltration directives in skill bodies, base64 or hex payload smuggling, and instructed access to credential files such as ~/.ssh/id_rsa, ~/.aws/credentials, .env, and browser cookie stores. The fifth rule uses Python pattern syntax to flag MCP tool functions whose names match typosquatted variants of filesystem, github, and database tools.
These complement, but do not duplicate, the existing mcp-tool-poisoning rule (which targets Python docstrings) and ai-config-hidden-unicode (which targets cursorrules and CLAUDE.md). Skill manifests are a distinct attack surface in the agent supply chain because they ship inside skill marketplaces and are loaded by agents at runtime.
The detection patterns are derived from the open Agent Threat Rules (ATR) detection standard at https://github.com/Agent-Threat-Rule/agent-threat-rules, which is licensed under Apache-2.0. ATR rule packs are shipped in production at Cisco AI Defense (skill-scanner) and Microsoft agent-governance-toolkit (PolicyEvaluator).
All five rules pass semgrep test and semgrep validate locally on Semgrep 1.157.0. Each rule directory contains a yaml rule and a corresponding test fixture with positive and negative cases. No existing rule IDs were modified or shadowed.
If the maintainers prefer a smaller initial drop, I can split this into two PRs (skill manifest rules and MCP tool name rule) or trim to the highest-confidence subset.