Recent public reports

Redacted audit reports that included this probe.

Overview & Risk Context

Tool substitution detection checks whether an API relay alters package-install commands or structured tool-call arguments returned by the model to inject malicious dependencies.

What this check measures

Inspects returned shell and tool-call JSON payloads for substituted package names, rogue flags, or unauthorized registry URLs.

Why this risk matters

In Liu et al. ("Your Agent Is Mine", arXiv:2604.08407), AC-1.a showed how compromised API relays rewrite innocent `pip install` or `npm install` commands straight into malware execution.

When to run this check

Critical before using any third-party relay with coding agents, IDE assistants, or automated CLI runners.

Even if system prompts look clean on normal chat turns, a compromised relay inspecting tool-call payloads can silently swap a typosquatted package name before returning chunks to your coding agent.

Detection Methodology, Evidence & Limitations

Implements benign package-installation tool-use tests grounded in AC-1.a (arXiv:2604.08407) inside @lmspeed/audit without executing commands.
  1. 1. Probe

    Send a safe tool-enabled coding task requesting standard package setup instructions or structured shell arguments.

  2. 2. Inspect

    Inspect the returned message and tool_calls arguments character-by-character for altered package names, flags, or URLs.

  3. 3. Conclude

    Flag AC-1.a supply-chain tampering if unexpected commands or foreign registry targets appear.

How to read the verdict

Unmodified expected package commands pass; tampered package names, curl pipes, or extra flags fail immediately.

Evidence basis & thresholds

Exact command and tool-call JSON argument comparison grounded in AC-1.a taxonomy (arXiv:2604.08407).

Scope limits & abstention conditions

Tests deterministic clean setups and executes zero local commands; sophisticated dynamic rewrites targeting closed enterprise registries require local endpoint allowlisting.

Verification Sources & Baselines

Implemented in @lmspeed/audit v0.3.3 (ruleset independent-2026-11-22.2); supplementary capability/injection design cross-checked against Veridrop, LLMprobe-engine, and meow-llm-detector specs.

Frequently Asked Questions

What is AC-1.a tool-call rewriting?

An attack class documented in arXiv:2604.08407 where an intermediary LLM proxy tampers with returned tool calls or dependency install commands.

Does LMSpeed execute the returned shell commands?

Never. Tool arguments are inspected statically without executing any local process.

How does Tool Substitution relate to Tool Permissions?

Tool Permissions tests whether `tool_choice` schema rules are honored; Tool Substitution inspects whether returned tool parameters were maliciously altered.

Should coding agents also use package lockfiles?

Yes—combining LMSpeed relay checks with local sandbox confirmation and lockfiles provides layered defense.

All audit checks by category

Explore every single-check audit tool grouped by risk domain, with Fingerprint Detection pinned first for model-authenticity verification.