agent-threat-rules 4.1.5 → 4.2.0

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 (240) hide show
  1. package/CHANGELOG.md +688 -1
  2. package/README.md +355 -125
  3. package/dist/adapters/openshell-filter.d.ts +10 -3
  4. package/dist/adapters/openshell-filter.d.ts.map +1 -1
  5. package/dist/adapters/openshell-filter.js +10 -3
  6. package/dist/adapters/openshell-filter.js.map +1 -1
  7. package/dist/adapters/stdio-adapter.js +3 -3
  8. package/dist/adapters/stdio-adapter.js.map +1 -1
  9. package/dist/cli/mcp-tools-document.d.ts +40 -0
  10. package/dist/cli/mcp-tools-document.d.ts.map +1 -0
  11. package/dist/cli/mcp-tools-document.js +95 -0
  12. package/dist/cli/mcp-tools-document.js.map +1 -0
  13. package/dist/cli/scan-handler.d.ts +8 -0
  14. package/dist/cli/scan-handler.d.ts.map +1 -1
  15. package/dist/cli/scan-handler.js +126 -34
  16. package/dist/cli/scan-handler.js.map +1 -1
  17. package/dist/cli.d.ts.map +1 -1
  18. package/dist/cli.js +80 -43
  19. package/dist/cli.js.map +1 -1
  20. package/dist/converters/sarif.d.ts +14 -2
  21. package/dist/converters/sarif.d.ts.map +1 -1
  22. package/dist/converters/sarif.js +7 -9
  23. package/dist/converters/sarif.js.map +1 -1
  24. package/dist/corpus-event.d.ts +47 -5
  25. package/dist/corpus-event.d.ts.map +1 -1
  26. package/dist/corpus-event.js +68 -29
  27. package/dist/corpus-event.js.map +1 -1
  28. package/dist/embedding/model-loader.d.ts +2 -0
  29. package/dist/embedding/model-loader.d.ts.map +1 -1
  30. package/dist/embedding/model-loader.js +3 -1
  31. package/dist/embedding/model-loader.js.map +1 -1
  32. package/dist/enforcement.d.ts +8 -0
  33. package/dist/enforcement.d.ts.map +1 -1
  34. package/dist/enforcement.js +10 -0
  35. package/dist/enforcement.js.map +1 -1
  36. package/dist/engine.d.ts +150 -6
  37. package/dist/engine.d.ts.map +1 -1
  38. package/dist/engine.js +337 -76
  39. package/dist/engine.js.map +1 -1
  40. package/dist/eval/embedding-provenance.d.ts +40 -0
  41. package/dist/eval/embedding-provenance.d.ts.map +1 -0
  42. package/dist/eval/embedding-provenance.js +71 -0
  43. package/dist/eval/embedding-provenance.js.map +1 -0
  44. package/dist/eval/eval-harness.d.ts +34 -0
  45. package/dist/eval/eval-harness.d.ts.map +1 -1
  46. package/dist/eval/eval-harness.js +49 -2
  47. package/dist/eval/eval-harness.js.map +1 -1
  48. package/dist/eval/hackaprompt-corpus.d.ts +12 -0
  49. package/dist/eval/hackaprompt-corpus.d.ts.map +1 -1
  50. package/dist/eval/hackaprompt-corpus.js +15 -1
  51. package/dist/eval/hackaprompt-corpus.js.map +1 -1
  52. package/dist/eval/hackaprompt-provenance.d.ts +52 -0
  53. package/dist/eval/hackaprompt-provenance.d.ts.map +1 -0
  54. package/dist/eval/hackaprompt-provenance.js +108 -0
  55. package/dist/eval/hackaprompt-provenance.js.map +1 -0
  56. package/dist/eval/run-hackaprompt-benchmark.d.ts +18 -8
  57. package/dist/eval/run-hackaprompt-benchmark.d.ts.map +1 -1
  58. package/dist/eval/run-hackaprompt-benchmark.js +154 -64
  59. package/dist/eval/run-hackaprompt-benchmark.js.map +1 -1
  60. package/dist/eval/run-pint-benchmark.js +11 -1
  61. package/dist/eval/run-pint-benchmark.js.map +1 -1
  62. package/dist/eval/skill-benchmark.d.ts +26 -6
  63. package/dist/eval/skill-benchmark.d.ts.map +1 -1
  64. package/dist/eval/skill-benchmark.js +49 -16
  65. package/dist/eval/skill-benchmark.js.map +1 -1
  66. package/dist/flywheel.d.ts +4 -0
  67. package/dist/flywheel.d.ts.map +1 -1
  68. package/dist/flywheel.js +12 -4
  69. package/dist/flywheel.js.map +1 -1
  70. package/dist/hook-handler.d.ts +11 -1
  71. package/dist/hook-handler.d.ts.map +1 -1
  72. package/dist/hook-handler.js +84 -16
  73. package/dist/hook-handler.js.map +1 -1
  74. package/dist/hook-tool-output.d.ts +47 -0
  75. package/dist/hook-tool-output.d.ts.map +1 -0
  76. package/dist/hook-tool-output.js +110 -0
  77. package/dist/hook-tool-output.js.map +1 -0
  78. package/dist/index.d.ts +5 -3
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +3 -2
  81. package/dist/index.js.map +1 -1
  82. package/dist/layer-integration.d.ts +4 -2
  83. package/dist/layer-integration.d.ts.map +1 -1
  84. package/dist/layer-integration.js +6 -2
  85. package/dist/layer-integration.js.map +1 -1
  86. package/dist/mcp-server.d.ts +8 -0
  87. package/dist/mcp-server.d.ts.map +1 -1
  88. package/dist/mcp-server.js +1 -0
  89. package/dist/mcp-server.js.map +1 -1
  90. package/dist/mcp-tools/scan.d.ts.map +1 -1
  91. package/dist/mcp-tools/scan.js +9 -1
  92. package/dist/mcp-tools/scan.js.map +1 -1
  93. package/dist/measurement/enforce-lane.d.ts +66 -0
  94. package/dist/measurement/enforce-lane.d.ts.map +1 -0
  95. package/dist/measurement/enforce-lane.js +89 -0
  96. package/dist/measurement/enforce-lane.js.map +1 -0
  97. package/dist/measurement/from-eval-harness.d.ts +16 -3
  98. package/dist/measurement/from-eval-harness.d.ts.map +1 -1
  99. package/dist/measurement/from-eval-harness.js +15 -5
  100. package/dist/measurement/from-eval-harness.js.map +1 -1
  101. package/dist/measurement/in-sample-ablation.d.ts +29 -0
  102. package/dist/measurement/in-sample-ablation.d.ts.map +1 -0
  103. package/dist/measurement/in-sample-ablation.js +45 -0
  104. package/dist/measurement/in-sample-ablation.js.map +1 -0
  105. package/dist/measurement/schema.d.ts +38 -1
  106. package/dist/measurement/schema.d.ts.map +1 -1
  107. package/dist/measurement/schema.js +43 -1
  108. package/dist/measurement/schema.js.map +1 -1
  109. package/dist/quality/action-eligibility.d.ts +4 -2
  110. package/dist/quality/action-eligibility.d.ts.map +1 -1
  111. package/dist/quality/action-eligibility.js.map +1 -1
  112. package/dist/rule-confidence.d.ts +31 -0
  113. package/dist/rule-confidence.d.ts.map +1 -0
  114. package/dist/rule-confidence.js +49 -0
  115. package/dist/rule-confidence.js.map +1 -0
  116. package/dist/rule-scaffolder.d.ts.map +1 -1
  117. package/dist/rule-scaffolder.js +43 -4
  118. package/dist/rule-scaffolder.js.map +1 -1
  119. package/dist/semantic-evaluator.d.ts.map +1 -1
  120. package/dist/semantic-evaluator.js +15 -13
  121. package/dist/semantic-evaluator.js.map +1 -1
  122. package/dist/shadow-evaluator.d.ts +7 -2
  123. package/dist/shadow-evaluator.d.ts.map +1 -1
  124. package/dist/shadow-evaluator.js +29 -25
  125. package/dist/shadow-evaluator.js.map +1 -1
  126. package/dist/testcase-event.d.ts +82 -1
  127. package/dist/testcase-event.d.ts.map +1 -1
  128. package/dist/testcase-event.js +135 -16
  129. package/dist/testcase-event.js.map +1 -1
  130. package/dist/tier0-invariant.d.ts.map +1 -1
  131. package/dist/tier0-invariant.js +1 -0
  132. package/dist/tier0-invariant.js.map +1 -1
  133. package/dist/tier1-blacklist.d.ts.map +1 -1
  134. package/dist/tier1-blacklist.js +1 -0
  135. package/dist/tier1-blacklist.js.map +1 -1
  136. package/dist/tool-definition-scope.d.ts +45 -0
  137. package/dist/tool-definition-scope.d.ts.map +1 -0
  138. package/dist/tool-definition-scope.js +68 -0
  139. package/dist/tool-definition-scope.js.map +1 -0
  140. package/dist/types.d.ts +42 -2
  141. package/dist/types.d.ts.map +1 -1
  142. package/dist/verdict.d.ts +46 -2
  143. package/dist/verdict.d.ts.map +1 -1
  144. package/dist/verdict.js +99 -14
  145. package/dist/verdict.js.map +1 -1
  146. package/package.json +2 -1
  147. package/rules/agent-manipulation/ATR-2026-00030-cross-agent-attack.yaml +2 -2
  148. package/rules/agent-manipulation/ATR-2026-00139-casual-authority-redirect.yaml +1 -1
  149. package/rules/agent-manipulation/ATR-2026-00328-named-mode-persona-override.yaml +1 -1
  150. package/rules/agent-manipulation/ATR-2026-00330-yoja-allcaps-settings-block-persona.yaml +1 -1
  151. package/rules/agent-manipulation/ATR-2026-00418-weknora-mcp-config-rce.yaml +5 -5
  152. package/rules/agent-manipulation/ATR-2026-00432-superagi-output-handler-eval-rce.yaml +1 -1
  153. package/rules/agent-manipulation/ATR-2026-00440-semantic-kernel-vector-store-eval-rce.yaml +3 -3
  154. package/rules/context-exfiltration/ATR-2026-00426-nl-output-injection-credential-leak.yaml +1 -1
  155. package/rules/context-exfiltration/ATR-2026-00702-ipi-credential-exfil-via-agent-action.yaml +1 -1
  156. package/rules/context-exfiltration/ATR-2026-00707-ipi-file-exfil-with-destroy-or-tamper.yaml +1 -1
  157. package/rules/context-exfiltration/ATR-2026-00851-indirect-pi-financial-payment-exfil.yaml +1 -1
  158. package/rules/context-exfiltration/ATR-2026-01457-sysprompt-completion-clone-attack.yaml +1 -1
  159. package/rules/context-exfiltration/ATR-2026-01462-sysprompt-override-pseudo-admin.yaml +1 -1
  160. package/rules/context-exfiltration/ATR-2026-01463-imend-imsystem-prompt-injection-format.yaml +1 -1
  161. package/rules/context-exfiltration/ATR-2026-01606-ssrf-internal-network-scan.yaml +1 -1
  162. package/rules/context-exfiltration/ATR-2026-02847-policy-justified-exfil-to-email.yaml +1 -1
  163. package/rules/context-exfiltration/ATR-2026-02855-cross-email-exfil-relay.yaml +79 -0
  164. package/rules/context-exfiltration/ATR-2026-02861-exfil-send-email-with-body-directive.yaml +83 -0
  165. package/rules/context-exfiltration/ATR-2026-02866-idna-label-separator-in-fetch-url-host.yaml +104 -0
  166. package/rules/excessive-autonomy/ATR-2026-00710-ipi-physical-access-grant.yaml +1 -1
  167. package/rules/model-abuse/ATR-2026-01897-host-sabotage.yaml +2 -2
  168. package/rules/model-security/ATR-2026-00433-modelcache-torch-load-deserialization-rce.yaml +1 -1
  169. package/rules/privilege-escalation/ATR-2026-00436-enclave-vm-sandbox-escape-rce.yaml +1 -1
  170. package/rules/privilege-escalation/ATR-2026-01601-sql-injection-destructive-ddl.yaml +2 -2
  171. package/rules/privilege-escalation/ATR-2026-01612-debug-mode-privilege-escalation.yaml +1 -1
  172. package/rules/privilege-escalation/ATR-2026-02867-identifier-typed-tool-argument-dot-dot-path-segment.yaml +106 -0
  173. package/rules/prompt-injection/ATR-2026-00004-system-prompt-override.yaml +2 -2
  174. package/rules/prompt-injection/ATR-2026-00080-encoding-evasion.yaml +1 -1
  175. package/rules/prompt-injection/ATR-2026-00086-visual-spoofing.yaml +1 -1
  176. package/rules/prompt-injection/ATR-2026-00203-context-pollution-skill-description.yaml +1 -1
  177. package/rules/prompt-injection/ATR-2026-00228-structured-jailbreak.yaml +2 -2
  178. package/rules/prompt-injection/ATR-2026-00233-structured-jailbreak.yaml +2 -2
  179. package/rules/prompt-injection/ATR-2026-00256-base-n-encoding-jailbreak.yaml +1 -1
  180. package/rules/prompt-injection/ATR-2026-00264-latent-injection-translation.yaml +3 -3
  181. package/rules/prompt-injection/ATR-2026-00265-latent-injection-rag-document.yaml +1 -1
  182. package/rules/prompt-injection/ATR-2026-00282-perez-prompt-injection-hijack.yaml +4 -4
  183. package/rules/prompt-injection/ATR-2026-00321-hyphenated-system-instruction-injection.yaml +1 -1
  184. package/rules/prompt-injection/ATR-2026-00394-backspace-deletion-character-injection.yaml +2 -2
  185. package/rules/prompt-injection/ATR-2026-00446-variable-assignment-payload-injection.yaml +3 -3
  186. package/rules/prompt-injection/ATR-2026-00476-garak-web-injection-javascript-alert-1.yaml +3 -3
  187. package/rules/prompt-injection/ATR-2026-00481-garak-dan-mixedunassigned.yaml +1 -1
  188. package/rules/prompt-injection/ATR-2026-00489-garak-encoding-javascript-alert-1.yaml +3 -3
  189. package/rules/prompt-injection/ATR-2026-00508-escape-delimiter-wrapped-goal-hijacking-in-user-input-prompt.yaml +3 -3
  190. package/rules/prompt-injection/ATR-2026-00512-rules-file-backdoor-injection.yaml +1 -1
  191. package/rules/prompt-injection/ATR-2026-01005-many-shot-repetition-override.yaml +2 -2
  192. package/rules/prompt-injection/ATR-2026-01006-payload-split-string-concat-injection.yaml +2 -2
  193. package/rules/prompt-injection/ATR-2026-01015-evasion-refusal-suppression.yaml +1 -1
  194. package/rules/prompt-injection/ATR-2026-01016-evasion-response-priming-forced-opener.yaml +1 -1
  195. package/rules/prompt-injection/ATR-2026-01026-evasion-unicode-glitch-token-anomaly.yaml +2 -2
  196. package/rules/prompt-injection/ATR-2026-01304-indirect-injection-carrier-important-override.yaml +1 -1
  197. package/rules/prompt-injection/ATR-2026-01759-dos-new-important-instructions-injection-in-document.yaml +1 -1
  198. package/rules/prompt-injection/ATR-2026-01865-llmail-fake-email-boundary-marker.yaml +1 -1
  199. package/rules/prompt-injection/ATR-2026-02010-emoji-only-payload.yaml +2 -2
  200. package/rules/prompt-injection/ATR-2026-02815-injected-halt-order-canned-reply-dos.yaml +80 -0
  201. package/rules/prompt-injection/ATR-2026-02820-tool-result-orders-agent-to-hide-its-own-action.yaml +106 -0
  202. package/rules/prompt-injection/ATR-2026-02858-context-suppression-directive.yaml +73 -0
  203. package/rules/prompt-injection/ATR-2026-02859-tool-output-agent-role-reassignment.yaml +71 -0
  204. package/rules/prompt-injection/ATR-2026-02860-forged-instruction-boundary-marker.yaml +70 -0
  205. package/rules/prompt-injection/ATR-2026-02862-fake-chat-template-turn-injection.yaml +79 -0
  206. package/rules/skill-compromise/ATR-2026-00060-skill-impersonation.yaml +1 -1
  207. package/rules/skill-compromise/ATR-2026-00063-skill-chain-attack.yaml +2 -2
  208. package/rules/skill-compromise/ATR-2026-00066-parameter-injection.yaml +2 -2
  209. package/rules/skill-compromise/ATR-2026-00149-skill-exfil-compound.yaml +6 -6
  210. package/rules/skill-compromise/ATR-2026-00223-reverse-shell-dropper.yaml +2 -2
  211. package/rules/skill-compromise/ATR-2026-01755-backdoor-pot-linguistic-trigger-phrase.yaml +1 -1
  212. package/rules/skill-compromise/ATR-2026-01756-backdoor-pot-symbol-emoticon-trigger.yaml +1 -1
  213. package/rules/skill-compromise/ATR-2026-02261-code-credential-exfil-chain.yaml +1 -1
  214. package/rules/tool-poisoning/ATR-2026-00012-unauthorized-tool-call.yaml +23 -23
  215. package/rules/tool-poisoning/ATR-2026-00013-tool-ssrf.yaml +16 -5
  216. package/rules/tool-poisoning/ATR-2026-00161-important-tag-cross-tool-shadowing.yaml +1 -1
  217. package/rules/tool-poisoning/ATR-2026-00277-echo-template-command-injection.yaml +2 -2
  218. package/rules/tool-poisoning/ATR-2026-00494-garak-exploitation-mixedunassigned.yaml +4 -4
  219. package/rules/tool-poisoning/ATR-2026-00581-mcp-tool-rug-pull-post-approval-redefinition.yaml +1 -1
  220. package/rules/tool-poisoning/ATR-2026-01303-tool-schema-enumeration-social-engineering.yaml +1 -1
  221. package/rules/tool-poisoning/ATR-2026-01307-mcp-dns-rebinding-attack.yaml +2 -2
  222. package/rules/tool-poisoning/ATR-2026-01775-semantic-mcp-tool-manifest-poisoning.yaml +1 -1
  223. package/rules/tool-poisoning/ATR-2026-01932-shadow-undeclared-mcp-server-registration.yaml +1 -1
  224. package/rules/tool-poisoning/ATR-2026-02025-mcp-full-schema-poisoning-nondescription-field.yaml +1 -1
  225. package/rules/tool-poisoning/ATR-2026-02817-untrusted-content-dictates-tool-arguments.yaml +83 -0
  226. package/rules/tool-poisoning/ATR-2026-02864-non-canonical-ipv4-host-in-url-tool-argument.yaml +102 -0
  227. package/rules/tool-poisoning/ATR-2026-02865-read-only-utility-write-flag-in-command-argument.yaml +157 -0
  228. package/rules/tool-poisoning/ATR-2026-02868-ssrf-ipv6-transition-address-embedded-private-ipv4.yaml +107 -0
  229. package/spec/README.md +6 -3
  230. package/spec/atr-event-v1.0.md +13 -8
  231. package/spec/atr-method-v1.1.md +2 -2
  232. package/spec/category-registry/gemara/README.md +102 -0
  233. package/spec/category-registry/gemara/ai-agent-capability-catalog.yaml +157 -0
  234. package/spec/category-registry/gemara/atr-attack-vector-catalog.yaml +130 -0
  235. package/spec/category-registry/gemara/atr-detection-control-catalog.yaml +327 -0
  236. package/spec/category-registry/gemara/atr-threat-catalog.yaml +246 -0
  237. package/spec/category-registry/gemara/src/editorial.yaml +743 -0
  238. package/spec/mappings/README.md +1 -1
  239. package/spec/mappings/atr-to-nist-csf-2.0.md +5 -4
  240. package/spec/schema/event.schema.json +1 -1
