@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,516 @@
1
+ ---
2
+ name: org-policy
3
+ description: Organization-specific policy — loaded automatically by alert-investigation at every gate to customize thresholds, criteria, and behavior
4
+ ---
5
+
6
+ # Organization Policy
7
+
8
+ > **How to use this template:**
9
+ > 1. Copy this file into a new skill folder: `skills/<your-org>-org-policy/SKILL.md`
10
+ > 2. Rename the skill in the YAML frontmatter (e.g., `name: acme-org-policy`)
11
+ > 3. Customize the sections below to match your organization's security posture
12
+ > 4. Any section you leave unchanged uses the built-in defaults shown here
13
+ > 5. The `alert-investigation` skill reads this automatically at every gate
14
+ >
15
+ > You do not need to include every section. Delete sections you don't need to
16
+ > customize -- the framework's built-in defaults will apply for anything missing.
17
+
18
+ ---
19
+
20
+ ## Alert Scope (Gate 1)
21
+
22
+ These settings control which alerts the framework pulls during intake.
23
+
24
+ ### Severity Filter
25
+
26
+ <!-- Which alert severities to pull. Remove levels you do NOT want investigated. -->
27
+ <!-- Options: INFO, LOW, MEDIUM, HIGH, CRITICAL, FATAL -->
28
+
29
+ ```
30
+ severity_filter:
31
+ - HIGH
32
+ - CRITICAL
33
+ - FATAL
34
+ ```
35
+
36
+ ### Time Range
37
+
38
+ <!-- How far back to look for new alerts during intake. -->
39
+ <!-- This is the default window; analysts can override per-investigation. -->
40
+
41
+ ```
42
+ intake_time_range: 24h
43
+ ```
44
+
45
+ ### Connector Scope
46
+
47
+ <!-- Which data connectors to pull alerts from. -->
48
+ <!-- Use "all" to query every connected source, or list specific connectors. -->
49
+
50
+ ```
51
+ connector_scope: all
52
+
53
+ # To limit to specific connectors, replace "all" with a list:
54
+ # connector_scope:
55
+ # - crowdstrike
56
+ # - sentinel
57
+ # - okta
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Severity Weights (Gate 3)
63
+
64
+ These weights control how the five scoring dimensions combine into the composite
65
+ severity score that determines investigation depth.
66
+
67
+ ### Dimension Weights
68
+
69
+ <!-- All five weights MUST add up to 1.0 -->
70
+ <!-- Increase a weight to make that dimension matter more in routing decisions. -->
71
+
72
+ ```
73
+ weights:
74
+ alert_severity: 0.20 # Raw severity from the detection tool
75
+ asset_criticality: 0.25 # How important the affected system is
76
+ business_impact: 0.25 # Potential harm to the organization
77
+ confidence: 0.15 # Quality and corroboration of evidence
78
+ threat_context: 0.15 # Threat intelligence relevance
79
+ ```
80
+
81
+ **Examples of common adjustments:**
82
+
83
+ - Heavily regulated environment (healthcare, finance): increase `business_impact` to 0.30, reduce `threat_context` to 0.10
84
+ - Environment with noisy detection tools: increase `confidence` to 0.25, reduce `alert_severity` to 0.10
85
+ - Organization frequently targeted by APTs: increase `threat_context` to 0.25, reduce `confidence` to 0.10
86
+
87
+ ### Depth Routing Thresholds
88
+
89
+ <!-- Composite score ranges that determine investigation depth. -->
90
+ <!-- Adjust these to make the framework more or less aggressive. -->
91
+
92
+ ```
93
+ depth_routing:
94
+ auto_close: 1.0 - 1.9 # Low-risk alerts: document and close
95
+ standard: 2.0 - 2.9 # Moderate-risk: standard investigation with verdict
96
+ deep: 3.0 - 5.0 # High-risk: full specialist investigation
97
+ ```
98
+
99
+ **Common adjustments:**
100
+
101
+ - More aggressive (investigate more): change standard to `1.5 - 2.4` and deep to `2.5 - 5.0`
102
+ - More conservative (close more): change auto\_close to `1.0 - 2.2` and standard to `2.3 - 3.2`
103
+
104
+ ### Override Rules
105
+
106
+ <!-- Conditions that ALWAYS force DEEP investigation, regardless of composite score. -->
107
+ <!-- These exist because certain patterns are too dangerous to under-investigate. -->
108
+ <!-- Comment out any overrides you want to disable. Add custom ones as needed. -->
109
+
110
+ ```
111
+ force_deep_overrides:
112
+ - lateral_movement_detected
113
+ - persistence_mechanism_discovered
114
+ - credential_compromise_indicators
115
+ - data_exfiltration_signals
116
+ - multiple_correlated_alerts_same_actor
117
+ - novel_unseen_technique
118
+
119
+ # Add your own override rules:
120
+ # - vpn_from_sanctioned_country
121
+ # - service_account_interactive_login
122
+ # - access_to_pci_zone_after_hours
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Crown Jewels / Asset Criticality (Gate 3)
128
+
129
+ Define your organization's critical and high-value assets. The severity scorer
130
+ uses this list to assign the Asset Criticality dimension score. Assets not listed
131
+ here are scored by inference from hostname, IP range, and system role.
132
+
133
+ ### Critical Assets (score 5/5)
134
+
135
+ <!-- These are your "crown jewels" -- compromise of any of these is a top-priority event. -->
136
+ <!-- Use hostname patterns, IP ranges, or descriptions. -->
137
+
138
+ ```
139
+ critical_assets:
140
+
141
+ # --- Hostname patterns (supports wildcards) ---
142
+ - pattern: "dc-*.corp.example.com"
143
+ description: "Domain controllers"
144
+
145
+ - pattern: "ca-*.corp.example.com"
146
+ description: "Certificate authority servers"
147
+
148
+ - pattern: "prod-db-*.example.com"
149
+ description: "Production customer databases"
150
+
151
+ - pattern: "vault-*.example.com"
152
+ description: "Secrets management / key vaults"
153
+
154
+ # --- IP ranges ---
155
+ - range: "10.1.100.0/24"
156
+ description: "PCI cardholder data environment"
157
+
158
+ - range: "10.2.50.0/28"
159
+ description: "Core banking systems"
160
+
161
+ # --- Named systems ---
162
+ - name: "FINANCIALS-PROD-01"
163
+ description: "ERP / financial reporting system"
164
+ ```
165
+
166
+ ### High-Value Assets (score 4/5)
167
+
168
+ <!-- Important systems that are not crown jewels but still warrant elevated attention. -->
169
+
170
+ ```
171
+ high_value_assets:
172
+
173
+ - pattern: "prod-app-*.example.com"
174
+ description: "Production application servers"
175
+
176
+ - pattern: "mail-*.example.com"
177
+ description: "Email gateway and exchange servers"
178
+
179
+ - pattern: "vpn-*.example.com"
180
+ description: "VPN concentrators"
181
+
182
+ - range: "10.1.200.0/24"
183
+ description: "Production application tier"
184
+
185
+ - name: "SIEM-COLLECTOR-01"
186
+ description: "Security log aggregation"
187
+ ```
188
+
189
+ > **Tip:** Assets not listed in either category are scored 1-3 based on inference.
190
+ > You only need to list assets that should receive elevated scoring.
191
+
192
+ ---
193
+
194
+ ## Incident Criteria (Gate 4)
195
+
196
+ These criteria define when the framework recommends escalation to your Incident
197
+ Response process. When a proposed disposition is "Critical Threat" AND any of
198
+ these criteria are met, the framework flags the alert for incident escalation.
199
+
200
+ ### Escalation Triggers
201
+
202
+ <!-- Conditions that warrant incident escalation when combined with a Critical Threat disposition. -->
203
+ <!-- Customize this list to match your organization's incident response plan. -->
204
+
205
+ ```
206
+ incident_criteria:
207
+ - active_ongoing_compromise
208
+ - data_exfiltration_confirmed
209
+ - lateral_movement_to_high_value_assets
210
+ - credential_compromise_with_privilege_escalation
211
+
212
+ # Add criteria specific to your organization:
213
+ # - pci_environment_breach
214
+ # - pii_exposure_confirmed
215
+ # - ransomware_indicators
216
+ # - supply_chain_compromise_indicators
217
+ # - regulatory_notification_threshold_met
218
+ ```
219
+
220
+ ### Autonomy Level
221
+
222
+ <!-- Controls what the framework does with low-risk alerts it wants to close. -->
223
+ <!-- auto-close = Framework closes False Positive / Benign alerts automatically, -->
224
+ <!-- documents reasoning, and moves on. Best for high-volume SOCs. -->
225
+ <!-- recommend-close = Framework presents its disposition as a recommendation and -->
226
+ <!-- waits for analyst confirmation before closing. Best for -->
227
+ <!-- teams that require human sign-off on every disposition. -->
228
+
229
+ ```
230
+ autonomy_level: auto-close
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Disposition Categories (Gate 4)
236
+
237
+ The framework uses four standard disposition categories. You can add custom
238
+ categories for situations specific to your organization.
239
+
240
+ ### Standard Categories
241
+
242
+ <!-- These four are built in and always available. You cannot remove them, -->
243
+ <!-- but you can adjust the descriptions to match your internal terminology. -->
244
+
245
+ ```
246
+ dispositions:
247
+
248
+ critical_threat:
249
+ label: "Critical Threat"
250
+ description: "Confirmed malicious activity. Evidence of compromise. Immediate response needed."
251
+
252
+ policy_violation:
253
+ label: "Policy Violation"
254
+ description: "Real activity violating policy. May not be malicious. Remediation needed."
255
+
256
+ false_positive:
257
+ label: "False Positive"
258
+ description: "Detection logic triggered incorrectly. No actual security event."
259
+
260
+ benign_activity:
261
+ label: "Benign Activity"
262
+ description: "Real activity that is expected or authorized. No action needed."
263
+ ```
264
+
265
+ ### Custom Categories
266
+
267
+ <!-- Add categories for situations your team encounters regularly. -->
268
+ <!-- Custom categories are used when an alert doesn't fit the four standard ones. -->
269
+
270
+ ```
271
+ custom_dispositions:
272
+
273
+ # authorized_pen_test:
274
+ # label: "Authorized Pen Test"
275
+ # description: "Activity is part of a sanctioned penetration test or red team exercise."
276
+ # action: "Log and correlate with engagement schedule. No remediation needed."
277
+
278
+ # known_risk_accepted:
279
+ # label: "Known Risk Accepted"
280
+ # description: "Activity relates to a risk that has been formally accepted by management."
281
+ # action: "Document against risk acceptance record. Review at next risk committee."
282
+
283
+ # vendor_activity:
284
+ # label: "Vendor Activity"
285
+ # description: "Activity from an authorized third-party vendor within their approved scope."
286
+ # action: "Verify against vendor access schedule and SOW. Log for audit trail."
287
+
288
+ # change_related:
289
+ # label: "Change-Related Activity"
290
+ # description: "Alert triggered by an approved change request or maintenance window."
291
+ # action: "Correlate with change ticket. Close if activity matches approved scope."
292
+ ```
293
+
294
+ > **Tip:** Uncomment and customize the examples above, or add your own following
295
+ > the same format.
296
+
297
+ ---
298
+
299
+ ## Escalation Targets (Gate 6)
300
+
301
+ Define where reports and notifications go based on the investigation outcome.
302
+ By default, all results are presented in the current session. Add routing
303
+ rules to direct specific disposition types to the right people.
304
+
305
+ ```
306
+ escalation_targets:
307
+
308
+ critical_threat:
309
+ # Where to send Critical Threat findings
310
+ primary: "present in session"
311
+ # additional:
312
+ # - channel: "#incident-response"
313
+ # method: "slack"
314
+ # - recipient: "soc-lead@example.com"
315
+ # method: "email"
316
+ # - recipient: "ir-oncall"
317
+ # method: "pagerduty"
318
+
319
+ policy_violation:
320
+ primary: "present in session"
321
+ # additional:
322
+ # - channel: "#security-policy"
323
+ # method: "slack"
324
+ # - recipient: "compliance-team@example.com"
325
+ # method: "email"
326
+
327
+ false_positive:
328
+ primary: "present in session"
329
+ # additional:
330
+ # - channel: "#detection-engineering"
331
+ # method: "slack"
332
+ # note: "Include tuning recommendation for rule improvement"
333
+
334
+ benign_activity:
335
+ primary: "present in session"
336
+ ```
337
+
338
+ > **Note:** Notification integrations depend on your environment's available
339
+ > connectors. The values above are routing instructions that the report writer
340
+ > includes in the recommended next steps. Actual delivery requires integration
341
+ > configuration outside of this policy file.
342
+
343
+ ---
344
+
345
+ ## Report Format (Gate 6)
346
+
347
+ Control which sections appear in investigation reports. All sections are
348
+ included by default. Set a section to `false` to exclude it.
349
+
350
+ ```
351
+ report_sections:
352
+
353
+ business_summary: true # Plain-English summary (always recommended)
354
+ proposed_disposition: true # Disposition with evidence
355
+ five_ws: true # Who, What, When, Where, Why table
356
+ mitre_attack_mapping: true # ATT&CK tactic and technique
357
+ ioc_table: true # Indicators of compromise with reputation
358
+ evidence_chain: true # Queries run and conclusions drawn
359
+ correlated_alerts: true # Related alerts discovered during investigation
360
+ recommended_next_steps: true # Actionable response guidance
361
+ show_your_work: false # Full query log and reasoning chain
362
+ # (verbose -- enable for audit or training)
363
+ ```
364
+
365
+ ### Additional Report Preferences
366
+
367
+ ```
368
+ report_preferences:
369
+
370
+ # Include the severity score breakdown in every report
371
+ include_severity_breakdown: true
372
+
373
+ # Include timeline visualization for DEEP investigations
374
+ include_timeline: true
375
+
376
+ # Append the raw FSQL queries to the report for reproducibility
377
+ include_raw_queries: false
378
+
379
+ # Maximum length guidance for the business summary
380
+ business_summary_max_sentences: 6
381
+ ```
382
+
383
+ ---
384
+
385
+ ## Senior Analyst Review (Post-Gate 6)
386
+
387
+ Controls when the automated senior analyst review runs after an investigation
388
+ is complete.
389
+
390
+ ### Review Trigger
391
+
392
+ <!-- When to automatically invoke the senior analyst review. -->
393
+ <!-- all = Review every completed investigation -->
394
+ <!-- high_critical = Review only investigations scored HIGH or CRITICAL (default) -->
395
+ <!-- critical_only = Review only CRITICAL dispositions and DEEP investigations -->
396
+ <!-- manual = Never auto-trigger; analyst invokes review manually -->
397
+
398
+ ```
399
+ review_trigger: high_critical
400
+ ```
401
+
402
+ ### Review Cycle Limit
403
+
404
+ <!-- Maximum number of review-and-fix cycles before presenting the investigation -->
405
+ <!-- to the analyst with review notes attached. -->
406
+
407
+ ```
408
+ max_review_cycles: 2
409
+ ```
410
+
411
+ ---
412
+
413
+ ## Default Time Ranges
414
+
415
+ Default lookback windows for different query types. Analysts can override these
416
+ per-investigation; these values are used when no override is specified.
417
+
418
+ ```
419
+ time_ranges:
420
+
421
+ # Gate 1: How far back to pull alerts
422
+ alert_intake: 24h
423
+
424
+ # Gate 2: IOC enrichment (varies by IOC type)
425
+ ioc_enrichment:
426
+ ip_address: 24h # IPs rotate frequently; short window reduces noise
427
+ file_hash: 30d # Hashes are stable; longer window catches slow attacks
428
+ username: 7d # User activity over a week shows patterns
429
+ domain: 7d # DNS activity over a week
430
+ email: 30d # Email-based attacks may have longer dwell time
431
+
432
+ # Gate 2: Threat intelligence lookback
433
+ threat_intel: 30d
434
+
435
+ # Identity investigator: Authentication pattern baseline
436
+ auth_patterns: 7d
437
+
438
+ # Identity investigator: Account change history
439
+ account_changes: 30d
440
+
441
+ # Network investigator: Flow and connection data
442
+ network_activity: 7d
443
+ ```
444
+
445
+ > **Guidance:** Shorter time ranges run faster and return less noise, but may miss
446
+ > slow-moving attacks. Longer ranges catch more but increase query time and require
447
+ > more analysis. Adjust based on your data retention policies and typical attacker
448
+ > dwell time in your environment.
449
+
450
+ ---
451
+
452
+ ## Custom Investigation Runbooks
453
+
454
+ Link custom runbook skills for specific alert types. When the alert classifier
455
+ identifies an alert type that matches a runbook, the framework invokes your
456
+ custom skill in addition to (or instead of) the default investigation process.
457
+
458
+ ### How Runbooks Work
459
+
460
+ 1. Create a new skill in `skills/<your-runbook-name>/SKILL.md`
461
+ 2. Reference it below with the alert type or MITRE technique it handles
462
+ 3. The framework invokes your runbook at Gate 4 (Decide & Act) during DEEP investigations
463
+
464
+ ### Runbook Mappings
465
+
466
+ ```
467
+ custom_runbooks:
468
+
469
+ # Map by alert type (from alert-classifier output)
470
+ # by_alert_type:
471
+ # "Identity/Access":
472
+ # skill: "digital-workers:acme-identity-runbook"
473
+ # mode: "supplement" # "supplement" runs alongside default investigator
474
+ # # "replace" runs instead of default investigator
475
+ #
476
+ # "Phishing/Email":
477
+ # skill: "digital-workers:acme-phishing-runbook"
478
+ # mode: "replace"
479
+
480
+ # Map by MITRE ATT&CK technique ID
481
+ # by_technique:
482
+ # "T1566": # Phishing
483
+ # skill: "digital-workers:acme-phishing-runbook"
484
+ # mode: "replace"
485
+ #
486
+ # "T1078": # Valid Accounts
487
+ # skill: "digital-workers:acme-compromised-creds-runbook"
488
+ # mode: "supplement"
489
+
490
+ # Map by source connector (when a specific tool needs special handling)
491
+ # by_connector:
492
+ # "crowdstrike":
493
+ # skill: "digital-workers:acme-crowdstrike-procedures"
494
+ # mode: "supplement"
495
+ ```
496
+
497
+ > **Tip:** Start with `mode: "supplement"` so your custom runbook adds to the
498
+ > built-in investigation. Switch to `mode: "replace"` only when your runbook
499
+ > fully covers the investigation steps for that alert type.
500
+
501
+ ---
502
+
503
+ ## Quick Reference: Which Gate Uses What
504
+
505
+ | Setting | Section | Gate |
506
+ |---------|---------|------|
507
+ | Severity filter, time range, connector scope | Alert Scope | Gate 1 |
508
+ | Dimension weights, depth thresholds, overrides | Severity Weights | Gate 3 |
509
+ | Crown jewels, asset lists | Crown Jewels / Asset Criticality | Gate 3 |
510
+ | Incident criteria, autonomy level | Incident Criteria | Gate 4 |
511
+ | Disposition categories | Disposition Categories | Gate 4 |
512
+ | Escalation targets | Escalation Targets | Gate 6 |
513
+ | Report sections, preferences | Report Format | Gate 6 |
514
+ | Review trigger, cycle limit | Senior Analyst Review | Post-Gate 6 |
515
+ | Lookback windows | Default Time Ranges | Gates 1, 2, 4 |
516
+ | Runbook links | Custom Investigation Runbooks | Gate 4 |