@query-ai/digital-workers 1.0.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.
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "digital-workers",
3
+ "owner": {
4
+ "name": "Query.ai"
5
+ },
6
+ "metadata": {
7
+ "description": "Autonomous security investigation framework for the Query Data Mesh",
8
+ "pluginRoot": "./plugins"
9
+ },
10
+ "plugins": [
11
+ {
12
+ "name": "digital-workers",
13
+ "sources": [
14
+ {
15
+ "type": "npm",
16
+ "package": "@query-ai/digital-workers",
17
+ "version": "1.0.0",
18
+ "registry": "https://registry.npmjs.org/"
19
+ }
20
+ ],
21
+ "description": "Alert triage, investigation, and response-ready reporting using FSQL against the Query Data Mesh",
22
+ "version": "1.0.0",
23
+ "keywords": ["security", "investigation", "DFIR", "SOC", "FSQL", "digital-workers", "alert-triage"],
24
+ "category": "security operations"
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "digital-workers",
3
+ "description": "Autonomous security investigation framework for the Query Data Mesh — alert triage, investigation, and response-ready reporting",
4
+ "version": "1.0.0",
5
+ "author": {
6
+ "name": "Query.ai"
7
+ },
8
+ "keywords": ["security", "investigation", "DFIR", "SOC", "FSQL", "digital-workers", "alert-triage"],
9
+ "skills": "./skills/",
10
+ "hooks": "./hooks/"
11
+ }
package/README.md ADDED
@@ -0,0 +1,430 @@
1
+ # Digital Workers
2
+
3
+ Autonomous security operations framework for the [Query Data Mesh](https://query.ai). A Claude Code plugin that provides two workflows: **reactive alert investigation** and **proactive threat hunting** — both powered by FSQL queries against federated security data.
4
+
5
+ ## What It Does
6
+
7
+ ### Reactive: Alert Investigation
8
+
9
+ Tiered Incident Discovery workflow — from a 5-minute triage to a 30-minute deep investigation with specialist analysis and senior review.
10
+
11
+ ```
12
+ Step 0: SELECT TIER → Triage / Standard / Deep (from your prompt)
13
+ Gate 1: ALERTS INTAKE → Pull and classify alerts
14
+ Gate 2: GATHER INFORMATION → Enrich IOCs, pivot to telemetry (Triage stops here)
15
+ Gate 3: ANALYZE SITUATION → Score severity, route depth
16
+ Gate 4: DECIDE & ACT → Specialists, disposition
17
+ Gate 5: BUILD & PRIORITIZE → Assemble evidence
18
+ Gate 6: INCIDENT NOTIFICATION → Report, senior review (Deep), present to analyst
19
+ ```
20
+
21
+ ### Proactive: Threat Hunting
22
+
23
+ Sqrrl-inspired hunting loop — hypothesis-driven, confidence-based completion, with detection automation and gap remediation.
24
+
25
+ ```
26
+ Phase 0: HYPOTHESIS INTAKE → Build or receive testable hypothesis, determine hunt tier
27
+ Phase 1: HUNT PLANNING → Data availability mapping, connector discovery, query strategy
28
+ Phase 2: INVESTIGATION → Execute hunt queries, pivot, enrich (confidence-based, not query-capped)
29
+ Phase 3: PATTERN DISCOVERY → Classify findings, detect kill chains, escalate active threats
30
+ Phase 4: DETECTION AUTOMATION → Generate FSQL detections, Sigma rules, Query recipes, gap remediation
31
+ ```
32
+
33
+ ## Skills
34
+
35
+ | Skill | Purpose |
36
+ |-------|---------|
37
+ | `using-digital-workers` | Meta skill — injected on session start, routes to investigation skills |
38
+ | `alert-investigation` | Master orchestrator — runs the 6-gate Discovery workflow |
39
+ | `fsql-expert` | Authors, validates, and executes FSQL queries against the mesh |
40
+ | `alert-classifier` | Maps alerts to OCSF category + MITRE ATT&CK technique |
41
+ | `severity-scorer` | Multi-factor risk scoring (5 dimensions) for depth routing |
42
+ | `identity-investigator` | User behavior, auth patterns, privilege analysis |
43
+ | `network-investigator` | Lateral movement, C2 beaconing, traffic analysis |
44
+ | `threat-intel-enricher` | IOC reputation and campaign correlation |
45
+ | `report-writer` | Response-ready reports (technical + business summary) |
46
+ | `evidence-quality-checker` | Data completeness and analytical reasoning validation at gate exits |
47
+ | `senior-analyst-review` | Quality review of completed investigations — evidence, logic, gaps |
48
+ | **Hunting Skills** | |
49
+ | `threat-hunt` | Master orchestrator — runs the 4-phase Sqrrl hunting loop |
50
+ | `hypothesis-builder` | Transforms raw intel, MITRE techniques, or hunches into testable hypotheses |
51
+ | `hunt-pattern-analyzer` | Classifies hunt findings and maps to ATT&CK |
52
+ | `detection-engineer` | Converts findings to FSQL detections, Sigma rules, Query recipes; gap remediation |
53
+
54
+ ## Prerequisites
55
+
56
+ - [Claude Code](https://claude.com/claude-code) installed
57
+ - Access to a [Query Data Mesh](https://query.ai) deployment with MCP enabled
58
+ - An API token for your Query MCP server
59
+
60
+ ## Installation
61
+
62
+ ### 1. Create your `.mcp.json`
63
+
64
+ In your working directory (where you'll run Claude Code), create a `.mcp.json` file with your Query MCP endpoint and API token:
65
+
66
+ ```json
67
+ {
68
+ "mcpServers": {
69
+ "Query-ai": {
70
+ "type": "http",
71
+ "url": "https://mcp.query.ai/mcp",
72
+ "headers": {
73
+ "x-token-authorization": "your-api-token-here"
74
+ }
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ > **Important:** Never commit your `.mcp.json` — it contains your API credentials. Add it to your `.gitignore`.
81
+
82
+ ### 2. Register the plugin marketplace
83
+
84
+ ```bash
85
+ claude plugin marketplace add https://plugins.query.ai/claude/digital-workers/.claude-plugin/marketplace.json
86
+ ```
87
+
88
+ ### 3. Install the plugin
89
+
90
+ ```bash
91
+ claude plugin install digital-workers
92
+ ```
93
+
94
+ ### 4. Verify installation
95
+
96
+ ```bash
97
+ claude plugin list
98
+ ```
99
+
100
+ You should see:
101
+ ```
102
+ ❯ digital-workers@digital-workers
103
+ Version: 0.1.0
104
+ Scope: user
105
+ Status: ✔ enabled
106
+ ```
107
+
108
+ ## Operator Guide
109
+
110
+ Start a new Claude Code session in a directory with your `.mcp.json`. The `using-digital-workers` meta skill is automatically injected on session start and routes your request to the investigation orchestrator.
111
+
112
+ ### Investigation Tiers
113
+
114
+ **Your prompt controls how deep the investigation goes.** The orchestrator selects a tier based on how you phrase your request — no configuration needed.
115
+
116
+ | Tier | What It Does | Time | Queries |
117
+ |------|-------------|------|---------|
118
+ | **Triage** | Pull alerts, classify, scan IOCs across the mesh. Inline summary, no files. | ~5 min | 3-6 |
119
+ | **Standard** | Full 6-gate investigation with enrichment, telemetry pivots, severity scoring, disposition, report. | ~15 min | 10-15 |
120
+ | **Deep** | Everything in Standard + specialist investigators + senior analyst review + prior investigation cross-reference. | ~30 min | 20-30 |
121
+
122
+ ### What Triggers Each Tier
123
+
124
+ | How You Phrase It | Tier | Why |
125
+ |-------------------|------|-----|
126
+ | "Any suspicious PowerShell in the last 12 hours?" | Triage | Question/check — you want a quick look |
127
+ | "What alerts fired overnight?" | Triage | Discovery question |
128
+ | "Check for lateral movement" | Triage | Scan request |
129
+ | "Investigate the unfamiliar sign-in alerts" | Standard | "Investigate" = action verb |
130
+ | "Look into this hash across all sources" | Standard | "Look into" = investigation |
131
+ | "Full investigation on the PowerShell alerts" | Deep | "Full" = explicit depth |
132
+ | "Deep dive on BD-3263" | Deep | "Deep dive" = explicit depth |
133
+
134
+ ### Upgrading Mid-Investigation
135
+
136
+ Tiers upgrade but never downgrade. If Triage finds something hot, it auto-upgrades to Standard:
137
+
138
+ > "Upgrading to **Standard** — CRITICAL severity indicators found on 3 hosts."
139
+
140
+ You can also upgrade manually at any time:
141
+
142
+ ```
143
+ go deeper → upgrades to next tier
144
+ full investigation → upgrades to Deep
145
+ just triage → stays at current tier (overrides auto-upgrade)
146
+ ```
147
+
148
+ ### Example Prompts
149
+
150
+ ```
151
+ # Triage — quick scan (~5 min)
152
+ Any suspicious PowerShell in the last 12 hours?
153
+ What high/critical alerts fired in the past 24 hours?
154
+ Check for any lateral movement activity
155
+
156
+ # Standard — full investigation (~15 min)
157
+ Investigate the unfamiliar sign-in alerts from the past 24 hours
158
+ Look into hash e7fc03267e47814e23e004e5f3a1205b
159
+ Triage the new critical endpoint alerts
160
+
161
+ # Deep — comprehensive analysis (~30 min)
162
+ Full investigation on the PowerShell fileless execution findings
163
+ Deep dive on host BD-3263 — possible C2 compromise
164
+ This looks like an incident — investigate everything from the past 48 hours
165
+
166
+ # Continuous monitoring (uses Triage, auto-upgrades on critical findings)
167
+ /loop 10m Check for new high and critical alerts
168
+ ```
169
+
170
+ ### Threat Hunting
171
+
172
+ **Proactive hunting uses the same prompt-driven approach.** State your hypothesis, provide intel, or ask for suggestions — the orchestrator handles the rest.
173
+
174
+ | How You Phrase It | Hunt Mode | What Happens |
175
+ |-------------------|-----------|-------------|
176
+ | "Hunt for RDP lateral movement from service accounts" | Direct Hypothesis | Validates, maps to data, hunts |
177
+ | "I read about Volt Typhoon — check our environment" | Intel-Driven | Builds hypothesis from actor TTPs, hunts |
178
+ | "Test our visibility against T1059.001" | TTP-Driven | Maps technique to data sources, hunts |
179
+ | "What should I hunt next?" | Suggest Mode | Analyzes coverage gaps, TI signals, recommends hunts |
180
+
181
+ **Hunt tiers** (determined by hypothesis complexity, not prompt phrasing):
182
+
183
+ | Tier | Scope | Circuit Breaker |
184
+ |------|-------|----------------|
185
+ | **Focused** | 1-2 TTPs, narrow scope | Pause at 25 min |
186
+ | **Broad** | 3+ TTPs or environment-wide | Pause at 45 min |
187
+
188
+ **Hunts use confidence-based completion** (not hard query caps). The hunt runs until it reaches 90% confidence across data coverage, TTP coverage, and enrichment depth. Circuit breakers pause (not stop) the hunt — the analyst decides whether to continue or wrap up.
189
+
190
+ **Every hunt produces:**
191
+ - Detection package (FSQL queries, Sigma rules, Query recipes)
192
+ - Gap remediation plan (what's missing, what to deploy, prioritized by risk)
193
+ - Full hunt report with MITRE ATT&CK mapping
194
+
195
+ ```
196
+ # Hunting prompts
197
+ Hunt for lateral movement via RDP from service accounts on the finance subnet
198
+ I just read a CISA advisory about Volt Typhoon — test our environment
199
+ Test our visibility against T1059.001 PowerShell fileless execution
200
+ What should I hunt next?
201
+ Here's a threat advisory — build a hunt from it [paste or URL]
202
+ ```
203
+
204
+ ### Dispositions
205
+
206
+ Every Standard and Deep investigation produces a **proposed** disposition:
207
+
208
+ - **Critical Threat** — Confirmed malicious, recommend immediate response and incident escalation
209
+ - **Policy Violation** — Real activity violating policy, remediation needed
210
+ - **False Positive** — Detection logic triggered incorrectly
211
+ - **Benign Activity** — Real but expected/authorized activity
212
+
213
+ Dispositions are recommendations, not final decisions. For Critical Threats meeting incident criteria, the worker recommends escalation — the analyst decides whether to formally declare an incident.
214
+
215
+ ## Architecture
216
+
217
+ Digital Workers is a Claude Code plugin following the standard plugin architecture:
218
+
219
+ ```
220
+ digital-workers/
221
+ ├── .claude-plugin/
222
+ │ ├── plugin.json # Plugin manifest
223
+ │ └── marketplace.json # Local marketplace definition
224
+ ├── hooks/
225
+ │ ├── hooks.json # Session start hook config
226
+ │ ├── run-hook.cmd # Hook runner
227
+ │ └── session-start # Injects using-digital-workers on session start
228
+ ├── skills/
229
+ │ ├── using-digital-workers/SKILL.md
230
+ │ ├── alert-investigation/SKILL.md
231
+ │ ├── fsql-expert/
232
+ │ │ ├── SKILL.md
233
+ │ │ └── fsql-reference.md
234
+ │ ├── alert-classifier/SKILL.md
235
+ │ ├── severity-scorer/SKILL.md
236
+ │ ├── identity-investigator/SKILL.md
237
+ │ ├── network-investigator/SKILL.md
238
+ │ ├── threat-intel-enricher/SKILL.md
239
+ │ ├── report-writer/SKILL.md
240
+ │ ├── senior-analyst-review/SKILL.md
241
+ │ ├── threat-hunt/SKILL.md
242
+ │ ├── hypothesis-builder/SKILL.md
243
+ │ ├── hunt-pattern-analyzer/SKILL.md
244
+ │ ├── detection-engineer/SKILL.md
245
+ │ └── templates/
246
+ │ ├── org-policy-template.md
247
+ │ └── runbook-template.md
248
+ └── docs/
249
+ ├── design.md
250
+ ├── prd.md
251
+ └── customization-guide.md
252
+ ```
253
+
254
+ ### MCP Tools
255
+
256
+ The Query Data Mesh exposes these tools via MCP:
257
+
258
+ | Tool | Purpose |
259
+ |------|---------|
260
+ | `Execute_FSQL_Query` | Run a validated FSQL query against the mesh |
261
+ | `Validate_FSQL_Query` | Check query syntax before execution |
262
+ | `Search_FSQL_SCHEMA` | Search the OCSF schema for attributes and event types |
263
+ | `FSQL_Connectors` | List available data source connectors |
264
+ | `FSQL_Query_Generation` | Generate FSQL from natural language |
265
+ | `KQL_TO_FSQL_Query_Generation` | Convert KQL queries to FSQL |
266
+ | `SIGMA_TO_FSQL_Query_Generation` | Convert Sigma detection rules to FSQL |
267
+
268
+ ### FSQL (Federated Search Query Language)
269
+
270
+ FSQL queries the entire mesh using OCSF-normalized schemas:
271
+
272
+ ```sql
273
+ -- Discovery scan: find where an IOC appears across ALL data sources (lightweight)
274
+ QUERY *.message, *.time WITH %ip = '10.0.0.1' AFTER 24h
275
+
276
+ -- Pull new high/critical alerts with specific field selectors
277
+ QUERY detection_finding.message, detection_finding.severity_id, detection_finding.status_id,
278
+ detection_finding.time, detection_finding.observables
279
+ WITH detection_finding.severity_id IN HIGH, CRITICAL
280
+ AND detection_finding.status_id = NEW AFTER 24h
281
+
282
+ -- Pivot to telemetry: actual process execution on a host
283
+ QUERY process_activity.message, process_activity.time,
284
+ process_activity.process.name, process_activity.process.cmd_line,
285
+ process_activity.actor.process.name, process_activity.device.hostname
286
+ WITH process_activity.device.hostname = 'BD-3263'
287
+ AND %process_name = 'powershell.exe' AFTER 7d
288
+ ```
289
+
290
+ See `skills/fsql-expert/fsql-reference.md` for the complete query pattern reference.
291
+
292
+ ## Customizing for Your Organization
293
+
294
+ Everything in Digital Workers is customizable through skills — no config files, no YAML, no environment variables. See the [Customization Guide](docs/customization-guide.md) for complete documentation.
295
+
296
+ **Quick start:**
297
+
298
+ 1. Copy `skills/templates/org-policy-template.md` to `skills/your-org-policy/SKILL.md`
299
+ 2. Customize the sections you need (severity weights, crown jewels, escalation targets, etc.)
300
+ 3. The core skills automatically check for your org-policy at every gate
301
+
302
+ **What you can customize:**
303
+
304
+ - Alert intake scope (severities, time ranges, connectors)
305
+ - Severity scoring weights and depth routing thresholds
306
+ - Crown jewels / asset criticality lists
307
+ - Incident criteria and autonomy level (auto-close vs. recommend-close)
308
+ - Custom dispositions beyond the standard four
309
+ - Escalation targets and notification routing
310
+ - Report format preferences
311
+ - Senior analyst review trigger level
312
+ - Custom investigation runbooks for specific alert types
313
+
314
+ **Templates:**
315
+
316
+ | Template | Purpose |
317
+ |----------|---------|
318
+ | `skills/templates/org-policy-template.md` | All org-level settings — copy and customize |
319
+ | `skills/templates/runbook-template.md` | Custom investigation SOPs — one per scenario |
320
+
321
+ ### Writing Custom Skills
322
+
323
+ Skills are Markdown files with YAML frontmatter. Place them at `skills/<skill-name>/SKILL.md` and they're available via `digital-workers:<skill-name>`.
324
+
325
+ ```markdown
326
+ ---
327
+ name: acme-vpn-investigation
328
+ description: Use when VPN alerts fire from contractor accounts
329
+ ---
330
+
331
+ # VPN Alert Investigation
332
+
333
+ ## Iron Law
334
+
335
+ **NEVER CLOSE A VPN ALERT WITHOUT CHECKING THE CONTRACTOR SCHEDULE.**
336
+
337
+ ## Investigation Steps
338
+
339
+ [Your org-specific investigation process]
340
+ ```
341
+
342
+ ### `RECIPE_FROM_FSQL_Query_Generation`
343
+
344
+ The hunting workflow adds a new MCP tool to the repertoire:
345
+
346
+ | Tool | Purpose |
347
+ |------|---------|
348
+ | `RECIPE_FROM_FSQL_Query_Generation` | Generate Query platform hunting recipes from validated FSQL queries |
349
+
350
+ This tool is called by `detection-engineer` in Phase 4 to create deployable Query platform recipes from hunt findings.
351
+
352
+ ## Iteration History
353
+
354
+ Digital Workers has been refined through real-world investigation use. Every change below is backed by specific proof points from investigations run against live security data.
355
+
356
+ ### v0.2.0 — Proactive Threat Hunting (March 2026)
357
+
358
+ Added a complete Sqrrl-inspired threat hunting workflow alongside the existing reactive investigation capability. Designed by the CISO, built to target **Hunting Maturity Model Level 3 (HMM3)** — the system creates analytical direction, not just follows playbooks.
359
+
360
+ **New skills (4):**
361
+ - `threat-hunt` — Master orchestrator for the 4-phase Sqrrl hunting loop
362
+ - `hypothesis-builder` — Transforms raw intel into testable hypotheses with tier determination and suggest mode
363
+ - `hunt-pattern-analyzer` — Classifies findings (Active Threat / Historical / Suspicious / Coverage Gap / Clean)
364
+ - `detection-engineer` — Generates FSQL detections, Sigma rules, Query recipes, and gap remediation plans
365
+
366
+ **Key design decisions:**
367
+ - **Confidence-based completion** replaces hard query caps — hunts run to 90% confidence, not an arbitrary query count
368
+ - **Connector documentation awareness** — static vs. dynamic schema connectors handled differently, with assumptions documented
369
+ - **MCP tools as collaborators** — iterative interaction model, not fire-and-forget
370
+ - **Gap remediation as first-class output** — every hunt produces both detections and visibility improvement recommendations
371
+ - **Suggest mode (HMM3)** — system recommends what to hunt based on coverage gaps, ATT&CK analysis, TI signals, and environment changes
372
+ - **Runtime connector discovery** — no hardcoded vendor names; deploys to any Query tenant
373
+
374
+ ### v0.1.1 — Investigation Quality Improvements (March 2026)
375
+
376
+ Based on analysis of **12 real investigations** (~100+ queries, 7 overflows, 1 false escalation), systematic improvements were made across all skills.
377
+
378
+ **Query patterns**
379
+
380
+ - **Layer 1a discovery pattern** — `QUERY *.message, *.time WITH %observable` replaced bare observable scans that overflowed. Proven: 264 records inline vs 1.5M char overflows. The `__event` field reveals which event types contain data — this is how the unfamiliar-signin investigation discovered 66 missed `email_activity` records showing phishing payload delivery.
381
+ - **Narrow field selectors** — All specialists replaced broad `**` queries with specific field selectors. 0 critical findings were missed; 7 queries that used `**` or bare observables overflowed and had to be re-run.
382
+ - **Schema-first rule** — `Search_FSQL_SCHEMA` required before querying unfamiliar event types, not after a query fails.
383
+ - **Query budgets** — Tier-based caps (Triage: 6, Standard: 15, Deep: 30) prevent runaway investigations.
384
+
385
+ **Investigation quality**
386
+
387
+ - **Evidence quality checker** (new skill) — Inline quality gate at Gate 2 and Gate 3 exits. Verifies status filtering, data completeness, and analytical reasoning before proceeding.
388
+ - **Status-aware lookbacks** — Historical alert queries now require `status_id` filtering. The YTTRIUM investigation false escalation was caused by citing ~53 RESOLVED/Benign alerts as active APT threats.
389
+ - **Senior analyst review expanded** — Three new checks: status verification, attribution integrity, specialist invocation audit.
390
+ - **Telemetry pivot required** — Findings alone are insufficient. Pivoting to process, network, or auth telemetry is now a hard gate requirement at Gate 2.
391
+
392
+ **Reliability**
393
+
394
+ - **No-stall gate transitions** — Every sub-skill now has explicit "return to orchestrator and continue" instructions, fixing investigations that stalled waiting for user input.
395
+ - **Batch IOC discovery** — All IOCs from Gate 1 are scanned before starting targeted queries, giving the full landscape before drilling into any single indicator.
396
+ - **Per-host deep dives** — After identifying suspicious hosts, each gets an individual 7-day lookback. This is where multi-day persistence patterns emerge.
397
+ - **Parallel specialists** — Independent investigators (identity + network) and threat intel enrichment run concurrently.
398
+
399
+ **Investigation artifacts**
400
+
401
+ All investigation evidence is saved to `docs/investigations/` as a durable audit trail. Each investigation produces: `report.md` (final report), `queries.md` (every query with result counts), `iocs.md` (every IOC with type and reputation), and optionally `review.md` (senior analyst review).
402
+
403
+ | Investigation | Date | Key Learning |
404
+ |---|---|---|
405
+ | BD-2773 compromise | Mar 11 | Scoped `**` on single-host IP was the breakthrough query |
406
+ | High-critical alerts | Mar 11 | Hit 50-record limit on broad intake; per-host deep dives found multi-day patterns |
407
+ | YTTRIUM APT | Mar 11 | False escalation — 30-day lookback without `status_id` filter cited RESOLVED alerts as active threats |
408
+ | ContentServer C2 | Mar 11 | Good IOC registry and ATT&CK mapping; confirmed scoped `**` works for single-host process activity |
409
+ | Nation-state intrusion | Mar 11 | Needs status_id verification; may share YTTRIUM false-escalation pattern |
410
+ | Unfamiliar sign-in properties | Mar 12-13 | 4 hash scans overflowed (1.5M chars each); Layer 1a pattern would have prevented all 4; email_activity evidence missed entirely |
411
+ | High-critical alerts 24h | Mar 13 | Query budget enforcement validated at Standard tier |
412
+ | PowerShell fileless execution | Mar 13 | Telemetry pivot requirement caught execution patterns missed by findings alone |
413
+ | Unfamiliar sign-in (3 runs) | Mar 13 | Efficiency testing confirmed Layer 1a + narrow selectors reduce query count by ~40% with no loss of findings |
414
+
415
+ ### v0.1.0 — Initial Release (March 2026)
416
+
417
+ - 11-skill plugin architecture with 6-gate Discovery workflow
418
+ - Three investigation tiers (Triage / Standard / Deep) with auto-upgrade
419
+ - FSQL expert with layered query approach
420
+ - Specialist investigators for identity, network, and threat intel
421
+ - Senior analyst review with automated trigger on HIGH/CRITICAL
422
+ - Customization via org-policy skills and runbook templates
423
+
424
+ ## Roadmap
425
+
426
+ - **V1 (Current):** Claude Code plugin — interactive investigation with analyst in the loop
427
+ - **V2:** Claude API integration — programmatic access, follow-up mode, configurable analyst-in-the-loop checkpoints
428
+ - **Future:** Autonomous response actions (account disable, IOC blocking) with tiered approval model
429
+
430
+
@@ -0,0 +1,16 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "matcher": "startup|resume|clear|compact",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "'${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd' session-start",
10
+ "async": false
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
4
+ exec "$SCRIPT_DIR/$1"
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
5
+ PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
6
+
7
+ using_dw_content=$(cat "${PLUGIN_ROOT}/skills/using-digital-workers/SKILL.md" 2>&1 || echo "Error reading using-digital-workers skill")
8
+
9
+ escape_for_json() {
10
+ local s="$1"
11
+ s="${s//\\/\\\\}"
12
+ s="${s//\"/\\\"}"
13
+ s="${s//$'\n'/\\n}"
14
+ s="${s//$'\r'/\\r}"
15
+ s="${s//$'\t'/\\t}"
16
+ printf '%s' "$s"
17
+ }
18
+
19
+ using_dw_escaped=$(escape_for_json "$using_dw_content")
20
+ session_context="<IMPORTANT>\nYou have Digital Workers skills for security investigation.\n\n**Below is the 'digital-workers:using-digital-workers' skill. For all investigation skills, use the Skill tool:**\n\n${using_dw_escaped}\n</IMPORTANT>"
21
+
22
+ cat <<EOF
23
+ {
24
+ "additional_context": "${session_context}",
25
+ "hookSpecificOutput": {
26
+ "hookEventName": "SessionStart",
27
+ "additionalContext": "${session_context}"
28
+ }
29
+ }
30
+ EOF
31
+
32
+ exit 0
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@query-ai/digital-workers",
3
+ "version": "1.0.0",
4
+ "description": "Autonomous security operations framework for reactive alert investigation and proactive threat hunting.",
5
+ "homepage": "https://plugins.query.ai/claude/digital-workers",
6
+ "license": "MIT",
7
+ "files": [
8
+ ".claude-plugin",
9
+ "skills",
10
+ "hooks",
11
+ "README.md"
12
+ ],
13
+ "publishConfig": {
14
+ "access": "public"
15
+ }
16
+ }
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: alert-classifier
3
+ description: Use when a security alert needs to be classified by OCSF category, MITRE ATT&CK technique, and alert type to determine investigation path
4
+ ---
5
+
6
+ # Alert Classifier
7
+
8
+ ## Iron Law
9
+
10
+ **NO INVESTIGATION PROCEEDS WITHOUT CLASSIFICATION.**
11
+
12
+ Every alert must be classified before enrichment or analysis begins. Classification determines which specialized skills are invoked and what investigation path to follow.
13
+
14
+ ## When to Invoke
15
+
16
+ Called by `alert-investigation` at Gate 1 (Alerts Intake) for every new alert.
17
+
18
+ ## Process
19
+
20
+ ### Step 1: Extract Alert Metadata
21
+
22
+ From the `detection_finding` record, extract:
23
+ - **Finding title/message** — what the detection claims happened
24
+ - **Severity** — as reported by the source (raw, not yet scored)
25
+ - **Source connector** — which tool generated the alert
26
+ - **Timestamp** — when the event occurred
27
+ - **Status** — NEW, IN_PROGRESS, etc.
28
+ - **Any IOCs present** — IPs, hashes, domains, usernames, hostnames
29
+
30
+ ### Step 2: Map to OCSF Category
31
+
32
+ Based on the alert content, determine which OCSF event categories are relevant:
33
+
34
+ | Alert Involves | Primary OCSF Category | Key Event Types |
35
+ |---------------|----------------------|-----------------|
36
+ | Login failures, credential abuse, MFA bypass | Identity & Access (3) | `authentication`, `account_change` |
37
+ | Malware, suspicious process, persistence | System Activity (1) | `process_activity`, `file_activity` |
38
+ | Network scan, C2 beacon, lateral movement | Network Activity (4) | `network_activity`, `dns_activity`, `ssh_activity` |
39
+ | Cloud config change, API abuse | Application Activity (6) | `api_activity`, `web_resource_activity` |
40
+ | Email-based attack, phishing | Network Activity (4) | `email_activity` |
41
+ | Vulnerability exploitation | Findings (2) | `vulnerability_finding` |
42
+ | Policy violation, compliance drift | Findings (2) | `compliance_finding` |
43
+
44
+ ### Step 3: Map to MITRE ATT&CK Technique
45
+
46
+ Based on alert content, identify the most specific ATT&CK technique:
47
+
48
+ | Alert Pattern | Likely Technique | ID |
49
+ |--------------|-----------------|-----|
50
+ | Failed logins, credential stuffing | Valid Accounts | T1078 |
51
+ | Phishing email detected | Phishing | T1566 |
52
+ | Suspicious PowerShell/cmd execution | Command and Scripting Interpreter | T1059 |
53
+ | LSASS access, credential dumping | OS Credential Dumping | T1003 |
54
+ | New scheduled task/service | Scheduled Task/Job | T1053 |
55
+ | Registry modification for persistence | Boot or Logon Autostart Execution | T1547 |
56
+ | Unusual outbound connections | Application Layer Protocol (C2) | T1071 |
57
+ | Large data transfer outbound | Exfiltration Over Web Service | T1567 |
58
+ | Account creation/privilege escalation | Create Account / Valid Accounts | T1136/T1078 |
59
+ | DNS tunneling, unusual DNS | Protocol Tunneling | T1572 |
60
+
61
+ Use sub-techniques (T1059.001 for PowerShell) when the alert is specific enough. Use the parent technique when ambiguous.
62
+
63
+ ### Step 4: Determine Alert Type
64
+
65
+ Classify into one of these types, which determines the investigation path:
66
+
67
+ | Alert Type | Description | Primary Investigators Needed |
68
+ |-----------|-------------|------------------------------|
69
+ | **Identity/Access** | Auth failures, privilege escalation, account compromise | `identity-investigator` |
70
+ | **Malware/Endpoint** | Suspicious process, file activity, persistence | (future: `endpoint-investigator`) |
71
+ | **Network/Lateral** | Lateral movement, C2, scanning, exfiltration | `network-investigator` |
72
+ | **Phishing/Email** | Email-based attacks, BEC, credential harvesting | (future: `email-investigator`) |
73
+ | **Cloud/Application** | Cloud config changes, API abuse, SaaS compromise | (future: `cloud-investigator`) |
74
+ | **Policy/Compliance** | Policy violations, compliance drift | Report only |
75
+
76
+ ### Step 5: Identify Initial IOCs
77
+
78
+ Extract any indicators of compromise present in the alert:
79
+ - IP addresses (source, destination)
80
+ - File hashes (MD5, SHA1, SHA256)
81
+ - Domain names / URLs
82
+ - Email addresses
83
+ - User accounts / service accounts
84
+ - Hostnames / device names
85
+ - Process names / command lines
86
+
87
+ These IOCs will be passed to `threat-intel-enricher` and used for follow-up FSQL queries.
88
+
89
+ ## Output
90
+
91
+ Return to the orchestrator:
92
+
93
+ ```
94
+ CLASSIFICATION:
95
+ OCSF Category: [category name and ID]
96
+ MITRE ATT&CK: [technique name and ID, sub-technique if applicable]
97
+ Alert Type: [Identity/Access | Malware/Endpoint | Network/Lateral | Phishing/Email | Cloud/Application | Policy/Compliance]
98
+ Source Severity: [as reported by detection tool]
99
+ Initial IOCs: [list of extracted indicators]
100
+ Recommended Investigators: [list of specialized skills to invoke]
101
+ ```
102
+
103
+ **Return this classification to the calling orchestrator and continue. Do not present to the user or wait for input — the orchestrator will use it to route the investigation.**
104
+
105
+ ## Red Flags
106
+
107
+ | Red Flag | Correct Action |
108
+ |----------|---------------|
109
+ | "I can't determine the category" | Use the alert title + any field names to make best determination. Note low confidence. |
110
+ | "This could be multiple types" | Pick the primary type. Note secondary types for the orchestrator to consider. |
111
+ | "Skipping ATT&CK mapping, it's obvious" | STOP. Every alert gets mapped. Even obvious ones need documentation. |