package/dist/engine.d.ts CHANGED
@@ -14,6 +14,7 @@
14
14
  import type { ATRRule, ATRMatch, AgentEvent, ATRVerdict, ActionResult, ScanResult, ATRLanguage, ATRSemanticJudge } from './types.js';
15
15
  import { type Lane } from './quality/rule-contract.js';
16
16
  import type { SessionTracker } from './session-tracker.js';
17
+ import { type ModelDecisions } from './verdict.js';
17
18
  import type { ActionExecutor } from './action-executor.js';
18
19
  import type { SkillFingerprintStore } from './skill-fingerprint.js';
19
20
  import type { SemanticLayerConfig } from './layer-integration.js';
@@ -21,6 +22,51 @@ import type { InvariantChecker } from './tier0-invariant.js';
21
22
  import type { BlacklistProvider } from './tier1-blacklist.js';
22
23
  import type { EmbeddingModule } from './modules/embedding.js';
23
24
  export declare function decodeBase64Blocks(content: string): string[];
25
+ /** Map agent event types to ATR source types */
26
+ export declare const EVENT_TYPE_TO_SOURCE: Readonly<Record<string, string>>;
27
+ /**
28
+ * agent_source types that name what a rule reads rather than a stream of
29
+ * events of their own (spec/atr-schema.yaml), mapped to the source type whose
30
+ * events carry that data: a context window reaches the model as LLM input or
31
+ * as tool output, so those rules run where llm_io rules run; a skill is
32
+ * installed, granted permissions and chained through tool calls, so those
33
+ * rules run where tool_call rules run. memory_access is left out for now
34
+ * (WITHHELD_SOURCE_TYPES).
35
+ *
36
+ * No event type maps to them in EVENT_TYPE_TO_SOURCE, so the source filter used
37
+ * to skip them on every typed event: on the tool_call and tool_response events
38
+ * src/hook-handler.ts builds, such a rule never ran, while `atr test` mapped its
39
+ * type to a base type and passed its cases. Only an event with no source type
40
+ * (mcp_exchange) or a SKILL.md scan reached it. `atr test` now leaves the type
41
+ * alone: what it runs is what the engine admits.
42
+ */
43
+ export declare const RUNTIME_SOURCE_TYPE: Readonly<Record<string, string>>;
44
+ /**
45
+ * Extended agent_source types left out of RUNTIME_SOURCE_TYPE for now, each
46
+ * with the reason. A rule of such a type still runs only on an event with no
47
+ * source type and in a SKILL.md scan. `atr test` reports its cases as
48
+ * unevaluable with this reason instead of passing them on an event the engine
49
+ * skips the rule on.
50
+ *
51
+ * memory_access reads what context_window reads, an agent's memory as it
52
+ * reaches the model, and would map to llm_io. Its rules (ATR-2026-00075 and
53
+ * -01155 today) were written for memory writes, and 00075 also matches standing
54
+ * instructions in an ordinary chat turn ("From now on, always answer in
55
+ * French."). On llm_input events the adapters that block by default would
56
+ * refuse those messages: the Mastra ATRProcessor aborts on high and critical
57
+ * in the hunt lane, and the OpenShell filter denies at high. Map it once those
58
+ * rules match memory writes only, measured on chat-turn data.
59
+ */
60
+ export declare const WITHHELD_SOURCE_TYPES: Readonly<Record<string, string>>;
61
+ /**
62
+ * Whether a rule of this agent_source.type runs on an event of this source
63
+ * type: the rule's source type (after RUNTIME_SOURCE_TYPE) is the event's, or
64
+ * one of two documented exceptions holds. An event type with no source type
65
+ * (mcp_exchange) admits every rule, whatever its agent_source holds; on a typed
66
+ * event a type that is not a string is admitted by nothing.
67
+ * sourceAdmits() adds the trace exception.
68
+ */
69
+ export declare function sourceTypeAdmits(ruleSourceType: unknown, eventSourceType: string | undefined): boolean;
24
70
  /**
25
71
  * Detection reporter — opt-in callback for feeding scan results back to
26
72
  * ATR Threat Cloud. Every integration endpoint that enables this becomes
@@ -99,10 +145,42 @@ export interface ATREngineConfig {
99
145
  * (they are too broad to block without confirmation). Default 0.6.
100
146
  */
