agent-threat-rules 2.1.5 → 3.0.5

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 (172) hide show
  1. package/README.md +365 -327
  2. package/dist/engine.d.ts +46 -1
  3. package/dist/engine.d.ts.map +1 -1
  4. package/dist/engine.js +242 -1
  5. package/dist/engine.js.map +1 -1
  6. package/dist/eval/eval-harness.d.ts.map +1 -1
  7. package/dist/eval/eval-harness.js +9 -0
  8. package/dist/eval/eval-harness.js.map +1 -1
  9. package/dist/eval/run-hackaprompt-benchmark.js +9 -0
  10. package/dist/eval/run-hackaprompt-benchmark.js.map +1 -1
  11. package/dist/eval/run-pint-benchmark.js +9 -0
  12. package/dist/eval/run-pint-benchmark.js.map +1 -1
  13. package/dist/eval/skill-benchmark.d.ts +11 -0
  14. package/dist/eval/skill-benchmark.d.ts.map +1 -1
  15. package/dist/eval/skill-benchmark.js +57 -0
  16. package/dist/eval/skill-benchmark.js.map +1 -1
  17. package/dist/measurement/from-eval-harness.d.ts +70 -0
  18. package/dist/measurement/from-eval-harness.d.ts.map +1 -0
  19. package/dist/measurement/from-eval-harness.js +49 -0
  20. package/dist/measurement/from-eval-harness.js.map +1 -0
  21. package/dist/measurement/schema.d.ts +152 -0
  22. package/dist/measurement/schema.d.ts.map +1 -0
  23. package/dist/measurement/schema.js +178 -0
  24. package/dist/measurement/schema.js.map +1 -0
  25. package/dist/measurement/write.d.ts +64 -0
  26. package/dist/measurement/write.d.ts.map +1 -0
  27. package/dist/measurement/write.js +163 -0
  28. package/dist/measurement/write.js.map +1 -0
  29. package/dist/semantic-evaluator.d.ts +48 -0
  30. package/dist/semantic-evaluator.d.ts.map +1 -0
  31. package/dist/semantic-evaluator.js +107 -0
  32. package/dist/semantic-evaluator.js.map +1 -0
  33. package/dist/trace-evaluator.d.ts +22 -0
  34. package/dist/trace-evaluator.d.ts.map +1 -0
  35. package/dist/trace-evaluator.js +249 -0
  36. package/dist/trace-evaluator.js.map +1 -0
  37. package/dist/types.d.ts +143 -0
  38. package/dist/types.d.ts.map +1 -1
  39. package/package.json +5 -3
  40. package/rules/agent-manipulation/ATR-2026-00552-goal-drift-after-pressure-injection.yaml +216 -0
  41. package/rules/context-exfiltration/ATR-2026-00471-garak-sysprompt-extraction-mixedunassigned.yaml +126 -0
  42. package/rules/context-exfiltration/ATR-2026-00501-data-exfiltration-via-markdown-image-and-link-url-injection.yaml +173 -0
  43. package/rules/context-exfiltration/ATR-2026-00504-tool-and-function-capability-enumeration.yaml +164 -0
  44. package/rules/context-exfiltration/ATR-2026-00505-system-prompt-extraction-instruction-dump-request.yaml +178 -0
  45. package/rules/context-exfiltration/ATR-2026-00514-system-prompt-extraction.yaml +202 -0
  46. package/rules/context-exfiltration/ATR-2026-00516-output-xss-via-llm.yaml +180 -0
  47. package/rules/context-exfiltration/ATR-2026-00524-claude-code-anthropic-base-url-credential-exfil.yaml +257 -0
  48. package/rules/context-exfiltration/ATR-2026-00548-cross-agent-session-context-leak.yaml +177 -0
  49. package/rules/excessive-autonomy/ATR-2026-00491-garak-agent-breaker-markdown-just-raw-json.yaml +152 -0
  50. package/rules/excessive-autonomy/ATR-2026-00500-ssrf-via-agent-url-fetch-instruction.yaml +168 -0
  51. package/rules/excessive-autonomy/ATR-2026-00553-runaway-tool-loop-behavioral.yaml +174 -0
  52. package/rules/model-abuse/ATR-2026-00502-training-data-extraction-via-divergent-repetition-attack.yaml +158 -0
  53. package/rules/model-abuse/ATR-2026-00517-model-extraction-distillation.yaml +187 -0
  54. package/rules/privilege-escalation/ATR-2026-00528-praisonai-auth-disabled-default.yaml +192 -0
  55. package/rules/privilege-escalation/ATR-2026-00539-crewai-codeinterpreter-sandbox-escape-rce.yaml +292 -0
  56. package/rules/privilege-escalation/ATR-2026-00546-crewai-json-loader-local-file-read.yaml +162 -0
  57. package/rules/privilege-escalation/ATR-2026-00547-crewai-rag-url-ssrf-bypass.yaml +167 -0
  58. package/rules/privilege-escalation/ATR-2026-00549-destructive-tool-without-human-approval.yaml +193 -0
  59. package/rules/privilege-escalation/ATR-2026-00551-cross-conversation-memory-write.yaml +198 -0
  60. package/rules/prompt-injection/ATR-2026-00452-direct-pwned-payload-injection.yaml +172 -0
  61. package/rules/prompt-injection/ATR-2026-00453-secret-key-reveal-demand.yaml +165 -0
  62. package/rules/prompt-injection/ATR-2026-00454-backslash-per-character-encoding.yaml +162 -0
  63. package/rules/prompt-injection/ATR-2026-00455-no-period-output-override.yaml +153 -0
  64. package/rules/prompt-injection/ATR-2026-00456-conditional-empty-input-injection.yaml +168 -0
  65. package/rules/prompt-injection/ATR-2026-00457-garak-dan-to-every-prompt.yaml +160 -0
  66. package/rules/prompt-injection/ATR-2026-00458-garak-dra-step-by-step.yaml +143 -0
  67. package/rules/prompt-injection/ATR-2026-00459-garak-dan-an-ai-language.yaml +136 -0
  68. package/rules/prompt-injection/ATR-2026-00460-garak-dan-no-matter-how.yaml +162 -0
  69. package/rules/prompt-injection/ATR-2026-00461-garak-goodside-mixedunassigned.yaml +140 -0
  70. package/rules/prompt-injection/ATR-2026-00462-garak-gcg-mixedunassigned.yaml +141 -0
  71. package/rules/prompt-injection/ATR-2026-00463-garak-lmrc-mixedunassigned.yaml +142 -0
  72. package/rules/prompt-injection/ATR-2026-00464-garak-dan-i-would-like.yaml +139 -0
  73. package/rules/prompt-injection/ATR-2026-00465-garak-dan-your-prompt-here.yaml +145 -0
  74. package/rules/prompt-injection/ATR-2026-00466-garak-latentinjection-following-text-from.yaml +141 -0
  75. package/rules/prompt-injection/ATR-2026-00467-garak-dan-act-as-a.yaml +140 -0
  76. package/rules/prompt-injection/ATR-2026-00468-garak-goat-the-target-llm.yaml +141 -0
  77. package/rules/prompt-injection/ATR-2026-00469-garak-dan-at-the-end.yaml +140 -0
  78. package/rules/prompt-injection/ATR-2026-00470-garak-dan-as-an-ai.yaml +155 -0
  79. package/rules/prompt-injection/ATR-2026-00472-garak-dan-are-going-to.yaml +150 -0
  80. package/rules/prompt-injection/ATR-2026-00473-garak-lmrc-how-can-i.yaml +140 -0
  81. package/rules/prompt-injection/ATR-2026-00474-garak-dan-that-chatgpt-has.yaml +133 -0
  82. package/rules/prompt-injection/ATR-2026-00475-garak-web-injection-alert-1-script.yaml +136 -0
  83. package/rules/prompt-injection/ATR-2026-00476-garak-web-injection-javascript-alert-1.yaml +157 -0
  84. package/rules/prompt-injection/ATR-2026-00477-garak-latentinjection-translate-the-following-text.yaml +143 -0
  85. package/rules/prompt-injection/ATR-2026-00478-garak-latentinjection-abuse-contact-email.yaml +136 -0
  86. package/rules/prompt-injection/ATR-2026-00479-garak-latentinjection-mixedunassigned.yaml +146 -0
  87. package/rules/prompt-injection/ATR-2026-00480-garak-dan-the-role-of.yaml +137 -0
  88. package/rules/prompt-injection/ATR-2026-00481-garak-dan-mixedunassigned.yaml +153 -0
  89. package/rules/prompt-injection/ATR-2026-00482-garak-lmrc-what-s-an.yaml +128 -0
  90. package/rules/prompt-injection/ATR-2026-00483-garak-dan-the-user-s.yaml +141 -0
  91. package/rules/prompt-injection/ATR-2026-00484-garak-dan-and-you-will.yaml +138 -0
  92. package/rules/prompt-injection/ATR-2026-00485-garak-dan-and-does-not.yaml +141 -0
  93. package/rules/prompt-injection/ATR-2026-00486-garak-dan-t-care-about.yaml +125 -0
  94. package/rules/prompt-injection/ATR-2026-00487-garak-dan-and-nothing-else.yaml +134 -0
  95. package/rules/prompt-injection/ATR-2026-00488-garak-encoding-alert-1-script.yaml +137 -0
  96. package/rules/prompt-injection/ATR-2026-00489-garak-encoding-javascript-alert-1.yaml +158 -0
  97. package/rules/prompt-injection/ATR-2026-00490-garak-dan-in-order-to.yaml +158 -0
  98. package/rules/prompt-injection/ATR-2026-00492-garak-dan-want-you-to.yaml +156 -0
  99. package/rules/prompt-injection/ATR-2026-00493-garak-latentinjection-registrar-iana-id.yaml +158 -0
  100. package/rules/prompt-injection/ATR-2026-00495-garak-dan-insert-prompt-here.yaml +177 -0
  101. package/rules/prompt-injection/ATR-2026-00496-garak-dan-no-matter-what.yaml +148 -0
  102. package/rules/prompt-injection/ATR-2026-00497-garak-encoding-mixedunassigned.yaml +179 -0
  103. package/rules/prompt-injection/ATR-2026-00498-garak-web-injection-mixedunassigned.yaml +169 -0
  104. package/rules/prompt-injection/ATR-2026-00499-garak-dan-from-now-on.yaml +150 -0
  105. package/rules/prompt-injection/ATR-2026-00503-fake-error-state-takeover-unrestricted-replacement-bot.yaml +160 -0
  106. package/rules/prompt-injection/ATR-2026-00506-nevermind-override-goal-hijacking-in-user-input-promptinject.yaml +149 -0
  107. package/rules/prompt-injection/ATR-2026-00507-screaming-stop-goal-hijacking-in-user-input-promptinject.yaml +154 -0
  108. package/rules/prompt-injection/ATR-2026-00508-escape-delimiter-wrapped-goal-hijacking-in-user-input-prompt.yaml +154 -0
  109. package/rules/prompt-injection/ATR-2026-00509-prompt-leaking-via-ignore-previous-instructions-in-user-inpu.yaml +168 -0
  110. package/rules/prompt-injection/ATR-2026-00510-delayed-tool-invocation-injection.yaml +189 -0
  111. package/rules/prompt-injection/ATR-2026-00511-mcp-web-context-poisoning.yaml +185 -0
  112. package/rules/prompt-injection/ATR-2026-00512-rules-file-backdoor-injection.yaml +181 -0
  113. package/rules/prompt-injection/ATR-2026-00515-hidden-text-prompt-injection.yaml +194 -0
  114. package/rules/prompt-injection/ATR-2026-00518-ignore-previous-and-following-instructions-output-command-promptinject.yaml +154 -0
  115. package/rules/prompt-injection/ATR-2026-00519-tautology-logic-noise-injection-promptbench.yaml +151 -0
  116. package/rules/prompt-injection/ATR-2026-00520-nlp-task-random-token-suffix-injection-promptbench.yaml +153 -0
  117. package/rules/prompt-injection/ATR-2026-00535-windsurf-ide-zero-click-prompt-injection.yaml +199 -0
  118. package/rules/prompt-injection/ATR-2026-00550-untrusted-retrieval-to-privileged-tool.yaml +199 -0
  119. package/rules/skill-compromise/ATR-2026-00123-skill-overreach-permissions.yaml +5 -2
  120. package/rules/skill-compromise/ATR-2026-00523-claude-code-hooks-session-start-pre-trust-rce.yaml +221 -0
  121. package/rules/skill-compromise/ATR-2026-00525-mini-shai-hulud-gh-token-monitor-persistence.yaml +220 -0
  122. package/rules/skill-compromise/ATR-2026-00527-skill-silent-git-remote-mirror-exfiltration.yaml +201 -0
  123. package/rules/tool-poisoning/ATR-2026-00494-garak-exploitation-mixedunassigned.yaml +179 -0
  124. package/rules/tool-poisoning/ATR-2026-00513-package-hallucination-exploitation.yaml +167 -0
  125. package/rules/tool-poisoning/ATR-2026-00521-shell-command-injection-agent-tool-context.yaml +176 -0
  126. package/rules/tool-poisoning/ATR-2026-00522-sql-injection-natural-language-agent-interface.yaml +219 -0
  127. package/rules/tool-poisoning/ATR-2026-00526-claude-code-shell-metachar-in-double-quoted-path.yaml +167 -0
  128. package/rules/tool-poisoning/ATR-2026-00529-litellm-proxy-sqli-cisa-kev.yaml +158 -0
  129. package/rules/tool-poisoning/ATR-2026-00530-ms-agent-shell-tool-unsanitized-argv-rce.yaml +184 -0
  130. package/rules/tool-poisoning/ATR-2026-00531-praisonai-unauthenticated-agent-api.yaml +174 -0
  131. package/rules/tool-poisoning/ATR-2026-00532-apache-doris-mcp-sql-injection.yaml +155 -0
  132. package/rules/tool-poisoning/ATR-2026-00533-apache-pinot-mcp-unauthenticated-takeover.yaml +151 -0
  133. package/rules/tool-poisoning/ATR-2026-00534-alibaba-rds-mcp-unauthenticated-metadata-exfil.yaml +155 -0
  134. package/rules/tool-poisoning/ATR-2026-00536-nginx-ui-mcp-unauthenticated-command-execution.yaml +199 -0
  135. package/rules/tool-poisoning/ATR-2026-00537-fastmcp-server-name-cmd-injection-windows.yaml +226 -0
  136. package/rules/tool-poisoning/ATR-2026-00538-langchain-chatchat-mcp-stdio-unauthenticated-rce.yaml +244 -0
  137. package/rules/tool-poisoning/ATR-2026-00540-praisonai-parse-mcp-command-cli-injection.yaml +186 -0
  138. package/rules/tool-poisoning/ATR-2026-00541-agent-zero-mcp-config-command-injection.yaml +183 -0
  139. package/rules/tool-poisoning/ATR-2026-00542-upsonic-mcp-command-allowlist-bypass.yaml +166 -0
  140. package/rules/tool-poisoning/ATR-2026-00543-litellm-mcp-server-argv-injection.yaml +168 -0
  141. package/rules/tool-poisoning/ATR-2026-00544-praisonai-pth-file-path-traversal-rce.yaml +172 -0
  142. package/rules/tool-poisoning/ATR-2026-00545-praisonai-tool-override-unauth-rce.yaml +170 -0
  143. package/spec/README.md +279 -0
  144. package/spec/atr-correlation-v1.0.md +281 -0
  145. package/spec/atr-event-v1.0.md +294 -0
  146. package/spec/atr-language-detection-v1.0.md +218 -0
  147. package/spec/atr-method-v1.1.md +557 -0
  148. package/spec/atr-profile-v1.0.md +307 -0
  149. package/spec/atr-schema.yaml +279 -8
  150. package/spec/category-registry/v1.0.yaml +200 -0
  151. package/spec/conformance/README.md +244 -0
  152. package/spec/conformance/SIGNING.md +191 -0
  153. package/spec/conformance/baseline/fixtures/ATR-2026-00001-tp-001/expected.json +36 -0
  154. package/spec/conformance/baseline/fixtures/ATR-2026-00001-tp-001/input.json +16 -0
  155. package/spec/conformance/baseline/fixtures/README.md +120 -0
  156. package/spec/conformance/baseline/manifest.json +56 -0
  157. package/spec/conformance/expected-results.schema.json +121 -0
  158. package/spec/external-registries/cccs-yara.md +142 -0
  159. package/spec/internet-drafts/draft-lin-atr-core-00.html +1925 -0
  160. package/spec/internet-drafts/draft-lin-atr-core-00.md +288 -0
  161. package/spec/internet-drafts/draft-lin-atr-core-00.txt +560 -0
  162. package/spec/internet-drafts/draft-lin-atr-core-00.xml +424 -0
  163. package/spec/mappings/README.md +43 -0
  164. package/spec/mappings/atr-to-nist-csf-2.0.md +234 -0
  165. package/spec/schema/correlation.schema.json +144 -0
  166. package/spec/schema/event.schema.json +233 -0
  167. package/spec/schema/profile.schema.json +196 -0
  168. package/spec/schema/rule.schema.json +224 -0
  169. package/spec/stix-extension/README.md +76 -13
  170. package/spec/stix-extension/examples/atr-rule-trace-method-example.json +85 -0
  171. package/spec/stix-extension/extension-definition.json +23 -3
  172. package/spec/stix-extension/x-atr-rule-schema.json +107 -11
