Skip to content

[Agent Builder] Add detection engineering prebuilt skill with tools#258362

Draft
patrykkopycinski wants to merge 2 commits intoelastic:mainfrom
patrykkopycinski:feature/detection-engineering-skill
Draft

[Agent Builder] Add detection engineering prebuilt skill with tools#258362
patrykkopycinski wants to merge 2 commits intoelastic:mainfrom
patrykkopycinski:feature/detection-engineering-skill

Conversation

@patrykkopycinski
Copy link
Contributor

Summary

Adds a comprehensive detection engineering prebuilt skill for Agent Builder that covers the full detection lifecycle from threat analysis to production deployment and ongoing monitoring.

New registry tools (6)

  • security.find_rules — Search and filter detection rules by name, type, tags, enabled status, prebuilt/custom
  • security.manage_rules — Bulk enable, disable, or duplicate rules
  • security.preview_rule — Test rule queries (ES|QL, EQL, KQL, threshold) against live data without creating a rule
  • security.manage_exceptions — Find existing exceptions, detect overlapping conditions, prepare new exception definitions
  • security.coverage_overview — Analyze MITRE ATT&CK coverage across all rules, identify gaps and unmapped rules
  • security.rule_monitoring — Check rule execution health: errors, performance metrics, alert generation rates

Skill content

  • End-to-end detection engineering guide with 6 named workflows (A–F)
  • 9 e2e scenario examples covering: new data source onboarding, threat report response, SIEM migration, weekly/daily reports, incident response tuning, prebuilt rules lifecycle, SOC analyst bulk FP fixes
  • Rule type selection guide (KQL vs EQL vs ES|QL vs Threshold vs ML)
  • Referenced content: detection best practices, MITRE ATT&CK mapping guide
  • Integrates with existing tools: security.alerts, security.create_detection_rule, security.security_labs_search, platform.core.cases, platform.core.execute_esql, platform.core.generate_esql

All tools gated behind aiRuleCreationEnabled experimental feature flag.

Files changed

Area Files
Skill definition skills/detection_engineering/index.ts, content.ts
New tools find_rules_tool.ts, manage_rules_tool.ts, preview_rule_tool.ts, manage_exceptions_tool.ts, coverage_overview_tool.ts, rule_monitoring_tool.ts
Registration register_skills.ts, register_tools.ts, tools/index.ts
Tests 7 test files, 145 unit tests total

Test plan

  • 145 unit tests covering schema validation, tool properties, availability (feature flag on/off), and handler logic for all 6 tools + skill definition
  • TypeScript type check passes (yarn test:type_check --project)
  • ESLint passes on all changed files
  • Manual verification against a local cluster with detection rules data

Made with Cursor

Adds a comprehensive detection engineering skill for Agent Builder that
covers the full detection lifecycle: threat analysis, rule creation,
MITRE ATT&CK coverage assessment, rule testing, tuning, monitoring,
prebuilt rule onboarding, and exception management.

New registry tools:
- security.find_rules — search and filter detection rules
- security.manage_rules — bulk enable/disable/duplicate rules
- security.preview_rule — test rule queries against live data
- security.manage_exceptions — find, prepare, and overlap-check exceptions
- security.coverage_overview — analyze MITRE ATT&CK coverage
- security.rule_monitoring — check rule execution health

The skill includes 9 end-to-end workflow definitions covering scenarios
from new data source onboarding to SOC analyst bulk false positive fixes,
plus reference content for rule type selection and MITRE ATT&CK mapping.

All tools are gated behind the aiRuleCreationEnabled experimental flag.
145 unit tests covering schema validation, availability, and handlers.
@patrykkopycinski
Copy link
Contributor Author

/ci

@elasticmachine
Copy link
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

…add eval suite

- Refactor 6 detection engineering tools from globally-registered BuiltinToolDefinition
  to skill-scoped BuiltinSkillBoundedTool (inline tools), preventing global tool library
  pollution when the skill is not active
- Update skill definition to accept core/logger dependencies and expose tools via
  getInlineTools instead of getRegistryTools
- Create @kbn/evals-suite-security-detection-engineering evaluation suite with:
  - Skill selection dataset (6 examples across all tool types)
  - Tool invocation dataset (5 examples validating parameter accuracy)
  - Workflow quality dataset (4 multi-step e2e scenarios)
  - Criteria + ToolCalls + Correctness + Groundedness evaluators
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants