跳到正文
DEV Community· si·· 3 小時前AI 評分53

MCP 工具調用審計:參照受監管交易員記錄智能體行動

Auditing MCP tool calls: treating your agent like a trader on a regulated floor

AI 導讀

文章提出以受監管交易員的留痕方式審計智能體的 MCP 工具調用,並指出 MCP 尚未提供統一的問責紀錄標準。建議每次調用記錄智能體及模型版本、系統提示詞雜湊、觸發任務、工具名稱與完整參數、時間、結果、副作用及授權政策版本。記錄應採追加寫入並驗證完整性;文中稱雜湊鏈記錄的成本為微秒至低毫秒。

正文

si

MCP gave agents a standard way to call tools. It did not give them a standard way to be accountable for those calls, and that asymmetry is where incidents live.

Think about how regulated industries handle autonomous actors. A trader on an exchange floor gets a timestamped, immutable record of every order. Not because anyone assumes malice, but because when something goes wrong at 10:14am, the reconstruction has to be possible without trusting the trader's memory or their firm's goodwill.

Your agent has more privileges than most traders: file systems, APIs, sometimes money. And its "orders" are currently recorded in whatever shape each integration felt like emitting.

A minimum viable audit record for every tool call:

  1. Identity: which agent instance, which model + version, which system prompt hash. The prompt is part of the decision function; if it changed, the model effectively changed.

  2. Intent context: the upstream message or task that triggered the call. Without it you have an action with no motive, and incident review becomes guesswork.

  3. The call itself: tool name, full arguments, timestamp with clock source noted.

  4. The result: full response or a hash of it, plus any side effects (files written, requests sent, money moved).

  5. Policy binding: which policy version authorized this call. "Allowed" without "allowed by what rule, as of when" doesn't survive an audit.

Storage matters as much as schema. These records need append-only semantics with integrity verification, because the first question in any serious incident is "can we trust this log?" If the answer requires trusting the team that owns the system under investigation, you don't have evidence. You have testimony.

The performance worry is overblown. Hash-chaining a record costs microseconds to low milliseconds. What it buys is the ability to hand an auditor, a customer, or a court a timeline that verifies itself.

Count your last five agent tool calls. How many of the fifteen fields above do your logs actually capture?

Excerpted from https://tamperaudit.com/

來源:DEV Community · dev.to