package/spec/README.md ADDED
@@ -0,0 +1,279 @@
1
+ # ATR Specification Index
2
+
3
+ **ATR — Agent Threat Rules**
4
+ **The open detection-rule standard for AI agent threats**
5
+
6
+ > **STATUS: PROPOSED v1.0 — NOT YET RATIFIED**
7
+ >
8
+ > The specifications in this directory are **drafts for community comment**
9
+ > in preparation for OASIS Open Project submission. They are NOT the current
10
+ > operating contract of the ATR engine. The TypeScript production engine at
11
+ > `npm:agent-threat-rules` continues to operate against the pre-spec-layer
12
+ > behavior — these documents describe the target state, not the current state.
13
+ >
14
+ > **No integration interface has changed.** Existing ecosystem integrations
15
+ > work unmodified. See `STANDARDIZATION-STATUS.md` at repo root for full
16
+ > proposed-vs-ratified-vs-implemented status.
17
+
18
+ **Status:** v1.0 — Draft for OASIS Open Project submission — NOT RATIFIED
19
+ **License:** CC BY 4.0 (spec docs and schemas); CC0 (conformance corpus); MIT (reference implementations); CC BY 4.0 (rules)
20
+ **Governance:** governance/CHARTER.md v2.0 (PROPOSED — TSC not yet formed)
21
+
22
+ ---
23
+
24
+ ## What ATR is, in one paragraph
25
+
26
+ ATR is an open machine-readable detection-rule standard for AI agent
27
+ threats. It is to AI agent security what Sigma is to SIEM detection,
28
+ YARA is to malware signatures, and CVE/CWE is to software
29
+ vulnerabilities. ATR rules are YAML files with declarative patterns
30
+ that any conformant engine can load and evaluate. The standard is
31
+ maintained by a 9-seat Technical Steering Committee (TSC) under
32
+ fiscal sponsorship of Open Source Collective Inc. The corpus is
33
+ licensed CC BY 4.0; reference implementations are MIT; conformance
34
+ test artifacts are CC0.
35
+
36
+ ---
37
+
38
+ ## What this folder contains
39
+
40
+ ```
41
+ spec/
42
+ ├── README.md ← you are here
43
+ ├── atr-schema.yaml ← (v0.1, existing) YAML rule schema
44
+ ├── compliance-metadata.md ← (existing) rule compliance field reference
45
+ ├── stix-extension/ ← (existing) STIX 2.1 extension bridge
46
+
47
+ ├── ATR-SPEC-v1.md ← (existing, repo root) rule format spec
48
+ ├── atr-language-detection-v1.0.md ← (new) deterministic language detection algorithm
49
+ ├── atr-event-v1.0.md ← (new) OTEL-compatible event format
50
+ ├── atr-profile-v1.0.md ← (new) rule-set composition for tiered conformance
51
+ ├── atr-correlation-v1.0.md ← (new) multi-event correlation rule format
52
+ ├── atr-method-v1.1.md ← (new) detection method extensions: signature/semantic/behavioral/trace
53
+ ├── mappings/ ← (new 2026-05-28) ATR → external framework crosswalk documents
54
+ │ ├── README.md ← mappings index
55
+ │ └── atr-to-nist-csf-2.0.md ← NIST CSF 2.0 (NIST IR 8596 Informative Reference draft)
56
+
57
+ ├── category-registry/
58
+ │ └── v1.0.yaml ← (new) versioned top-level category list
59
+
60
+ ├── schema/ ← (new) JSON Schemas
61
+ │ ├── rule.schema.json ← rule format JSON Schema
62
+ │ ├── event.schema.json ← event output JSON Schema
63
+ │ ├── profile.schema.json ← profile JSON Schema
64
+ │ └── correlation.schema.json ← correlation rule JSON Schema
65
+
66
+ └── conformance/ ← (Phase 2) test corpus + expected-results.json
67
+ ```
68
+
69
+ ---
70
+
71
+ ## The four-layer standard
72
+
73
+ ATR separates four concerns. This separation is the foundation of
74
+ the standard's architecture per governance/CHARTER.md § Appendix A.
75
+
76
+ | Layer | Lives in | Governance |
77
+ |---|---|---|
78
+ | **1. Specification** (the immutable contract — what conformant implementations must do) | `spec/` + repo-root `ATR-SPEC-v1.md` | TSC AEP process (Tier 3) |
79
+ | **2. Reference implementation** (proves the spec is buildable) | `engines/typescript/` + `engines/python/` + `engines/go/` | Maintainer-led; tested against `spec/conformance/` |
80
+ | **3. Production engines + integrations** (consumers of the spec) | `src/` (existing TypeScript engine), `integrations/{rampart,sigma,sentinel,splunk,opentelemetry}/` | Vendor-controlled; pass conformance to claim conformance |
81
+ | **4. Conformance test corpus** (objective evidence anyone implements correctly) | `spec/conformance/` | TSC; signed with ed25519 key |
82
+
83
+ ---
84
+
85
+ ## How to read the spec
86
+
87
+ If you are **implementing an ATR engine**, read in this order:
88
+
89
+ 1. `ATR-SPEC-v1.md` — rule format. Defines what a rule is and how
90
+ it evaluates.
91
+ 2. `spec/atr-schema.yaml` and `spec/schema/rule.schema.json` —
92
+ machine-readable rule schemas.
93
+ 3. `spec/atr-language-detection-v1.0.md` — the deterministic
94
+ algorithm your engine MUST implement for per-language conditions.
95
+ 4. `spec/atr-event-v1.0.md` and `spec/schema/event.schema.json` —
96
+ the event format your engine MUST emit when a rule fires.
97
+ 5. `spec/category-registry/v1.0.yaml` — categories your engine
98
+ recognises (and forward-compatibility for unknown categories).
99
+ 6. `spec/conformance/` (when published) — the test corpus your
100
+ engine MUST pass.
101
+ 7. `spec/atr-profile-v1.0.md` + `spec/atr-correlation-v1.0.md` —
102
+ RECOMMENDED for full conformance, optional for baseline.
103
+ 8. `spec/atr-method-v1.1.md` — OPTIONAL. Read only if your engine
104
+ implements detection methods beyond `pattern` (signature, semantic,
105
+ behavioral, or trace). v1.0 Pattern conformance does NOT require
106
+ this document.
107
+
108
+ If you are **authoring rules**, read:
109
+
110
+ 1. `ATR-SPEC-v1.md` — rule fields and evaluation semantics
111
+ 2. `spec/atr-schema.yaml` — required and optional fields
112
+ 3. `spec/category-registry/v1.0.yaml` — pick a category
113
+ 4. `spec/atr-language-detection-v1.0.md` — only if writing
114
+ per-language conditions
115
+ 5. Existing rules in `rules/<category>/*.yaml` for patterns
116
+
117
+ If you are **adopting ATR in your product**, read:
118
+
119
+ 1. `README.md` (repo root) — overview
120
+ 2. `governance/CHARTER.md` — governance model
121
+ 3. `spec/atr-profile-v1.0.md` — pick which profile your product
122
+ claims conformance to
123
+ 4. `spec/atr-event-v1.0.md` — your product's output integration
124
+ 5. `certification/program-guide.md` (when published) —
125
+ ATR-Certified™ program
126
+
127
+ If you are **a regulator or standards-body reviewer**, read:
128
+
129
+ 1. `governance/CHARTER.md` — TSC structure, IPR, fiscal sponsorship
130
+ 2. `governance/STANDARD-THREAT-MODEL.md` — what attacks against
131
+ the standard itself we've designed for
132
+ 3. `spec/README.md` (this file) — index
133
+ 4. `ai-rmf-oscal-catalog` (separate repo) — NIST AI RMF mapping
134
+
135
+ If you are **a sovereign authority** considering issuing rules in a
136
+ sovereign sub-range:
137
+
138
+ 1. `governance/CHARTER.md` § 8 — sovereign sub-range governance
139
+ 2. `spec/atr-profile-v1.0.md` — sovereign profile examples
140
+ 3. `spec/schema/rule.schema.json` — `provenance.attestation_signature`
141
+ field
142
+
143
+ ---
144
+
145
+ ## Conformance levels
146
+
147
+ A conformant ATR engine claim names what the engine can do. Three
148
+ levels:
149
+
150
+ **Level 1 — Baseline Conformance.** Engine implements:
151
+ - Rule schema (`spec/schema/rule.schema.json`)
152
+ - Event schema (`spec/schema/event.schema.json`)
153
+ - Language detection (`spec/atr-language-detection-v1.0.md`)
154
+ - Category registry forward-compat (`spec/category-registry/v1.0.yaml`)
155
+ - Passes `spec/conformance/baseline/` corpus
156
+
157
+ **Level 2 — Profile Conformance.** Adds:
158
+ - Profile resolution (`spec/atr-profile-v1.0.md` and schema)
159
+ - Multiple profile loading + isolated evaluation
160
+ - Passes `spec/conformance/profiles/` corpus
161
+
162
+ **Level 3 — Correlation Conformance.** Adds:
163
+ - Correlation rule evaluation (`spec/atr-correlation-v1.0.md` and schema)
164
+ - State management across events
165
+ - Implements at least `temporal_sequence`, `count_threshold`, and
166
+ `chain_propagation` correlation types
167
+ - Passes `spec/conformance/correlation/` corpus
168
+
169
+ Engines may claim any subset of levels (e.g., L1+L3 without L2). The
170
+ ATR-Certified™ program awards trust marks per level.
171
+
172
+ ---
173
+
174
+ ## Versioning policy
175
+
176
+ The spec uses SemVer with the following rules:
177
+
178
+ - **PATCH** (`1.0.x`): editorial changes, additional examples,
179
+ conformance corpus expansion. Engines MUST continue to pass.
180
+ - **MINOR** (`1.x.0`): backward-compatible field additions (e.g.,
181
+ new optional rule field). Engines SHOULD adopt within 6 months.
182
+ - **MAJOR** (`x.0.0`): breaking changes. Engines MUST adopt to
183
+ claim new-version conformance. Minimum 12-month deprecation
184
+ window for the prior major version.
185
+
186
+ Each spec document declares its individual version (e.g.,
187
+ `atr-event-v1.0.md`). The overall spec version is the lowest of
188
+ all individual spec versions.
189
+
190
+ Major-version bumps require ATR Enhancement Proposal (AEP) Tier 3
191
+ vote per governance/CHARTER.md § 4.
192
+
193
+ ---
194
+
195
+ ## Status of each spec component (May 2026)
196
+
197
+ | Component | Version | Status | Files |
198
+ |---|---|---|---|
199
+ | Rule format | v1.0 | existing-draft | `ATR-SPEC-v1.md`, `spec/atr-schema.yaml`, `spec/schema/rule.schema.json` |
200
+ | Event format | v1.0 | draft (new May 2026) | `spec/atr-event-v1.0.md`, `spec/schema/event.schema.json` |
201
+ | Profile format | v1.0 | draft (new May 2026) | `spec/atr-profile-v1.0.md`, `spec/schema/profile.schema.json` |
202
+ | Correlation format | v1.0 | draft (new May 2026) | `spec/atr-correlation-v1.0.md`, `spec/schema/correlation.schema.json` |
203
+ | Language detection algorithm | v1.0 | draft (new May 2026) | `spec/atr-language-detection-v1.0.md` |
204
+ | Category registry | v1.0 | draft (new May 2026) | `spec/category-registry/v1.0.yaml` |
205
+ | Conformance corpus | v1.0 | planned Phase 2 | `spec/conformance/` |
206
+
207
+ ---
208
+
209
+ ## How this spec evolves
210
+
211
+ New spec components and changes to existing components go through
212
+ the **ATR Enhancement Proposal (AEP)** process defined in
213
+ governance/CHARTER.md § 5.
214
+
215
+ AEP template at `rfc/TEMPLATE-AEP.md` (Phase 3 deliverable). Open
216
+ AEPs are tracked in `rfc/`.
217
+
218
+ Reported issues and bugs in the spec go through GitHub Issues with
219
+ the `spec-bug` label, expedited as Tier 2 votes (simple majority of
220
+ 5 of 9 TSC).
221
+
222
+ ---
223
+
224
+ ## Cross-references to related specs
225
+
226
+ - **Sigma** (SIEM detection rules): different domain (SIEM event
227
+ patterns vs AI-agent runtime patterns), but ATR's rule structure
228
+ draws explicitly on Sigma's design and the bidirectional Sigma ↔
229
+ ATR converter at `integrations/sigma/` (Phase 4 deliverable)
230
+ lets adopters cross-pollinate.
231
+ - **STIX 2.1** (Structured Threat Information eXpression): ATR
232
+ publishes a STIX 2.1 extension at `spec/stix-extension/` so ATR
233
+ events flow into STIX-native CTI platforms.
234
+ - **OSCAL** (NIST compliance): ATR events map to OSCAL `observation`
235
+ records per `spec/atr-event-v1.0.md` § OSCAL mapping. Companion
236
+ CC0 catalog at `Agent-Threat-Rule/ai-rmf-oscal-catalog`.
237
+ - **MITRE ATLAS**: each ATR rule declares MITRE ATLAS technique
238
+ mappings in its `references.mitre_atlas` field. Current coverage
239
+ 100 of 113 ATLAS techniques per `docs/MITRE-ATLAS-MAPPING.md`.
240
+ - **OWASP Agentic Top 10**: each ATR rule declares OWASP Agentic
241
+ mappings in `references.owasp_agentic`. Full 10/10 category
242
+ coverage per `docs/OWASP-AGENTIC-MAPPING.md`.
243
+ - **EU AI Act Article 50**: ATR events carry the evidence fields
244
+ required for Article 50 deployer obligations (signature, agent
245
+ identity, deployment-time provenance). See
246
+ `spec/atr-event-v1.0.md` § Required fields.
247
+ - **C2PA** (Content Credentials): when a deepfake-related rule
248
+ fires on agent-generated media, the event includes a C2PA
249
+ manifest reference if available.
250
+
251
+ ---
252
+
253
+ ## Submission to standards bodies
254
+
255
+ The spec is being prepared for:
256
+
257
+ 1. **OASIS Open Project (primary)** as adjacent to CoSAI. See
258
+ `panguard-outreach/2026-05-25-standardization-phase0/OASIS-APPROACH-MEMO.md`.
259
+ Target: Q3 2026 acceptance, Q1 2027 first Committee Specification.
260
+ 2. **NIST CAISI (citation target)**. See
261
+ `panguard-outreach/2026-05-25-standardization-phase0/NIST-CAISI-POSITION-PAPER.md`.
262
+ No formal submission window currently open; awaiting next RFI.
263
+ 3. **IETF (informational draft, transport / OTEL emission only)**
264
+ when reference implementations are stable.
265
+
266
+ The spec is not yet submitted to any standards body; current state
267
+ is "Draft v1.0, community-maintained at GitHub, transitioning to
268
+ OASIS Open Project."
269
+
270
+ ---
271
+
272
+ ## Contact
273
+
274
+ - Spec issues: GitHub Issues with label `spec-bug` or `spec-question`
275
+ - Spec proposals: GitHub Pull Requests with AEP template
276
+ - Maintainer: Adam Lin <adam@agentthreatrule.org>
277
+ - Fiscal sponsor: Open Source Collective Inc. (501(c)(3),
278
+ EIN 81-1567737)
279
+ - TSC (post-ratification): tsc@agentthreatrule.org (mailing list, public)
@@ -0,0 +1,281 @@
1
+ # ATR Correlation Rule Format v1.0
2
+
3
+ > **STATUS: PROPOSED v1.0 — NOT YET RATIFIED.** This specification describes
4
+ > a target correlation format for community comment. No correlation rules
5
+ > have shipped to the canonical corpus yet. See `STANDARDIZATION-STATUS.md`
6
+ > for full status.
7
+
8
+ **Status:** Draft for AEP-004 ratification — NOT RATIFIED
9
+ **Date:** 2026-05-25
10
+ **License:** CC BY 4.0
11
+ **Required by (on ratification):** Detection of multi-step agent attacks (A2A chains, memory-poisoning persistence, delegated authority abuse)
12
+
13
+ ---
14
+
15
+ ## Purpose
16
+
17
+ A single agent action rarely constitutes an attack. The attack lives
18
+ in the **chain**:
19
+
20
+ - Agent A receives an indirect prompt injection from a retrieved
21
+ document (event 1).
22
+ - Agent A calls tool X with the injected parameters (event 2).
23
+ - Tool X delegates to Agent B via A2A (event 3).
24
+ - Agent B writes a persistence payload to its memory store (event 4).
25
+ - Three sessions later, Agent B exfiltrates the user's context to a
26
+ remote URL pulled from memory (event 5).
27
+
28
+ A single-event rule fires on event 1 (prompt injection class), event
29
+ 2 (tool poisoning), event 4 (memory write), and event 5 (context
30
+ exfiltration) **independently**, with no connection between them.
31
+ The defender sees four unrelated alerts and may dismiss each as
32
+ low-severity noise.
33
+
34
+ A correlation rule joins these events into one detection. The output
35
+ is a single, high-confidence event that names the attack chain and
36
+ points to every constituent event.
37
+
38
+ This spec defines the correlation rule format. It is modelled on
39
+ Sigma's correlation rule specification but adds AI-agent-specific
40
+ join keys (agent.id, session.id, agent.delegation_chain).
41
+
42
+ ---
43
+
44
+ ## Correlation JSON Schema reference
45
+
46
+ Machine-readable schema: `spec/schema/correlation.schema.json`.
47
+
48
+ This Markdown document is normative; JSON Schema must match.
49
+
50
+ ---
51
+
52
+ ## Required fields
53
+
54
+ ```yaml
55
+ correlation:
56
+ schema_version: "1.0"
57
+ id: "ATR-COR-2026-00001" # correlation rule ID, separate range from atomic rules
58
+ title: "A2A delegated authority abuse chain"
59
+ description: >
60
+ Detects the multi-agent attack pattern: indirect prompt injection
61
+ upstream → delegated tool call → memory poisoning downstream →
62
+ exfiltration in subsequent session.
63
+ status: "draft"
64
+ severity: "critical"
65
+ author: "ATR Maintainer"
66
+ date: "2026-05-25"
67
+ license: "CC-BY-4.0"
68
+ references:
69
+ owasp_agentic: ["ASI03", "ASI04", "ASI09"]
70
+ mitre_atlas: ["AML.T0048", "AML.T0024"]
71
+
72
+ source_rules:
73
+ - alias: "injection"
74
+ rule_id: "ATR-2026-00012" # indirect prompt injection
75
+ - alias: "tool_call"
76
+ rule_id_pattern: "ATR-2026-001*" # tool-poisoning class
77
+ - alias: "memory_write"
78
+ rule_id_pattern: "ATR-2026-003*" # memory write
79
+ - alias: "exfil"
80
+ rule_id_pattern: "ATR-2026-006*" # context exfiltration
81
+
82
+ correlation_logic:
83
+ type: "temporal_sequence" # see § Correlation types below
84
+ sequence:
85
+ - alias: "injection"
86
+ - alias: "tool_call"
87
+ - alias: "memory_write"
88
+ - alias: "exfil"
89
+ join_keys:
90
+ - "agent.id" # all events must share agent.id
91
+ - "session.id" # OR be linked across sessions via memory.store_id
92
+ window:
93
+ type: "session_chain" # see § Time windows below
94
+ max_session_count: 5 # exfil may occur up to 5 sessions later
95
+ max_wall_time: "30d" # but no longer than 30 days
96
+
97
+ response:
98
+ severity_uplift: "critical" # final correlation severity
99
+ actions: ["alert", "snapshot", "quarantine"]
100
+ message_template: >
101
+ [ATR-COR-2026-00001] Multi-agent attack chain detected. Indirect
102
+ injection at event {injection.event_id} → tool call at
103
+ {tool_call.event_id} → memory poisoning at
104
+ {memory_write.event_id} → exfiltration at {exfil.event_id}.
105
+ Recommend immediate session quarantine plus memory store audit.
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Correlation types
111
+
112
+ ### `temporal_sequence`
113
+
114
+ Events must occur in declared order on the timeline. Events between
115
+ the named ones are allowed (and ignored). The match fires when the
116
+ final event in the sequence is observed.
117
+
118
+ ### `temporal_unordered`
119
+
120
+ All named events must occur within the window, but order is not
121
+ constrained.
122
+
123
+ ### `count_threshold`
124
+
125
+ A single source-rule fires N or more times within the window. Useful
126
+ for brute-force / repeated-attempt detection ("agent attempted
127
+ forbidden tool call ≥ 5 times in 1 hour").
128
+
129
+ ### `value_overlap`
130
+
131
+ Two or more source rules fire AND share a common value in a named
132
+ field (e.g., both fire on the same `agent.id` and the same
133
+ `tool.target_jurisdiction`).
134
+
135
+ ### `chain_propagation`
136
+
137
+ Events form a graph: event A produces upstream_chain reference
138
+ pointing to event B. Useful for A2A delegated-authority chains where
139
+ each link in the chain explicitly references the prior.
140
+
141
+ Engines MUST implement at least `temporal_sequence`, `count_threshold`,
142
+ and `chain_propagation` to claim correlation conformance. The other
143
+ two are RECOMMENDED.
144
+
145
+ ---
146
+
147
+ ## Join keys
148
+
149
+ Correlation requires join keys — fields whose equality across events
150
+ ties them into one chain. Standard join keys:
151
+
152
+ | Key | Source field | Use |
153
+ |---|---|---|
154
+ | `agent.id` | event.agent.id | Same agent across events |
155
+ | `session.id` | event.session.id | Same session |
156
+ | `agent.delegation_chain[*].agent_id` | A2A chain | Cross-agent |
157
+ | `memory.store_id` | memory write events | Same memory store |
158
+ | `tool.target_jurisdiction` | tool call events | Cross-event geographic correlation |
159
+ | `evidence.upstream_chain[*]` | event chain | Explicit upstream linkage |
160
+
161
+ Correlation rules MAY define custom join keys via XPath-like syntax
162
+ into the event JSON. Engines MUST implement standard keys; custom
163
+ keys are best-effort.
164
+
165
+ ---
166
+
167
+ ## Time windows
168
+
169
+ | Window type | Description |
170
+ |---|---|
171
+ | `wall_time` | Events must occur within N seconds / minutes / hours. Format: `"5m"`, `"24h"`. |
172
+ | `session_chain` | Events may span N consecutive sessions, with max wall time. |
173
+ | `chain_depth` | Events linked via `evidence.upstream_chain` up to N hops. |
174
+ | `unbounded` | No window (use sparingly; primarily for static-analysis chains where time is irrelevant). |
175
+
176
+ ---
177
+
178
+ ## False-positive considerations
179
+
180
+ Correlation rules have a multiplicative FP risk: P(FP) = P(FP_r1) ×
181
+ P(FP_r2) × ... × P(FP_rN), assuming independence. This makes
182
+ correlation rules ROBUSTLY HIGH PRECISION when the constituent
183
+ rules are individually high-precision.
184
+
185
+ But correlation also has a multiplicative complexity: the engine
186
+ maintains state across events, with bounded memory. Specification:
187
+
188
+ - Engines MUST set a per-correlation-rule maximum state size. If
189
+ exceeded, oldest pending matches are evicted.
190
+ - Engines MUST emit a `correlation_state_evicted` event when
191
+ eviction occurs (so audit chains know about lost detections).
192
+ - Engines MAY share state across correlation rules (e.g., index of
193
+ events by `agent.id`) for efficiency.
194
+
195
+ ---
196
+
197
+ ## ID numbering
198
+
199
+ Correlation rules use a distinct ID range:
200
+
201
+ - Atomic rules: `ATR-YYYY-NNNNN`
202
+ - Correlation rules: `ATR-COR-YYYY-NNNNN`
203
+
204
+ This prevents ID collision and lets downstream consumers easily
205
+ filter correlation events. The Numbering Authority issues both
206
+ ranges; correlation rules pass the same TSC review process.
207
+
208
+ ---
209
+
210
+ ## Conformance gate
211
+
212
+ A correlation rule's CI gate has an additional check beyond the
213
+ atomic-rule gate:
214
+
215
+ - Engine MUST be able to load the rule (parse + validate).
216
+ - Engine MUST evaluate the correlation against a fixture event
217
+ stream included in the rule's `test_cases.true_positive_streams`.
218
+ - Engine MUST NOT fire on `test_cases.true_negative_streams`.
219
+
220
+ Fixture event streams are JSON Lines files in
221
+ `tests/correlation-streams/<rule-id>/`.
222
+
223
+ ---
224
+
225
+ ## Example fixture stream (positive case for ATR-COR-2026-00001)
226
+
227
+ ```jsonl
228
+ {"@timestamp":"2026-05-25T10:00:00Z","atr.event_id":"01927e2d-7b32-7c41-9e84-0001","atr.rule_id":"ATR-2026-00012","agent.id":"agt-abc","session.id":"sess-1","atr.matched_field":"agent_output","atr.category":"prompt-injection"}
229
+ {"@timestamp":"2026-05-25T10:00:30Z","atr.event_id":"01927e2d-7b32-7c41-9e84-0002","atr.rule_id":"ATR-2026-00115","agent.id":"agt-abc","session.id":"sess-1","atr.matched_field":"tool_call","atr.category":"tool-poisoning"}
230
+ {"@timestamp":"2026-05-25T10:01:00Z","atr.event_id":"01927e2d-7b32-7c41-9e84-0003","atr.rule_id":"ATR-2026-00345","agent.id":"agt-abc","session.id":"sess-1","atr.matched_field":"memory_write","atr.category":"context-exfiltration","memory.store_id":"mem-xyz"}
231
+ {"@timestamp":"2026-05-27T14:32:00Z","atr.event_id":"01927e2d-7b32-7c41-9e84-0004","atr.rule_id":"ATR-2026-00610","agent.id":"agt-abc","session.id":"sess-22","atr.matched_field":"agent_output","atr.category":"context-exfiltration"}
232
+ ```
233
+
234
+ Engine MUST emit one correlation event after consuming all four
235
+ above, referencing all four event IDs in `evidence.upstream_chain`
236
+ of the output event.
237
+
238
+ ---
239
+
240
+ ## Example fixture stream (negative case)
241
+
242
+ Same as above but with different `agent.id` values across events.
243
+ Engine MUST NOT correlate (join key mismatch).
244
+
245
+ ---
246
+
247
+ ## Performance bounds
248
+
249
+ Correlation evaluation must remain bounded:
250
+
251
+ - **Memory:** O(N events × M correlation rules × K state per rule).
252
+ Engines MUST evict oldest state when memory budget exceeded.
253
+ - **CPU per event:** O(M correlation rules), with O(1) state update
254
+ per rule on average. Catastrophic-backtracking is forbidden in
255
+ correlation logic.
256
+ - **Latency:** Correlation evaluation MUST NOT block atomic-rule
257
+ emission. Atomic events emit immediately; correlation events
258
+ emit on chain completion.
259
+
260
+ These bounds are guidelines; specific deployment SLAs (e.g., <100ms
261
+ p99 per event) belong to the engine's deployment specification, not
262
+ the spec.
263
+
264
+ ---
265
+
266
+ ## Versioning
267
+
268
+ Same versioning as atomic rules: SemVer with PATCH for backward-
269
+ compatible additions, MINOR for spec-relevant changes, MAJOR for
270
+ breaking changes. v1.0 is the initial release.
271
+
272
+ ---
273
+
274
+ ## References
275
+
276
+ - Sigma Correlation Rules Specification: https://github.com/SigmaHQ/sigma-specification/blob/main/specification/sigma-correlation-rules-specification.md
277
+ - Sigma rule design lessons: https://sigmahq.io/docs/guide/about.html
278
+ - A2A delegation patterns: https://datatracker.ietf.org/doc/draft-ni-a2a-ai-agent-security-requirements/
279
+ - SpAIware (memory-poisoning persistence): https://www.sciencedirect.com/science/article/abs/pii/S0167739X25002894
280
+ - ATR Event Format Spec v1.0: spec/atr-event-v1.0.md
281
+ - ATR Rule Format Spec v1.0: ATR-SPEC-v1.md