threatdeck
Live 13:45 UTC ·

Learn / Securing AI coding assistants in an organisation

Lesson 6 of 69 minReviewed

Inventory, telemetry and the fleet incident

Know which agents, versions and MCP servers run on which machines, export the telemetry that shows what they did, and rehearse the response when one of them turns out to be compromised.

Policy only covers the tools you know about. The MCP project's guidance for administrators starts from two facts: local MCP servers are ordinary software your users install, and you will not be asked first. Its recommended starting posture is a continuous inventory of client configuration files, which live in known locations, plus a short allowlist of approved servers [1].

What to inventory

Per-machine facts that make an advisory actionable
FactWhy you need it
AI coding tools and exact versionsMatch vendor advisories and minimum safe versions to machines
MCP servers per client, with source and pinned versionFind every instance when a server or its SDK gets an advisory [1]
Risky settings: bypass modes, auto-approve, broad allow rulesSpot machines where prompts no longer stand between injected text and the shell
Literal secrets in agent and MCP configsClient config files are a predictable location for tokens [1]

Telemetry from the agent itself

Claude Code exports metrics and events over OpenTelemetry once CLAUDE_CODE_ENABLE_TELEMETRY=1 and an exporter are set [2]. Administrators can set these variables for everyone through the managed settings env block; Claude Code ignores exporter variables in a repository's .claude/settings.json and .claude/settings.local.json, and removes conflicting developer-set endpoint variables when managed settings define one [2].

Managed settings: export Claude Code telemetry to your collector
{
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_METRICS_EXPORTER": "otlp",
    "OTEL_LOGS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc",
    "OTEL_EXPORTER_OTLP_ENDPOINT": "http://collector.example.com:4317"
  }
}

Content is off by default. Prompts are redacted unless OTEL_LOG_USER_PROMPTS=1; OTEL_LOG_TOOL_DETAILS=1 adds tool parameters such as Bash commands and MCP server and tool names [2]. The claude_code.tool_decision event records whether each tool call was accepted or rejected, the source of that decision (configuration, a hook, or the user approving once or permanently) and the permission mode [2]. With tool details on, the same events show which MCP servers people actually use, which Anthropic's MCP administration guide recommends for seeing which servers users actually connect to [3].

Useful alerts from this data: sessions in bypassPermissions, Bash commands that touch credential stores, newly seen MCP servers, and permanent user approvals for broad commands. Logging tool details means logging commands and paths from developers' work, so set retention and tell developers what is collected.

The fleet incident

When a widely used local server, or the SDK inside it, turns out to be vulnerable or malicious, the MCP guidance lists the work [1]:

  1. Find every instance, using the inventory.
  2. Block the server's egress at the proxy or firewall while you respond.
  3. Rotate every credential the affected configurations passed to it.
  4. Push the fixed, pinned version through your approved channel.

The same sequence fits a compromised AI tool release or extension. Keeping SBOMs for the servers you approve shortens step one when the advisory names an SDK rather than a server [1].

Try it on ThreatDeck

  • Fleet view Collect scanner results from your machines and see which advisories hit which hosts.
  • threatdeck scan Inventory AI coding tools, versions, MCP servers and risky settings locally, with JSON or SARIF output for CI and MDM.
  • Detection: Claude Code Bash reads secrets Query Claude Code telemetry for tool calls that read credential stores.
  • Team alerts Send new advisories for the AI tools and MCP packages you run to Slack, Teams or Discord.

Self-check

4 questions

Pick an answer to see whether it is right and why. Only your score is saved, in this browser.

  1. With Claude Code telemetry enabled and no other content settings, are user prompts included in exported events?
  2. Why set the OpenTelemetry exporter variables in managed settings rather than in a repository's .claude/settings.json?
  3. Which claude_code.tool_decision field tells you whether a call was allowed by configuration, a hook or a user's permanent approval?
  4. A popular local MCP server is found exfiltrating environment variables. What is the first step in the fleet response the MCP guidance describes?

References

  1. MCP Local Server Security. Model Context Protocol, 2026-07-28.
  2. Monitoring (OpenTelemetry). Anthropic (Claude Code docs).
  3. Control MCP server access for your organization: monitor MCP usage. Anthropic (Claude Code docs).
Completing the self-check also marks the lesson complete. Saved in this browser only.

Following

Follow the vendors, products, AI tools, techniques and actors you care about. Matching stories, CVEs and exploited bugs are marked, a Following tab appears in the feed, and returning visits show what changed. Saved only in this browser.

Presets

Get updates

A personal RSS feed of new stories on everything you follow. Paste it into any feed reader, Slack or Teams RSS app.