Using embedding models to retrieve AI agent sessions to assist threat hunting
Start here
Researchers at Elastic Security Labs embedded 399 Claude Code and Cursor sessions and 7,454 conversation turns over six months into Elasticsearch across four channels—user input, agent reasoning, agent replies, and tool calls—and used vector retrieval instead of having a generative model read them one by one, to conduct threat hunting on agent sessions. The authors evaluated on sessions they annotated themselves; vector retrieval had higher MRR than BM25 keyword retrieval on all four channels, with the strongest signal in the reasoning channel and the lowest in the user channel.
Generated by AI from reports · Updated 24 days ago
Progress timeline
- ElasticMonitoring AI agent sessions: using embedding models to assist threat hunting and attack discovery workflows
Researchers at Elastic Security Labs embedded six months of 399 Claude Code and Cursor sessions and 7,454 conversation turns into Elasticsearch across four channels—user input, agent reasoning, agent replies, and tool calls—and used vector retrieval instead of having a generative model read them one by one, to conduct threat hunting on agent sessions. Evaluated on their own annotated sessions, vector retrieval had higher MRR than BM25 keyword retrieval on all four channels, with the strongest signal in the reasoning channel and the lowest in the user channel. Example retrieval using the original text of known malicious sessions as queries hit the most in testing, but the authors consider it better suited to finding repeated runs of the same workflow. The article also estimates the storage and embedding cost of 600 million vector representations per year for 10,000 engineers, and discusses constraints on such monitoring under UK GDPR and DPIA.
Related discussion
- Older than 72 hours · Not included in the 72-hour figures
- X@DFIR_RadarElastic Security Labs embedded six months of Claude Code and Cursor sessions as vectors, finding one in seven of 399 se…(opens the original post in a new tab)