@panguard-ai/atr 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/.github/ISSUE_TEMPLATE/evasion-report.yml +75 -0
  2. package/.github/ISSUE_TEMPLATE/false-positive.yml +31 -0
  3. package/.github/ISSUE_TEMPLATE/mirofish-prediction.yml +128 -0
  4. package/.github/ISSUE_TEMPLATE/new-rule.yml +37 -0
  5. package/.github/PULL_REQUEST_TEMPLATE.md +23 -0
  6. package/.github/workflows/rule-quality.yml +203 -0
  7. package/.github/workflows/validate.yml +42 -0
  8. package/CHANGELOG.md +30 -0
  9. package/CONTRIBUTING.md +168 -0
  10. package/CONTRIBUTORS.md +28 -0
  11. package/COVERAGE.md +135 -0
  12. package/LIMITATIONS.md +154 -0
  13. package/SECURITY.md +48 -0
  14. package/THREAT-MODEL.md +243 -0
  15. package/docs/contribution-paths.md +202 -0
  16. package/docs/mirofish-prediction-guide.md +304 -0
  17. package/docs/quick-start.md +245 -0
  18. package/docs/rule-writing-guide.md +647 -0
  19. package/docs/schema-spec.md +594 -0
  20. package/examples/how-to-write-a-rule.md +251 -0
  21. package/package.json +10 -57
  22. package/src/index.ts +7 -0
  23. package/tsconfig.json +17 -0
  24. package/dist/cli.d.ts +0 -14
  25. package/dist/cli.d.ts.map +0 -1
  26. package/dist/cli.js +0 -744
  27. package/dist/cli.js.map +0 -1
  28. package/dist/content-hash.d.ts +0 -7
  29. package/dist/content-hash.d.ts.map +0 -1
  30. package/dist/content-hash.js +0 -10
  31. package/dist/content-hash.js.map +0 -1
  32. package/dist/coverage-analyzer.d.ts +0 -43
  33. package/dist/coverage-analyzer.d.ts.map +0 -1
  34. package/dist/coverage-analyzer.js +0 -329
  35. package/dist/coverage-analyzer.js.map +0 -1
  36. package/dist/engine.d.ts +0 -136
  37. package/dist/engine.d.ts.map +0 -1
  38. package/dist/engine.js +0 -781
  39. package/dist/engine.js.map +0 -1
  40. package/dist/index.d.ts +0 -26
  41. package/dist/index.d.ts.map +0 -1
  42. package/dist/index.js +0 -18
  43. package/dist/index.js.map +0 -1
  44. package/dist/loader.d.ts +0 -21
  45. package/dist/loader.d.ts.map +0 -1
  46. package/dist/loader.js +0 -149
  47. package/dist/loader.js.map +0 -1
  48. package/dist/mcp-server.d.ts +0 -13
  49. package/dist/mcp-server.d.ts.map +0 -1
  50. package/dist/mcp-server.js +0 -244
  51. package/dist/mcp-server.js.map +0 -1
  52. package/dist/mcp-tools/coverage-gaps.d.ts +0 -13
  53. package/dist/mcp-tools/coverage-gaps.d.ts.map +0 -1
  54. package/dist/mcp-tools/coverage-gaps.js +0 -57
  55. package/dist/mcp-tools/coverage-gaps.js.map +0 -1
  56. package/dist/mcp-tools/list-rules.d.ts +0 -17
  57. package/dist/mcp-tools/list-rules.d.ts.map +0 -1
  58. package/dist/mcp-tools/list-rules.js +0 -45
  59. package/dist/mcp-tools/list-rules.js.map +0 -1
  60. package/dist/mcp-tools/scan.d.ts +0 -18
  61. package/dist/mcp-tools/scan.d.ts.map +0 -1
  62. package/dist/mcp-tools/scan.js +0 -87
  63. package/dist/mcp-tools/scan.js.map +0 -1
  64. package/dist/mcp-tools/submit-proposal.d.ts +0 -12
  65. package/dist/mcp-tools/submit-proposal.d.ts.map +0 -1
  66. package/dist/mcp-tools/submit-proposal.js +0 -116
  67. package/dist/mcp-tools/submit-proposal.js.map +0 -1
  68. package/dist/mcp-tools/threat-summary.d.ts +0 -12
  69. package/dist/mcp-tools/threat-summary.d.ts.map +0 -1
  70. package/dist/mcp-tools/threat-summary.js +0 -72
  71. package/dist/mcp-tools/threat-summary.js.map +0 -1
  72. package/dist/mcp-tools/validate.d.ts +0 -15
  73. package/dist/mcp-tools/validate.d.ts.map +0 -1
  74. package/dist/mcp-tools/validate.js +0 -57
  75. package/dist/mcp-tools/validate.js.map +0 -1
  76. package/dist/modules/index.d.ts +0 -144
  77. package/dist/modules/index.d.ts.map +0 -1
  78. package/dist/modules/index.js +0 -82
  79. package/dist/modules/index.js.map +0 -1
  80. package/dist/modules/semantic.d.ts +0 -105
  81. package/dist/modules/semantic.d.ts.map +0 -1
  82. package/dist/modules/semantic.js +0 -289
  83. package/dist/modules/semantic.js.map +0 -1
  84. package/dist/modules/session.d.ts +0 -70
  85. package/dist/modules/session.d.ts.map +0 -1
  86. package/dist/modules/session.js +0 -163
  87. package/dist/modules/session.js.map +0 -1
  88. package/dist/rule-scaffolder.d.ts +0 -39
  89. package/dist/rule-scaffolder.d.ts.map +0 -1
  90. package/dist/rule-scaffolder.js +0 -171
  91. package/dist/rule-scaffolder.js.map +0 -1
  92. package/dist/session-tracker.d.ts +0 -56
  93. package/dist/session-tracker.d.ts.map +0 -1
  94. package/dist/session-tracker.js +0 -175
  95. package/dist/session-tracker.js.map +0 -1
  96. package/dist/skill-fingerprint.d.ts +0 -96
  97. package/dist/skill-fingerprint.d.ts.map +0 -1
  98. package/dist/skill-fingerprint.js +0 -336
  99. package/dist/skill-fingerprint.js.map +0 -1
  100. package/dist/types.d.ts +0 -211
  101. package/dist/types.d.ts.map +0 -1
  102. package/dist/types.js +0 -6
  103. package/dist/types.js.map +0 -1
  104. package/rules/agent-manipulation/ATR-2026-00030-cross-agent-attack.yaml +0 -177
  105. package/rules/agent-manipulation/ATR-2026-00032-goal-hijacking.yaml +0 -137
  106. package/rules/agent-manipulation/ATR-2026-00074-cross-agent-privilege-escalation.yaml +0 -117
  107. package/rules/agent-manipulation/ATR-2026-00076-inter-agent-message-spoofing.yaml +0 -167
  108. package/rules/agent-manipulation/ATR-2026-00077-human-trust-exploitation.yaml +0 -146
  109. package/rules/agent-manipulation/ATR-2026-00108-consensus-sybil-attack.yaml +0 -105
  110. package/rules/agent-manipulation/ATR-2026-00116-a2a-message-validation.yaml +0 -92
  111. package/rules/agent-manipulation/ATR-2026-00117-agent-identity-spoofing.yaml +0 -92
  112. package/rules/agent-manipulation/ATR-2026-00118-approval-fatigue.yaml +0 -89
  113. package/rules/agent-manipulation/ATR-2026-00119-social-engineering-via-agent.yaml +0 -89
  114. package/rules/agent-manipulation/ATR-2026-00132-casual-authority-escalation.yaml +0 -99
  115. package/rules/agent-manipulation/ATR-2026-00139-casual-authority-redirect.yaml +0 -53
  116. package/rules/context-exfiltration/ATR-2026-00020-system-prompt-leak.yaml +0 -177
  117. package/rules/context-exfiltration/ATR-2026-00021-api-key-exposure.yaml +0 -178
  118. package/rules/context-exfiltration/ATR-2026-00075-agent-memory-manipulation.yaml +0 -117
  119. package/rules/context-exfiltration/ATR-2026-00102-disguised-analytics-exfiltration.yaml +0 -71
  120. package/rules/context-exfiltration/ATR-2026-00113-credential-theft.yaml +0 -89
  121. package/rules/context-exfiltration/ATR-2026-00114-oauth-token-abuse.yaml +0 -89
  122. package/rules/context-exfiltration/ATR-2026-00115-env-var-harvesting.yaml +0 -90
  123. package/rules/context-exfiltration/ATR-2026-00136-tool-response-data-piggyback.yaml +0 -100
  124. package/rules/context-exfiltration/ATR-2026-00141-example-format-key-leak.yaml +0 -52
  125. package/rules/context-exfiltration/ATR-2026-00142-piggyback-transition-words.yaml +0 -55
  126. package/rules/context-exfiltration/ATR-2026-00145-obfuscated-key-disclosure.yaml +0 -49
  127. package/rules/context-exfiltration/ATR-2026-00146-env-var-existence-probe.yaml +0 -49
  128. package/rules/data-poisoning/ATR-2026-00070-data-poisoning.yaml +0 -162
  129. package/rules/excessive-autonomy/ATR-2026-00050-runaway-agent-loop.yaml +0 -136
  130. package/rules/excessive-autonomy/ATR-2026-00051-resource-exhaustion.yaml +0 -139
  131. package/rules/excessive-autonomy/ATR-2026-00052-cascading-failure.yaml +0 -155
  132. package/rules/excessive-autonomy/ATR-2026-00098-unauthorized-financial-action.yaml +0 -157
  133. package/rules/excessive-autonomy/ATR-2026-00099-high-risk-tool-gate.yaml +0 -176
  134. package/rules/model-security/ATR-2026-00072-model-behavior-extraction.yaml +0 -117
  135. package/rules/model-security/ATR-2026-00073-malicious-finetuning-data.yaml +0 -110
  136. package/rules/privilege-escalation/ATR-2026-00040-privilege-escalation.yaml +0 -177
  137. package/rules/privilege-escalation/ATR-2026-00041-scope-creep.yaml +0 -126
  138. package/rules/privilege-escalation/ATR-2026-00107-delayed-execution-bypass.yaml +0 -69
  139. package/rules/privilege-escalation/ATR-2026-00110-eval-injection.yaml +0 -92
  140. package/rules/privilege-escalation/ATR-2026-00111-shell-escape.yaml +0 -93
  141. package/rules/privilege-escalation/ATR-2026-00112-dynamic-import-exploitation.yaml +0 -89
  142. package/rules/privilege-escalation/ATR-2026-00143-casual-privilege-escalation.yaml +0 -53
  143. package/rules/privilege-escalation/ATR-2026-00144-rationalized-safety-bypass.yaml +0 -49
  144. package/rules/prompt-injection/ATR-2026-00001-direct-prompt-injection.yaml +0 -563
  145. package/rules/prompt-injection/ATR-2026-00002-indirect-prompt-injection.yaml +0 -216
  146. package/rules/prompt-injection/ATR-2026-00003-jailbreak-attempt.yaml +0 -397
  147. package/rules/prompt-injection/ATR-2026-00004-system-prompt-override.yaml +0 -308
  148. package/rules/prompt-injection/ATR-2026-00005-multi-turn-injection.yaml +0 -183
  149. package/rules/prompt-injection/ATR-2026-00080-encoding-evasion.yaml +0 -88
  150. package/rules/prompt-injection/ATR-2026-00081-semantic-multi-turn.yaml +0 -85
  151. package/rules/prompt-injection/ATR-2026-00082-fingerprint-evasion.yaml +0 -84
  152. package/rules/prompt-injection/ATR-2026-00083-indirect-tool-injection.yaml +0 -87
  153. package/rules/prompt-injection/ATR-2026-00084-structured-data-injection.yaml +0 -86
  154. package/rules/prompt-injection/ATR-2026-00085-audit-evasion.yaml +0 -84
  155. package/rules/prompt-injection/ATR-2026-00086-visual-spoofing.yaml +0 -88
  156. package/rules/prompt-injection/ATR-2026-00087-rule-probing.yaml +0 -82
  157. package/rules/prompt-injection/ATR-2026-00088-adaptive-countermeasure.yaml +0 -84
  158. package/rules/prompt-injection/ATR-2026-00089-polymorphic-skill.yaml +0 -85
  159. package/rules/prompt-injection/ATR-2026-00090-threat-intel-exfil.yaml +0 -84
  160. package/rules/prompt-injection/ATR-2026-00091-nested-payload.yaml +0 -88
  161. package/rules/prompt-injection/ATR-2026-00092-consensus-poisoning.yaml +0 -92
  162. package/rules/prompt-injection/ATR-2026-00093-gradual-escalation.yaml +0 -86
  163. package/rules/prompt-injection/ATR-2026-00094-audit-bypass.yaml +0 -86
  164. package/rules/prompt-injection/ATR-2026-00097-cjk-injection-patterns.yaml +0 -339
  165. package/rules/prompt-injection/ATR-2026-00104-persona-hijacking.yaml +0 -74
  166. package/rules/prompt-injection/ATR-2026-00130-indirect-authority-claim.yaml +0 -97
  167. package/rules/prompt-injection/ATR-2026-00131-fictional-academic-framing.yaml +0 -93
  168. package/rules/prompt-injection/ATR-2026-00133-paraphrase-injection.yaml +0 -111
  169. package/rules/prompt-injection/ATR-2026-00137-authority-claim-injection.yaml +0 -52
  170. package/rules/prompt-injection/ATR-2026-00138-fictional-framing-bypass.yaml +0 -51
  171. package/rules/prompt-injection/ATR-2026-00140-indirect-reference-reversal.yaml +0 -52
  172. package/rules/prompt-injection/ATR-2026-00148-language-switch-injection.yaml +0 -71
  173. package/rules/skill-compromise/ATR-2026-00060-skill-impersonation.yaml +0 -155
  174. package/rules/skill-compromise/ATR-2026-00061-description-behavior-mismatch.yaml +0 -100
  175. package/rules/skill-compromise/ATR-2026-00062-hidden-capability.yaml +0 -98
  176. package/rules/skill-compromise/ATR-2026-00063-skill-chain-attack.yaml +0 -99
  177. package/rules/skill-compromise/ATR-2026-00064-over-permissioned-skill.yaml +0 -117
  178. package/rules/skill-compromise/ATR-2026-00065-skill-update-attack.yaml +0 -95
  179. package/rules/skill-compromise/ATR-2026-00066-parameter-injection.yaml +0 -108
  180. package/rules/skill-compromise/ATR-2026-00120-skill-instruction-injection.yaml +0 -121
  181. package/rules/skill-compromise/ATR-2026-00121-skill-dangerous-script.yaml +0 -165
  182. package/rules/skill-compromise/ATR-2026-00122-skill-weaponized-instruction.yaml +0 -114
  183. package/rules/skill-compromise/ATR-2026-00123-skill-overreach-permissions.yaml +0 -118
  184. package/rules/skill-compromise/ATR-2026-00124-skill-name-squatting.yaml +0 -98
  185. package/rules/skill-compromise/ATR-2026-00125-context-poisoning-compaction.yaml +0 -93
  186. package/rules/skill-compromise/ATR-2026-00126-skill-rug-pull-setup.yaml +0 -99
  187. package/rules/skill-compromise/ATR-2026-00127-subcommand-overflow.yaml +0 -74
  188. package/rules/skill-compromise/ATR-2026-00128-html-comment-hidden-payload.yaml +0 -79
  189. package/rules/skill-compromise/ATR-2026-00129-unicode-smuggling.yaml +0 -73
  190. package/rules/skill-compromise/ATR-2026-00134-fork-claim-impersonation.yaml +0 -86
  191. package/rules/skill-compromise/ATR-2026-00135-exfil-url-in-instructions.yaml +0 -82
  192. package/rules/skill-compromise/ATR-2026-00147-fork-impersonation.yaml +0 -48
  193. package/rules/tool-poisoning/ATR-2026-00010-mcp-malicious-response.yaml +0 -239
  194. package/rules/tool-poisoning/ATR-2026-00011-tool-output-injection.yaml +0 -196
  195. package/rules/tool-poisoning/ATR-2026-00012-unauthorized-tool-call.yaml +0 -201
  196. package/rules/tool-poisoning/ATR-2026-00013-tool-ssrf.yaml +0 -219
  197. package/rules/tool-poisoning/ATR-2026-00095-supply-chain-poisoning.yaml +0 -93
  198. package/rules/tool-poisoning/ATR-2026-00096-registry-poisoning.yaml +0 -95
  199. package/rules/tool-poisoning/ATR-2026-00100-consent-bypass-instruction.yaml +0 -82
  200. package/rules/tool-poisoning/ATR-2026-00101-trust-escalation-override.yaml +0 -68
  201. package/rules/tool-poisoning/ATR-2026-00103-hidden-safety-bypass-instruction.yaml +0 -73
  202. package/rules/tool-poisoning/ATR-2026-00105-silent-action-concealment.yaml +0 -69
  203. package/rules/tool-poisoning/ATR-2026-00106-schema-description-contradiction.yaml +0 -68
  204. package/spec/atr-schema.yaml +0 -404
