Local-first runtime security layer that reviews AI agent shell commands, file access, package installs and MCP tool calls before they run.
Agent-Threat-Rule/agent-threat-rules
Open detection-rule format for AI agent security threats, with executable, testable YAML rules for prompt injection, tool poisoning, and MCP attacks.
- Stars
- 426
- Forks
- 66
- Open issues
- 46
- Last commit
- 21 hours ago
What is it?
ATR (Agent Threat Rules) is a vendor-neutral detection rule format for attacks against AI agents, modeled on Sigma for SIEM logs and YARA for malware. Each rule is a YAML document with a versioned schema that declares the attack pattern, the input field it inspects (LLM input and output, tool-call arguments, SKILL.md content, or agent configuration), test cases, and mappings to OWASP, MITRE ATLAS and other frameworks.
The repository ships a TypeScript reference engine with an npm package and CLI, plus a Python wrapper (pyatr). The CLI can scan skill files, MCP configs and tool lists, export rules to regex, Splunk SPL and Elasticsearch formats, and run each rule's own test cases. A GitHub Action emits SARIF results for the Security tab, and an MCP server integrates with IDE clients such as Claude Code and Cursor.
The rule corpus covers categories including prompt injection, tool poisoning, context exfiltration, privilege escalation and skill compromise. The project publishes per-source detection measurements with separate lane figures, and it documents known limitations and evasion techniques.
Key features
- 01Rules are YAML documents with a versioned schema and a public ATR-YYYY-NNNNN identifier scheme.
- 02TypeScript engine and CLI, plus a Python package (pyatr).
- 03Exports rules to regex, Splunk SPL and Elasticsearch query formats.
- 04GitHub Action outputs SARIF results for code scanning.
- 05MCP server for live integration with IDE clients such as Claude Code and Cursor.
- 06Each rule maps to OWASP Agentic Top 10, OWASP LLM Top 10 and MITRE ATLAS references.
Use cases
- Scanning SKILL.md files and MCP server configurations in CI before they are merged.
- Adding runtime prompt-injection checks to an agent framework or proxy through the engine API.
- Exporting detection rules into an existing SIEM such as Splunk or Elasticsearch.
- Red-teaming an LLM application against a shared, testable set of agent attack patterns.
Quick start
- 1
Install the npm package
npm install agent-threat-rules - 2
Scan a SKILL.md file with the CLI
atr scan skill.md
Things to know
- Lane false-positive rates were withdrawn and have not yet been re-measured, so precision figures are currently unavailable.
- Governance is currently single-maintainer, with a planned move to a Technical Steering Committee.
Topics
FAQ
- What is agent-threat-rules?
- Open detection-rule format for AI agent security threats, with executable, testable YAML rules for prompt injection, tool poisoning, and MCP attacks. ATR (Agent Threat Rules) is a vendor-neutral detection rule format for attacks against AI agents, modeled on Sigma for SIEM logs and YARA for malware. Each rule is a YAML document with a versioned schema that declares the attack pattern, the input field it inspects (LLM input and output, tool-call arguments, SKILL.md content, or agent configuration), test cases, and mappings to OWASP, MITRE ATLAS and other frameworks.
- Is agent-threat-rules free to use? What license does it have?
- agent-threat-rules is open source under the MIT license. Check the license terms before using it in commercial products.
- Is agent-threat-rules still maintained?
- Actively maintained. The last commit to agent-threat-rules was on Nov 6, 2026.
- What can I use agent-threat-rules for?
- Scanning SKILL.md files and MCP server configurations in CI before they are merged. Adding runtime prompt-injection checks to an agent framework or proxy through the engine API. Exporting detection rules into an existing SIEM such as Splunk or Elasticsearch. Red-teaming an LLM application against a shared, testable set of agent attack patterns.
- How do I install agent-threat-rules?
- Install the npm package: npm install agent-threat-rules Scan a SKILL.md file with the CLI: atr scan skill.md
- Where can I get agent-threat-rules?
- The source code and installation instructions are on GitHub: https://github.com/Agent-Threat-Rule/agent-threat-rules
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Enterprise security system that discovers, observes, benchmarks and detects risky behavior from AI coding agents and customer-facing support agents.
A full-stack AI red teaming platform by Tencent Zhuque Lab that scans AI agents, MCP servers, Agent Skills and AI infrastructure for security risks.
Open-source CLI and library that verifies AI model files, code, live LLM/agent/MCP endpoints, and recorded agent traces, reporting findings and gaps.
Security scanner for AI coding agents that checks generated code, MCP servers, prompts, and AI-suggested packages for risks.
AI-first security scanner for code and AI agent configs, with built-in rules for LLM apps, MCP servers, and secrets leaked in chat or shell history.