101
147
  confirmThreshold?: number;
148
+ /**
149
+ * What a match a model decided may do in evaluateWithVerdict(): a semantic
150
+ * rule's semanticJudge, the embeddingModule signal, the semanticModule layer.
151
+ * 'advisory' (default): reported, observe-tier actions only, no part in the
152
+ * verdict's outcome.
153
+ * 'enforce': counts like a rule's own match. No benign-corpus measurement
154
+ * stands behind a model's decision; choose it only if you accept that.
155
+ * Any other value throws at construction time.
156
+ */
157
+ modelDecisions?: ModelDecisions;
158
+ /**
159
+ * Every event this engine evaluates is an MCP tool definition: an entry of a `tools/list`
160
+ * document, which defines a tool and calls none (`atr scan` on such a document sets it). Rules
161
+ * written for a tool being called then do not run: a rule with agent_source.type `tool_call` runs
162
+ * only if one of its conditions reads `tool_description`, or if its subject is the tool's identity
163
+ * (TOOL_IDENTITY_RULES). Every other rule runs as without the option. See
164
+ * src/tool-definition-scope.ts. Default false: other producers (hooks, adapters, event files) are
165
+ * unaffected.
166
+ */
167
+ toolDefinitions?: boolean;
102
168
  }
103
169
  export declare class ATREngine {
104
170
  private readonly config;
105
171
  private rules;
172
+ /**
173
+ * id -> the FIRST loaded rule carrying that id, i.e. exactly what
174
+ * `this.rules.find(r => r.id === id)` returns.
175
+ *
176
+ * The per-condition paths below used to run that find() on every regex
177
+ * condition they evaluated: a linear walk over every loaded rule, repeated
178
+ * thousands of times per event. Measured 2026-10-15 on the benign-corpus FP
179
+ * scan (scripts/gate-promotion-fp.ts, 829 rules, 13,848 samples), that walk
180
+ * was ~11% of all CPU and replacing it was a 1.18x speed-up on its own, with
181
+ * the matched-rule set identical for every sample.
182
+ */
183
+ private readonly ruleById;
106
184
  private readonly compiledPatterns;
107
185
  private readonly semanticModuleInstance;
108
186
  /**
@@ -111,6 +189,7 @@ export declare class ATREngine {
111
189
  * lifetime.
112
190
  */
113
191
  private readonly lane;
192
+ private readonly modelDecisions;
114
193
  /**
115
194
  * Find bundled rules directory shipped with the npm package.
116
195
  * Checks: ../rules (from dist/), ./rules (repo root)
@@ -121,14 +200,44 @@ export declare class ATREngine {
121
200
  * Load rules from configured directory and/or pre-loaded rules.
122
201
  */
123
202
  loadRules(): Promise<number>;
203
+ /** First rule wins, so the index answers what Array.find() would. */
204
+ private indexRule;
124
205
  /**
125
206
  * Lane gate: does this rule's maturity qualify for the configured detection
126
207
  * lane? 'enforce' = stable only; 'alert' = stable+test; 'hunt'/unset = all.
127
208
  * Keeps experimental content out of the auto-block path without deleting it.
128
209
  */
129
210
  private passesLane;
211
+ /**
212
+ * Whether this engine evaluates `rule` at all. A draft or deprecated status, a
213
+ * maturity outside the lane, or (on an engine constructed with
214
+ * `toolDefinitions: true`) a rule written for a tool being called, stops a rule
215
+ * before any of its conditions run,
216
+ * so nothing about it — its false positives included — can be observed through
217
+ * this engine. evaluateRaw() and evaluateAsync() both ask this, and a
218
+ * measurement harness must ask it too before recording a number for a rule:
219
+ * a rule that is never evaluated scores 0 by construction, and that 0 is not
220
+ * a measurement.
221
+ */
222
+ evaluates(rule: Pick<ATRRule, 'status' | 'maturity'> & Partial<Pick<ATRRule, 'id' | 'agent_source' | 'detection'>>): boolean;
223
+ /**
224
+ * On an engine constructed with `toolDefinitions: true`: how many loaded rules it evaluates, and how
225
+ * many it would evaluate (status and lane allow them) but leaves out because they were written for
226
+ * a tool being called. Null on any other engine. Lets a report say "not run" instead of reading as
227
+ * "ran and found nothing".
228
+ */
229
+ getToolDefinitionScope(): {
230
+ rulesEvaluated: number;
231
+ rulesSkippedByScope: number;
232
+ } | null;
130
233
  /** Active detection lane (config, else 'hunt'). Diagnostics/tests. */
131
234
  getLane(): Lane;
235
+ /**
236
+ * What a model-decided match may do (config, else 'advisory'). A caller that
237
+ * runs evaluateAsync() and computes the verdict itself passes this on:
238
+ * computeVerdict(matches, { modelDecisions: engine.getModelDecisions() }).
239
+ */
240
+ getModelDecisions(): ModelDecisions;
132
241
  /**
133
242
  * Load a single rule file and add it to the engine.
134
243
  */
@@ -305,15 +414,42 @@ export declare class ATREngine {
305
414
  /** Async MCP event scan result with semantic rule support. */
306
415
  evaluateFullAsync(event: AgentEvent, filePath?: string): Promise<ScanResult>;
307
416
  }
417
+ /** How the engine compiles one array-format `operator: regex` condition. */
418
+ export interface RegexConditionSpec {
419
+ /** The pattern handed to RegExp: the condition's value minus a leading inline flag group. */
420
+ readonly source: string;
421
+ /** The letters of that stripped group ("i", "is", ...), or "" when there was none. Stripped, not applied. */
422
+ readonly inlineFlags: string;
423
+ /** Always `i` -- this condition shape has no case-sensitive mode -- plus `u` when the pattern needs it. */
424
+ readonly flags: 'i' | 'iu';
425
+ }
426
+ /**
427
+ * The engine's single definition of how an array-format `operator: regex`
428
+ * condition is compiled (SPEC §6.4). Both compile sites in ATREngine reach it
429
+ * through compileRegexCondition() (compilePatterns() and the on-the-fly fallback
430
+ * in evaluateArrayCondition()), so does ShadowEvaluator, and
431
+ * scripts/gate-case-sensitivity.ts imports it, because it has to see each pattern
432
+ * exactly as the engine does. That gate used to keep its own copy of this logic,
433
+ * and the copy went stale when needsUnicodeFlag() started setting `u` for astral
434
+ * literals. Other scripts still re-derive it by hand and could import it too.
435
+ *
436
+ * Two consequences rule authors cannot see from the pattern:
437
+ * - `i` is applied whether or not the author wrote (?i), so letter case never
438
+ * distinguishes anything: [A-Z] also matches a-z.
439
+ * - A stripped (?s), (?m) or (?x) is NOT applied.
440
+ */
441
+ export declare function regexConditionSpec(value: string): RegexConditionSpec;
308
442
  /**
309
- * Normalize Unicode text to NFC form and strip zero-width characters.
310
- * This prevents evasion via combining characters, zero-width joiners, etc.
443
+ * Compile an array-format `operator: regex` value the way the engine does: the
444
+ * leading flag group handled by regexConditionSpec(), then the ReDoS gate in
445
+ * safeCompile(). Returns null for a pattern the gate rejects or that does not
446
+ * compile; such a condition never matches. Exported for code outside
447
+ * ATREngine, such as ShadowEvaluator and RuleScaffolder, that must compile a
448
+ * condition exactly as the engine does.
311
449
  *
312
- * NFC was chosen over NFKC to preserve writer intent \u2014 full-width letters
313
- * (\uFF21\uFF22\uFF23 vs ABC) remain distinct so rules that explicitly target full-width
314
- * evasion can still match. For aggressive normalization use
315
- * `normalizeUnicodeAggressive()`.
450
+ * @internal Not re-exported from the package entry point.
316
451
  */
452
+ export declare function compileRegexCondition(value: string, ruleId?: string): RegExp | null;
317
453
  export declare function normalizeUnicode(text: string): string;
318
454
  export declare function foldConfusables(text: string): string;
319
455
  /**
@@ -349,6 +485,14 @@ export declare function detectInputLanguage(text: string): ATRLanguage;
349
485
  * Exported for unit testing; not part of the public API surface.
350
486
  */
351
487
  export declare function conditionLanguageMatches(condLang: ATRLanguage | undefined, inputLang: ATRLanguage): boolean;
488
+ /**
489
+ * Safely test a regex pattern against input with length limits.
490
+ * Returns false if input exceeds MAX_EVAL_LENGTH to prevent ReDoS.
491
+ * Exported so ShadowEvaluator and RuleScaffolder apply the same limit as the engine.
492
+ *
493
+ * @internal Not re-exported from the package entry point.
494
+ */
495
+ export declare function safeRegexTest(regex: RegExp, input: string): boolean;
352
496
  /**
353
497
  * Heuristic catastrophic-backtracking (ReDoS) detector for rule-derived
354
498
  * patterns.
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EAGV,UAAU,EACV,YAAY,EACZ,UAAU,EAEV,WAAW,EACX,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAOpB,OAAO,EAA+B,KAAK,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAQlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AA8D9D,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAsB5D;AAsBD;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IA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