@@ -0,0 +1,594 @@
1
+ # ATR Schema Specification
2
+
3
+ Version: 0.1
4
+
5
+ This document defines every field in the ATR (Agent Threat Rules) schema. The canonical schema file is `spec/atr-schema.yaml`.
6
+
7
+ ---
8
+
9
+ ## Document Structure
10
+
11
+ An ATR rule is a single YAML document. The top-level structure:
12
+
13
+ ```yaml
14
+ # Metadata
15
+ title: string # required
16
+ id: string # required, format: ATR-YYYY-NNN
17
+ status: string # required, enum
18
+ description: string # required
19
+ author: string # required
20
+ date: string # required, format: YYYY/MM/DD
21
+ modified: string # optional, format: YYYY/MM/DD
22
+ schema_version: string # required
23
+
24
+ # Classification
25
+ detection_tier: string # required, enum
26
+ maturity: string # required, enum
27
+ severity: string # required, enum
28
+
29
+ # References
30
+ references: object # optional
31
+
32
+ # Tags
33
+ tags: object # required
34
+
35
+ # Agent Source
36
+ agent_source: object # required
37
+
38
+ # Detection
39
+ detection: object # required
40
+
41
+ # Response
42
+ response: object # required
43
+
44
+ # Test Cases
45
+ test_cases: object # optional (required for PR acceptance)
46
+
47
+ # Evasion Tests
48
+ evasion_tests: array # optional
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Metadata Fields
54
+
55
+ ### title
56
+
57
+ | Property | Value |
58
+ | ----------- | ---------------------------------------------------------------------------------------- |
59
+ | Type | `string` |
60
+ | Required | Yes |
61
+ | Description | Human-readable rule name. Should describe what the rule detects, not the attack category |
62
+ | Example | `"Direct Prompt Injection via User Input"` |
63
+
64
+ ### id
65
+
66
+ | Property | Value |
67
+ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68
+ | Type | `string` |
69
+ | Required | Yes |
70
+ | Pattern | `^ATR-\d{4}-\d{3}$` |
71
+ | Description | Unique rule identifier. Format: `ATR-YYYY-NNN` where YYYY is the year and NNN is a sequential number. Use a placeholder for drafts; maintainers assign final IDs |
72
+ | Example | `"ATR-2026-001"` |
73
+
74
+ ### status
75
+
76
+ | Property | Value |
77
+ | ----------- | ----------------------------------------------- |
78
+ | Type | `string` |
79
+ | Required | Yes |
80
+ | Enum | `draft`, `experimental`, `stable`, `deprecated` |
81
+ | Description | Rule lifecycle status |
82
+
83
+ Status meanings:
84
+
85
+ | Status | Meaning |
86
+ | -------------- | ------------------------------------------- |
87
+ | `draft` | Work in progress, not ready for testing |
88
+ | `experimental` | New rule, may have high false positive rate |
89
+ | `stable` | Validated in production, reliable detection |
90
+ | `deprecated` | Replaced or no longer relevant |
91
+
92
+ ### description
93
+
94
+ | Property | Value |
95
+ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
96
+ | Type | `string` |
97
+ | Required | Yes |
98
+ | Description | Detailed description of the attack this rule detects. Should explain what IS detected and what IS NOT detectable by this rule. Use YAML `\|` for multi-line |
99
+ | Example | `"Detects direct prompt injection attempts where a user embeds malicious instructions. Note: Cannot detect paraphrased attacks."` |
100
+
101
+ ### author
102
+
103
+ | Property | Value |
104
+ | ----------- | ----------------------------------------- |
105
+ | Type | `string` |
106
+ | Required | Yes |
107
+ | Description | Rule author name, handle, or organization |
108
+ | Example | `"Panguard AI"`, `"@security_researcher"` |
109
+
110
+ ### date
111
+
112
+ | Property | Value |
113
+ | ----------- | --------------------- |
114
+ | Type | `string` |
115
+ | Required | Yes |
116
+ | Pattern | `^\d{4}/\d{2}/\d{2}$` |
117
+ | Description | Creation date |
118
+ | Example | `"2026/03/11"` |
119
+
120
+ ### modified
121
+
122
+ | Property | Value |
123
+ | ----------- | ---------------------- |
124
+ | Type | `string` |
125
+ | Required | No |
126
+ | Pattern | `^\d{4}/\d{2}/\d{2}$` |
127
+ | Description | Last modification date |
128
+ | Example | `"2026/03/15"` |
129
+
130
+ ### schema_version
131
+
132
+ | Property | Value |
133
+ | ----------- | ---------------------------------------- |
134
+ | Type | `string` |
135
+ | Required | Yes |
136
+ | Description | ATR schema version this rule conforms to |
137
+ | Example | `"0.1"` |
138
+
139
+ ---
140
+
141
+ ## Classification Fields
142
+
143
+ ### detection_tier
144
+
145
+ | Property | Value |
146
+ | -------- | ----------------------------------- |
147
+ | Type | `string` |
148
+ | Required | Yes |
149
+ | Enum | `pattern`, `behavioral`, `protocol` |
150
+
151
+ | Tier | Description | Detection Method |
152
+ | ------------ | -------------------------------------------- | ---------------------------------------------------------------------------- |
153
+ | `pattern` | Regex-based pattern matching on text content | String operators: `regex`, `contains`, `exact`, `starts_with` |
154
+ | `behavioral` | Threshold-based detection on agent metrics | Numeric operators: `gt`, `lt`, `eq`, `gte`, `lte`, `deviation_from_baseline` |
155
+ | `protocol` | Multi-step sequence detection across events | Ordered/unordered step sequences within time windows |
156
+
157
+ ### maturity
158
+
159
+ | Property | Value |
160
+ | -------- | ---------------------------------------------- |
161
+ | Type | `string` |
162
+ | Required | Yes |
163
+ | Enum | `experimental`, `test`, `stable`, `deprecated` |
164
+
165
+ | Maturity | Meaning |
166
+ | -------------- | ------------------------------------------------------- |
167
+ | `experimental` | New rule, limited testing |
168
+ | `test` | Validated against test cases, not yet production-proven |
169
+ | `stable` | Production-validated, low false positive rate |
170
+ | `deprecated` | Superseded or no longer applicable |
171
+
172
+ ### severity
173
+
174
+ | Property | Value |
175
+ | -------- | ---------------------------------------------------- |
176
+ | Type | `string` |
177
+ | Required | Yes |
178
+ | Enum | `critical`, `high`, `medium`, `low`, `informational` |
179
+
180
+ See the rule writing guide for severity calibration criteria.
181
+
182
+ ---
183
+
184
+ ## References
185
+
186
+ | Property | Value |
187
+ | -------- | ----------------------------------- |
188
+ | Type | `object` |
189
+ | Required | No (but required for PR acceptance) |
190
+
191
+ ### references.owasp_llm
192
+
193
+ | Property | Value |
194
+ | ----------- | ----------------------------------- |
195
+ | Type | `array` of `string` |
196
+ | Description | OWASP LLM Top 10 (2025) references |
197
+ | Example | `["LLM01:2025 - Prompt Injection"]` |
198
+
199
+ ### references.owasp_agentic
200
+
201
+ | Property | Value |
202
+ | ----------- | ------------------------------------------------------- |
203
+ | Type | `array` of `string` |
204
+ | Description | OWASP Top 10 for Agentic Applications (2026) references |
205
+ | Example | `["ASI01:2026 - Agent Goal Hijack"]` |
206
+
207
+ ### references.mitre_atlas
208
+
209
+ | Property | Value |
210
+ | ----------- | -------------------------------------- |
211
+ | Type | `array` of `string` |
212
+ | Description | MITRE ATLAS technique IDs |
213
+ | Example | `["AML.T0051 - LLM Prompt Injection"]` |
214
+
215
+ ### references.mitre_attack
216
+
217
+ | Property | Value |
218
+ | ----------- | --------------------------------------------------------------------- |
219
+ | Type | `array` of `string` |
220
+ | Description | MITRE ATT&CK technique IDs (when traditional attack techniques apply) |
221
+ | Example | `["T1059 - Command and Scripting Interpreter"]` |
222
+
223
+ ### references.cve
224
+
225
+ | Property | Value |
226
+ | ----------- | -------------------------------------- |
227
+ | Type | `array` of `string` |
228
+ | Description | Related CVE identifiers |
229
+ | Example | `["CVE-2025-53773", "CVE-2025-32711"]` |
230
+
231
+ ---
232
+
233
+ ## Tags
234
+
235
+ | Property | Value |
236
+ | -------- | -------- |
237
+ | Type | `object` |
238
+ | Required | Yes |
239
+
240
+ ### tags.category
241
+
242
+ | Property | Value |
243
+ | -------- | --------- |
244
+ | Type | `string` |
245
+ | Required | Yes |
246
+ | Enum | See below |
247
+
248
+ | Category | Description |
249
+ | ---------------------- | ----------------------------------------------------------------- |
250
+ | `prompt-injection` | User/external input overrides agent instructions |
251
+ | `tool-poisoning` | Tool responses contain malicious content |
252
+ | `context-exfiltration` | Agent leaks system prompt, API keys, or internal data |
253
+ | `agent-manipulation` | One agent manipulates another agent's behavior |
254
+ | `privilege-escalation` | Agent accesses resources beyond authorized scope |
255
+ | `excessive-autonomy` | Agent operates beyond intended boundaries |
256
+ | `data-poisoning` | Training or retrieval data has been tampered with |
257
+ | `model-abuse` | Model weights, behavior, or training pipeline are targeted |
258
+ | `skill-compromise` | MCP skills/tools are impersonated, hijacked, or over-permissioned |
259
+
260
+ ### tags.subcategory
261
+
262
+ | Property | Value |
263
+ | ----------- | ------------------------------------------------------------------ |
264
+ | Type | `string` |
265
+ | Required | No |
266
+ | Description | More specific classification within the category. Free-form string |
267
+ | Example | `"direct"`, `"indirect"`, `"mcp-response"`, `"system-prompt"` |
268
+
269
+ ### tags.confidence
270
+
271
+ | Property | Value |
272
+ | ----------- | --------------------------------------------------- |
273
+ | Type | `string` |
274
+ | Required | No |
275
+ | Enum | `high`, `medium`, `low` |
276
+ | Description | Expected accuracy. `high` = low false positive rate |
277
+
278
+ ---
279
+
280
+ ## Agent Source
281
+
282
+ | Property | Value |
283
+ | -------- | -------- |
284
+ | Type | `object` |
285
+ | Required | Yes |
286
+
287
+ Defines what kind of agent data this rule inspects. Analogous to Sigma's `logsource`.
288
+
289
+ ### agent_source.type
290
+
291
+ | Property | Value |
292
+ | -------- | --------- |
293
+ | Type | `string` |
294
+ | Required | Yes |
295
+ | Enum | See below |
296
+
297
+ | Type | Description | Typical Fields |
298
+ | ------------------ | ---------------------------------- | ---------------------------- |
299
+ | `llm_io` | LLM input/output text | `user_input`, `agent_output` |
300
+ | `tool_call` | Tool/function invocations | `tool_name`, `tool_args` |
301
+ | `mcp_exchange` | MCP protocol messages | `tool_response` |
302
+ | `agent_behavior` | Agent behavioral metrics | metrics (numeric) |
303
+ | `multi_agent_comm` | Inter-agent communication | `agent_message`, `content` |
304
+ | `context_window` | Context window contents | `content` |
305
+ | `memory_access` | Agent memory operations | `content` |
306
+ | `skill_lifecycle` | Skill install/update/remove events | `content`, `tool_name` |
307
+ | `skill_permission` | Skill permission requests | `content`, `tool_name` |
308
+ | `skill_chain` | Multi-skill execution sequences | `content`, `tool_name` |
309
+
310
+ ### agent_source.framework
311
+
312
+ | Property | Value |
313
+ | ----------- | ------------------------------------------- |
314
+ | Type | `array` of `string` |
315
+ | Required | No |
316
+ | Description | AI frameworks this rule applies to |
317
+ | Example | `["langchain", "crewai", "autogen", "any"]` |
318
+
319
+ ### agent_source.provider
320
+
321
+ | Property | Value |
322
+ | ----------- | ------------------------------------------ |
323
+ | Type | `array` of `string` |
324
+ | Required | No |
325
+ | Description | LLM providers this rule applies to |
326
+ | Example | `["openai", "anthropic", "ollama", "any"]` |
327
+
328
+ ---
329
+
330
+ ## Detection
331
+
332
+ | Property | Value |
333
+ | -------- | -------- |
334
+ | Type | `object` |
335
+ | Required | Yes |
336
+
337
+ ### detection.conditions (Array Format)
338
+
339
+ | Property | Value |
340
+ | -------- | ---------------------------- |
341
+ | Type | `array` of condition objects |
342
+
343
+ Each condition object:
344
+
345
+ | Field | Type | Required | Description |
346
+ | ------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
347
+ | `field` | `string` | Yes | Field to inspect (`user_input`, `agent_output`, `tool_name`, `tool_args`, `tool_response`, `content`, `agent_message`) |
348
+ | `operator` | `string` | Yes | Match operator: `regex`, `contains`, `exact`, `starts_with` |
349
+ | `value` | `string` | Yes | Pattern to match. For `regex` operator, this is a regex string |
350
+ | `description` | `string` | No | Human-readable description of what this condition detects |
351
+
352
+ Example:
353
+
354
+ ```yaml
355
+ conditions:
356
+ - field: user_input
357
+ operator: regex
358
+ value: "(?i)\\bignore\\b\\s+\\bprevious\\b"
359
+ description: 'Ignore-previous-instructions pattern'
360
+ ```
361
+
362
+ ### detection.conditions (Named-Map Format)
363
+
364
+ | Property | Value |
365
+ | -------- | ------------------------------------------ |
366
+ | Type | `object` (string keys to condition blocks) |
367
+
368
+ Each named condition block can be one of:
369
+
370
+ **Pattern condition:**
371
+
372
+ | Field | Type | Required | Description |
373
+ | ---------------- | ------------------- | -------- | ------------------------------------------- |
374
+ | `field` | `string` | Yes | Field to inspect |
375
+ | `patterns` | `array` of `string` | Yes | Patterns to match |
376
+ | `match_type` | `string` | Yes | `contains`, `regex`, `exact`, `starts_with` |
377
+ | `case_sensitive` | `boolean` | No | Default: `false` |
378
+
379
+ **Behavioral condition:**
380
+
381
+ | Field | Type | Required | Description |
382
+ | ----------- | -------- | -------- | ---------------------------------------------------------------------------------------- |
383
+ | `metric` | `string` | Yes | Behavioral metric name (`tool_call_frequency`, `pattern_frequency`, `event_count`, etc.) |
384
+ | `operator` | `string` | Yes | `gt`, `lt`, `eq`, `gte`, `lte`, `deviation_from_baseline` |
385
+ | `threshold` | `number` | Yes | Numeric threshold value |
386
+ | `window` | `string` | No | Time window (e.g., `"5m"`, `"1h"`, `"30s"`) |
387
+
388
+ **Sequence condition:**
389
+
390
+ | Field | Type | Required | Description |
391
+ | --------- | ----------------------- | -------- | ------------------------------------------------------- |
392
+ | `ordered` | `boolean` | Yes | Whether steps must occur in order |
393
+ | `within` | `string` | Yes | Maximum time span for the full sequence (e.g., `"10m"`) |
394
+ | `steps` | `array` of step objects | Yes | Ordered list of conditions forming the attack sequence |
395
+
396
+ Each step object:
397
+
398
+ | Field | Type | Description |
399
+ | ------------ | ------------------- | --------------------------------------- |
400
+ | `field` | `string` | Field to inspect |
401
+ | `patterns` | `array` of `string` | Patterns to match |
402
+ | `match_type` | `string` | Match operator |
403
+ | `metric` | `string` | Behavioral metric (for threshold steps) |
404
+ | `operator` | `string` | Comparison operator |
405
+ | `threshold` | `number` | Numeric threshold |
406
+
407
+ ### detection.condition
408
+
409
+ | Property | Value |
410
+ | ----------- | ------------------------- |
411
+ | Type | `string` |
412
+ | Required | Yes |
413
+ | Description | How to combine conditions |
414
+
415
+ For array format:
416
+
417
+ | Value | Meaning |
418
+ | -------------- | ------------------------------------ |
419
+ | `any` or `or` | Trigger if ANY condition matches |
420
+ | `all` or `and` | Trigger only if ALL conditions match |
421
+
422
+ For named-map format: Boolean expression referencing condition names.
423
+
424
+ ```yaml
425
+ condition: 'pattern_match AND (frequency_check OR sequence_detect)'
426
+ ```
427
+
428
+ ### detection.false_positives
429
+
430
+ | Property | Value |
431
+ | ----------- | ------------------------------------------------------------------------------------------- |
432
+ | Type | `array` of `string` |
433
+ | Required | No |
434
+ | Description | Known scenarios that may trigger false positives |
435
+ | Example | `["Security researchers testing defenses", "Users discussing prompt injection as a topic"]` |
436
+
437
+ ---
438
+
439
+ ## Response
440
+
441
+ | Property | Value |
442
+ | -------- | -------- |
443
+ | Type | `object` |
444
+ | Required | Yes |
445
+
446
+ ### response.actions
447
+
448
+ | Property | Value |
449
+ | ----------- | ------------------- |
450
+ | Type | `array` of `string` |
451
+ | Required | Yes |
452
+ | Enum values | See below |
453
+
454
+ | Action | Description |
455
+ | -------------------- | ------------------------------------------- |
456
+ | `block_input` | Reject the user/agent input |
457
+ | `block_output` | Suppress the agent output |
458
+ | `block_tool` | Prevent the tool call from executing |
459
+ | `quarantine_session` | Isolate the entire session |
460
+ | `reset_context` | Clear agent context/memory |
461
+ | `alert` | Send alert to security team |
462
+ | `snapshot` | Capture full session state for forensics |
463
+ | `escalate` | Escalate to human reviewer |
464
+ | `reduce_permissions` | Reduce agent's available tools/capabilities |
465
+ | `kill_agent` | Terminate the agent process |
466
+
467
+ ### response.auto_response_threshold
468
+
469
+ | Property | Value |
470
+ | ----------- | ---------------------------------------------------------------------------------------------------------------- |
471
+ | Type | `string` |
472
+ | Required | No |
473
+ | Enum | `low`, `medium`, `high`, `critical` |
474
+ | Description | Severity threshold for automatic response. Below this threshold, only alert; above, execute all response actions |
475
+
476
+ ### response.message_template
477
+
478
+ | Property | Value |
479
+ | ----------- | --------------------------- |
480
+ | Type | `string` |
481
+ | Required | No |
482
+ | Description | Template for alert messages |
483
+
484
+ Supported placeholders:
485
+
486
+ | Placeholder | Description |
487
+ | --------------------- | ------------------------------------ |
488
+ | `{matched_pattern}` | The pattern that triggered the match |
489
+ | `{truncated_input}` | First N characters of the input |
490
+ | `{truncated_output}` | First N characters of the output |
491
+ | `{source_ip_or_user}` | Source identifier |
492
+ | `{tool_name}` | Name of the tool involved |
493
+ | `{mcp_server_url}` | MCP server URL |
494
+ | `{rule_id}` | The ATR rule ID |
495
+ | `{severity}` | The rule's severity level |
496
+ | `{session_id}` | Session identifier |
497
+
498
+ ---
499
+
500
+ ## Test Cases
501
+
502
+ | Property | Value |
503
+ | -------- | ----------------------------------- |
504
+ | Type | `object` |
505
+ | Required | No (but required for PR acceptance) |
506
+
507
+ ### test_cases.true_positives
508
+
509
+ | Property | Value |
510
+ | -------- | ---------------------------- |
511
+ | Type | `array` of test case objects |
512
+
513
+ Each test case:
514
+
515
+ | Field | Type | Required | Description |
516
+ | --------------- | -------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
517
+ | `input` | `string` | Conditional | User input text. Required for `llm_io` rules. Can also be an object with `tool_name`, `tool_args`, `response` fields for tool-based rules |
518
+ | `tool_response` | `string` | Conditional | Tool/MCP response text. Required for `mcp_exchange` rules |
519
+ | `agent_output` | `string` | Conditional | Agent output text |
520
+ | `tool_name` | `string` | No | Tool name for `tool_call` rules |
521
+ | `tool_args` | `string` | No | Tool arguments |
522
+ | `expected` | `string` | Yes | Must be `"triggered"` |
523
+ | `description` | `string` | No | Why this test case should trigger |
524
+
525
+ ### test_cases.true_negatives
526
+
527
+ Same structure as `true_positives`, except `expected` must be `"not_triggered"`.
528
+
529
+ ---
530
+
531
+ ## Evasion Tests
532
+
533
+ | Property | Value |
534
+ | -------- | ------------------------------- |
535
+ | Type | `array` of evasion test objects |
536
+ | Required | No |
537
+
538
+ Each evasion test:
539
+
540
+ | Field | Type | Required | Description |
541
+ | ------------------ | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
542
+ | `input` | `string` | Yes | The evasion attempt input |
543
+ | `expected` | `string` | Yes | `"triggered"` or `"not_triggered"` |
544
+ | `bypass_technique` | `string` | Yes | Technique name: `paraphrase`, `language_switch`, `indirect_reference`, `encoding`, `social_engineering`, `fictional_framing` |
545
+ | `notes` | `string` | No | Why this evasion works or does not work |
546
+
547
+ ---
548
+
549
+ ## Complete Minimal Example
550
+
551
+ ```yaml
552
+ title: 'Example Detection Rule'
553
+ id: ATR-2026-999
554
+ status: experimental
555
+ description: |
556
+ Minimal example demonstrating all required fields.
557
+ author: 'ATR Community'
558
+ date: '2026/03/11'
559
+ schema_version: '0.1'
560
+ detection_tier: pattern
561
+ maturity: experimental
562
+ severity: medium
563
+
564
+ references:
565
+ owasp_llm:
566
+ - 'LLM01:2025 - Prompt Injection'
567
+
568
+ tags:
569
+ category: prompt-injection
570
+ confidence: medium
571
+
572
+ agent_source:
573
+ type: llm_io
574
+
575
+ detection:
576
+ conditions:
577
+ - field: user_input
578
+ operator: regex
579
+ value: "(?i)\\bexample\\s+attack\\s+pattern\\b"
580
+ condition: any
581
+ false_positives:
582
+ - "Legitimate use of the phrase 'example attack pattern' in documentation"
583
+
584
+ response:
585
+ actions: [alert]
586
+
587
+ test_cases:
588
+ true_positives:
589
+ - input: 'This is an example attack pattern for testing'
590
+ expected: triggered
591
+ true_negatives:
592
+ - input: 'Normal conversation without attack indicators'
593
+ expected: not_triggered
594
+ ```