Skip to content

Add Agentmetry Wazuh 4.14 integration - #127

Open
blitzcrieg1 wants to merge 1 commit into
wazuh:mainfrom
blitzcrieg1:agentmetry-wazuh-v4.14
Open

blitzcrieg1 wants to merge 1 commit into
wazuh:mainfrom
blitzcrieg1:agentmetry-wazuh-v4.14

Conversation

@blitzcrieg1

@blitzcrieg1 blitzcrieg1 commented Nov 7, 2026 •

Copy link
Copy Markdown

Description

Agentmetry is an Apache-2.0 sensor for AI coding agents. It records the tool calls agents report through their hooks in a hash-chained local trail, and correlates sequences into detections mapped to MITRE ATT&CK.

This package reads that trail with a localfile and alerts on the detection events. It follows the guidance in wazuh/wazuh#41217: a separate package, starting with 4.14 and with detection events, using rule IDs outside the reserved ranges.

  • 20 rules in 997600-997699, which I added to SCHEMA.md
  • Levels by severity: critical 15, high 12, medium 7, low 4
  • MITRE mappings taken from the technique_ids on the detection events
  • No custom decoder. The built-in JSON decoder handles trail lines, and a custom one lost to it in testing
  • An agentmetry section in VERIFY.md

Testing

Tested on a real wazuh/wazuh-manager:4.14.9 container with Agentmetry 0.10.6 from PyPI. scripts/capture_and_test.sh reproduces the whole run.

Check Result
agentmetry.ini through wazuh-logtest 15 of 15 pass on rule, level and decoder
Live localfile path into alerts.json 14 of 14 detection samples alerted, one per rule
Tool call activity sample Matches 997600 at level 0, no alert

Limits to check in review

  1. The samples are not from a live agent session. You asked for real captured samples. Every line was written and hash-chained by a real recorder, but the sessions are Agentmetry's scripted attack cases, replayed through its ingest route. If you need samples from a live agent, tell me and I will capture them.

  2. Collection path. The test reported above uses localfile on the Wazuh manager. Agent-side collection is outside the scope of that test.

  3. Two rules have no sample. host-subagent-swarm-burst and off-hours-activity did not fire in the replay, so they have no specific rule and alert by severity with no MITRE mapping. The severity rules 997602 to 997605 are never the final match in the samples, because each tested detection has a specific rule.

  4. Nobody is known to run this yet. I still know of no one running Agentmetry with Wazuh.

  5. Replay and rotation. The submitted rules evaluate each copy of a saved record independently, so rereading one can create another alert. The saved Agentmetry event keeps its source ID, which Wazuh exposes at data.event.event_id. The replay and rotation validation plan is tracked in Agentmetry #410.

Wazuh 5.0 is not included and would follow as a separately tested package.

Provenance

Alerts on the detection events in an Agentmetry trail, read through a
localfile. Rules use the 997600-997699 range and key on detection events,
because tool arguments are hashed by default. No custom decoder is needed.

Tested on wazuh/wazuh-manager:4.14.9 with Agentmetry 0.10.6: 15 of 15
logtest cases pass, and 14 of 14 detection samples alert over the live
localfile path. The samples come from a real recorder replaying Agentmetry's
scripted attack sessions, not a live agent session.
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.

1 participant