# Monitoring AI agent sessions: Leveraging embedding models to aid threat hunting and attack discovery workflows

DevFeed: [Monitoring AI agent sessions: Leveraging embedding models to aid threat hunting and attack discovery workflows](<https://devfeed.tech/articles/monitoring-ai-agent-sessions-leveraging-embedding-models-to-aid-threat-hunting-and-attack-discovery-workflows-117862.md>)

Original publisher: [Read original article](<https://www.elastic.co/security-labs/blog/ai-agent-session-monitoring-embedding-models>)

Author: Marcus Jeffes

Published: 2026-11-04T00:00:00Z

Content type: article

Language: en

Sources: [Elastic Security Labs](<https://devfeed.tech/sources/elastic-security-labs.md>)

Topics: [Threat monitoring](<https://devfeed.tech/topics/threat-monitoring.md>), [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [Threat Hunting & Intel](<https://devfeed.tech/topics/threat-hunting-intel.md>), [alert triage](<https://devfeed.tech/topics/alert-triage.md>), [AI Agent](<https://devfeed.tech/topics/ai-agent.md>), [Claude Code](<https://devfeed.tech/topics/claude-code.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [ai-automation](<https://devfeed.tech/tags/ai-automation.md>), [attack](<https://devfeed.tech/tags/attack.md>), [attack-discovery](<https://devfeed.tech/tags/attack-discovery.md>), [discovery](<https://devfeed.tech/tags/discovery.md>), [embedding](<https://devfeed.tech/tags/embedding.md>), [i](<https://devfeed.tech/tags/i.md>), [leveraging](<https://devfeed.tech/tags/leveraging.md>), [models](<https://devfeed.tech/tags/models.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [more](<https://devfeed.tech/tags/more.md>), [my](<https://devfeed.tech/tags/my.md>), [one](<https://devfeed.tech/tags/one.md>), [prompt](<https://devfeed.tech/tags/prompt.md>), [questions](<https://devfeed.tech/tags/questions.md>), [reasoning](<https://devfeed.tech/tags/reasoning.md>), [sessions](<https://devfeed.tech/tags/sessions.md>), [soc](<https://devfeed.tech/tags/soc.md>), [threat-hunting](<https://devfeed.tech/tags/threat-hunting.md>), [workflows](<https://devfeed.tech/tags/workflows.md>)

## AI overview

Embedding agent-session turns by channel and storing their vectors in Elastic enables repeatable semantic hunts against old data without rerunning an LLM over every session. In the author's six-month sample of 399 Claude Code and Cursor sessions (7,454 turns), an LLM labeler marked 56 real sessions for review; agent reasoning carried more incident signal than user prompts. Vector and BM25 search were close, with vectors performing better on the normalized data, while keyword search remained competitive for literal commands. Exemplar searches worked well for repeated instances of known workflows; written hunts were still needed to find different workflows with similar risks. The approach depends on suitable queries and thresholds, and results may not generalize: the sample was one person's security-focused work, the embedding model was not trained on agent transcripts, and some ATLAS areas showed weak retrieval. Claude Code telemetry omits reasoning, the strongest channel in this evaluation. The author also notes that vectors remain personal data and monitoring requires jurisdiction-specific legal review and access controls.

## Source excerpt

I tested vector search on 7,454 turns of my own agent sessions. One in seven sessions needed review, the agent's reasoning carried more signal than the prompt, and the stored vectors answer questions nobody thought to ask at ingest.