Agent telemetry records each tool call a coding agent makes, so a correlation detection can flag an agent that installs an unvetted package right after loading an unapproved skill, before stolen tokens spread.
Agents are the new phishing target
Security teams joke that people are Layer 8 of the OSI model. Defense at that layer depends on spotting manipulation: false authority, manufactured urgency, a request dressed up as routine. Awareness training never makes people immune, and coding agents resist manipulation even less consistently. They tend to treat instructions in skills, docs, and repos as tasks to complete, and they act with the developer’s shell, credentials, and trust.
Mandiant’s AI Risk and Resilience 2026 report shows what that looks like. An attacker compromised a SaaS provider and hijacked an active AI coding assistant session on a developer’s workstation. The assistant recommended installing a package the attacker had already poisoned, and the developer accepted.
The package installed an infostealer and harvested GitHub OAuth tokens. Those tokens spread the Shai-Hulud worm across about 100 internal code repositories. Nobody clicked a phishing link. The agent made the recommendation, and the developer trusted it.
Mandiant has not published how the session was steered. Malicious agent skills are one documented way, and they are spreading:
Snyk’s ToxicSkills review found that 13.4% of 3,984 skills on ClawHub and skills.sh had at least one critical security issue.
VirusTotal found that 62% of 6,637 malicious agent skills contain no malicious code. The payload is plain-language instructions that the agent follows.
Coding agents are non-human identities, and they need the same governance as any other: scoped roles, least privilege, and an audit trail of what they did. Most borrow the developer’s credentials today, so their actions land in IAM logs as the developer’s own. Agent telemetry is the audit trail that tells the two apart.
The question for security teams: when an agent is steered into a bad action, how do you detect it, and how do you stop it before stolen tokens spread the damage?
What coverage looks like: one Sigma correlation
A two-rule Sigma correlation catches the moment an unapproved skill steers an agent into an unvetted install. It uses only agent telemetry.
- Rule 1The agent loads an unapproved skill
- Rule 2The agent installs an unapproved package
- CorrelationSame session, in order, within 10 minutes:
level: high
The rules are illustrative: field names depend on your pipeline, and no standard Sigma log source exists for agent telemetry yet (the question is open on SigmaHQ). The pattern is what carries over: tie an unapproved input to the action it caused, in the same session. Tools like TraceSig already apply it to Claude Code telemetry.
Rule 1: the agent loads an unapproved skill
title: Coding Agent Loads Unapproved Skill
name: genai_unapproved_skill_loaded
status: experimental
logsource:
product: genai
service: otel # skill_activated is a log event; Skill tool calls are spans
detection:
sel_event:
event.name: skill_activated
sel_tool:
gen_ai.operation.name: execute_tool
gen_ai.tool.name: Skill
sel_unapproved:
skill.approved: false # set by the pipeline: skill name + content hash vs. allowlist
condition: (sel_event or sel_tool) and sel_unapproved
This rule fires when the agent loads a skill that is not on your approved list. Claude Code records a skill load as a skill_activated event, or as a Skill tool call when the model invokes it directly, so the rule matches both.
The pipeline sets skill.approved from the skill’s name plus a hash of its content. Name alone is not enough: attackers have poisoned skills after they gained installs. The activation event carries no content, so the pipeline hashes the full skill text from raw API body logging, reflecting the text the model actually read. A truncated prefix is insufficient, since an attacker can pad it with whitespace. Bundled scripts never enter the model’s context, so this hash does not cover them; EDR file monitoring does.
Rule 2: the agent installs an unapproved package
title: Coding Agent Installs Unapproved Package
name: genai_unapproved_package_install
status: experimental
logsource:
product: genai
service: otel
detection:
sel_tool:
gen_ai.operation.name: execute_tool
gen_ai.tool.name: Bash
sel_install:
gen_ai.tool.call.arguments|contains:
- 'npm install'
- 'npm i '
- 'pnpm add'
- 'yarn add'
- 'bun add'
- 'pip install'
- 'uv add'
- 'npx '
sel_unapproved:
package.approved: false # set by the pipeline from your allowlist
condition: all of sel_*
A Bash tool call installs a package that is not on your approved list. As with skills, the pipeline adds package.approved before the rule evaluates. A bare npm install after the agent edits package.json names no package, so the pipeline also has to check the agent’s edits to dependency files.
The correlation: same session, in order
title: Coding Agent Installs Unapproved Package After Loading Unapproved Skill
status: experimental
correlation:
type: temporal_ordered
rules:
- genai_unapproved_skill_loaded
- genai_unapproved_package_install
group-by:
- gen_ai.conversation.id
timespan: 10m
level: high
tags:
- attack.initial_access
- attack.t1195.001
Both events must occur in the same agent session, in order, within 10 minutes. Tune the window to how long your agent sessions run. The alert reads as a question an analyst can act on: why did the agent install an unvetted dependency right after loading an unapproved skill?
Rule 1 models one documented path, a malicious skill, not one Mandiant has confirmed. Skills are not the only way in: poisoned instruction files, agent hooks, and MCP servers can steer an agent the same way, and each would need its own Rule 1.
What this detection cannot see. The infostealer runs inside the package’s install script, as a child process of npm. That never appears as a tool call, so agent telemetry stops at the install. That is the point: the install is the earliest moment a defender can act, before tokens are stolen and pushed.
The data this requires: agent telemetry
The detection above depends on agent telemetry: a record of what the agent decided and did, one tool call at a time. EDR sees processes. Agent telemetry sees the decision that started them.
This data has to be collected, not queried in place. The only local copy, session transcripts in the developer’s home directory, is within reach of the malware the agent just installed. Vendor records like Anthropic’s Compliance API survive, but a federated, query-at-source SOC reads them after the fact: enough to investigate, not to detect in time. Anthropic’s Inference hooks do push transcripts in real time, but receiving that push is collection.
Claude Code is an OpenTelemetry client. It emits metrics, events, and, in beta, traces. A trace is a per-turn span tree: the user’s interaction, the model request, and each tool call the agent made.
What matters for security use:
CLAUDE_CODE_ENABLE_TELEMETRY=1andOTEL_LOGS_EXPORTER=otlpturn telemetry on and export events.OTEL_TRACES_EXPORTER=otlpandCLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1turn on traces.OTEL_LOG_TOOL_DETAILS=1adds Bash commands, MCP server and tool names, and skill names. They are redacted by default, and without them neither rule has anything to match.OTEL_LOG_RAW_API_BODIES=file:<dir>writes full request bodies, skill text included, for Rule 1’s hash. Inline mode truncates at 60 KB, so use file mode, with a collector on the endpoint that reads the files and then deletes them.- Every event carries a session ID, which the correlation groups on.
- Push all of these through managed settings, so they cannot be switched off from a developer’s own configuration, and alert when a host that normally reports goes quiet.
One schema for any agent
OpenTelemetry’s GenAI semantic conventions define common attribute names for agent and tool activity. Detections written against them work on any agent that emits them, not just one vendor’s. That matters when a team runs Claude Code, Codex, and Cursor side by side.
| What it records | Claude Code field | GenAI semantic convention |
|---|---|---|
| Agent session | Claude Code fieldsession.id | GenAI semantic conventiongen_ai.conversation.id |
| Operation type | Claude Code fieldtool span | GenAI semantic conventiongen_ai.operation.name: execute_tool |
| Tool used | Claude Code fieldtool_name | GenAI semantic conventiongen_ai.tool.name |
| Tool call ID | Claude Code fieldtool_use_id | GenAI semantic conventiongen_ai.tool.call.id |
| Tool arguments | Claude Code fieldtool_input | GenAI semantic conventiongen_ai.tool.call.arguments |
Claude Code’s beta traces use Claude Code’s own field names, so the pipeline maps them onto these.
The conventions have no attribute for skill names, so the pipeline carries them as a vendor field next to the standard ones.
OCSF is working through the same gap. Its draft AI Agent Activity class is still deciding how to represent a skill load, and how to link each tool call to EDR’s process events. Until both settle, normalize the fields your detection needs.
What about AI gateways?
They don’t replace agent telemetry. Gateways like LiteLLM and Portkey emit gen_ai.* attributes for model calls only. They see the model ask to run npm install, but not whether it ran. With content capture on, they can hash skill text centrally.
Signal vs. noise: what agent visibility costs
Agent telemetry is cheap per event, but it adds up with scale and raw API bodies. A pipeline decides what reaches the SIEM, in what shape, and what goes to cheaper storage instead.
One published estimate puts a typical developer at about 2,900 telemetry records a day with traces on, from 4 sessions, 25 prompts, and 250 tool calls. Raw API bodies are the multiplier: each request resends the whole conversation, often 150-400 KB.
At a Splunk reference cost of about $1,500 a year per GB/day of ingest, here is what that means for 1,000 developers:
| Scenario | Per developer per day | 1,000 developers | Annual SIEM cost |
|---|---|---|---|
| Metadata only | Per developer per day~2.6 MB | 1,000 developers~2.6 GB/day | Annual SIEM cost~$3,900 |
| Raw API bodies, untruncated | Per developer per day~30–80 MB | 1,000 developers~30–80 GB/day | Annual SIEM cost~$45,000–$120,000 |
Treat these as a starting point, not a quote. Splunk Enterprise Security typically runs 1.5–2× the base rate.
Metadata alone is modest. Raw bodies are what Rule 1’s hash needs, and they drive the cost. The pipeline extracts the skill text, hashes it, and sends only the hash to the SIEM.
A pipeline does four jobs on that stream before it reaches the SIEM:
- Filter. Keep the events detections use, such as Bash, web fetch, MCP, skill, and hook activity. Route routine file reads and edits elsewhere. Realm’s recommendations tailor this to the detections each team actually runs.
- Trim. Drop oversized fields like tool output and raw API bodies once rules and hashes have used them. Keep the command arguments that rules match on.
- Redact. Agent commands can contain tokens, internal hostnames, and user emails. Redact PII and secrets before they land in a SIEM that many people can query.
- Normalize and enrich. Map vendor fields onto the GenAI semantic conventions, and check each event against your allowlists. That is where
skill.approvedandpackage.approvedcome from: two lists the security team maintains, applied before any rule runs. Back them with an internal package mirror and a managed skill marketplace, not hand-kept lists.
Run the correlation in the pipeline, and the SIEM receives the correlated alert and the events behind it, not every tool call.
The full stream, every tool call from every session, goes to a searchable retention layer outside the SIEM, masked the same way. That is the pattern behind Realm Data Haven: keep a searchable copy of every source, and resupply only the events an investigation needs.
Stopping the agent: detections in the pipeline
Running the correlation in the pipeline means the alert fires as the install happens, before the events are even ingested. In the SIEM, it fires once they land, and pipeline enrichment keeps that wait short.
MTTD sets MTTR
The Mandiant intrusion unfolded in steps: the install, the token theft, then pushes across about 100 repositories. Every step between the event and the detection, from ingestion to a scheduled search, gives the worm time to push. Correlating in the pipeline removes the most steps. You cannot respond faster than you detect.
Having visibility on the chain of events near real-time enables a response before damage is done. An unapproved install on its own is common enough that a human should look. The same install right after the agent loaded an unapproved skill, in the same session, is specific enough to act on immediately, by an analyst or by SOAR where it is deployed.
What the response does
- Isolate the developer’s host with EDR network containment.
- Kill the agent’s process through EDR, and tighten its permissions in managed settings.
- Remove persistence: the unapproved skill, the package’s install scripts, new agent hooks in
.claude/settings.json, and new instruction files. - Rotate GitHub, npm, and cloud credentials that were on the host.
- Pull the full agent session from retention, and search it for the same package across other sessions and hosts.
The order matters. One variant in this worm family, Mini Shai-Hulud, wipes the victim’s home directory if the stolen GitHub token was revoked. Rotating credentials before isolating the host and removing persistence can turn a contained incident into data loss.
When new intel lands
Retention also covers what no rule caught. When researchers publish a new malicious skill, the question is which agent sessions loaded it, by name or content hash, in the past few months. The same holds beyond skills: the Miasma-family worm JFrog reported in October had been hijacking accounts since July, so the question there is which sessions ran node .github/init.js. Only a searchable history of agent telemetry, kept beyond the typical SIEM retention period, can answer either.
What agent telemetry should add
Today a skill activation carries a name and a load scope, but nothing about content or origin. Three additions would let security teams verify skills from telemetry alone:
- A content hash of the skill, to catch a trusted name that later carries malicious instructions.
- Version and install origin, such as a registry URL or commit.
- A home for both in the GenAI semantic conventions and OCSF, so one rule works across agents.
Until then, the pipeline fills the gap by hashing skills from raw API bodies.
The takeaway
Coding agents are now a target in their own right, and the attacks against them look like normal agent work: loading skills, installing packages, following instructions. EDR sees the process, and the SIEM sees what it’s sent. Agent telemetry, shaped by a pipeline and correlated early, gives both the decision while there is still time to act.
Bring agent telemetry into your SOC
Realm collects OpenTelemetry from coding agents like Claude Code, redacts what shouldn’t reach the SIEM, sends on the fields your detections depend on, and retains the full record in Data Haven for the investigation that comes weeks later.
Want to know what your own agents would add? In a 30-minute agent telemetry review, our AI and security experts will size the volume for your developer count, estimate what it would cost in your SIEM, and show which detections it can support.
Sources
- Mandiant AI Risk and Resilience 2026, and iTWire’s coverage of the report
- VirusTotal blog: how some malicious AI skills hide
- Snyk: ToxicSkills
- Microsoft Security 101: What are non-human identities?
- Checkmarx: Mini Shai-Hulud token monitor that can wipe your home directory
- JFrog Security Research: Beyond testmetest, 42 hijacked GitHub repos
- Agentic AI Knowledge Base: OpenTelemetry GenAI Semantic Conventions
- OCSF schema PR #1754: draft AI Agent Activity event class
- SigmaHQ discussion #6550: a vendor-neutral log source for AI coding agents
- TraceSig: Sigma-style rules for agent tool-call traces
- Claude Code: Monitoring usage (OpenTelemetry settings)
- Claude Code: Measure plugin installs and use (
skill_activatedevent) - Revenium: Skill origin classification (
skill_activatedattributes) - telemetry.dev: Claude Code monitoring (per-developer record counts)
- Classmethod: Claude Code raw API body telemetry test (inline truncation, file mode)
- Claude Code issue #57277 (150–400 KB request bodies)
- Vendr: Splunk pricing (Enterprise Security relative to base rate)
- LiteLLM: OpenTelemetry v2
- Portkey: Complete logs over OTel


