When a coding agent acts on your behalf, which record proves what it did?
A Sandscale post argues that the most trustworthy log of an AI agent's tool use sits behind the tool, not on the developer's laptop.
The short version
- A tool call passes through three layers: the client, the MCP server, and the system behind the server.
- The record in the system behind the server is the one others can trust, because the developer can't rewrite it.
- Leave arguments out of long-lived shared logs, since they can contain secrets.
- A short Claude Code hook can log each MCP call to a local file, one line per call.
- Refusals are the most revealing entries, so review them first.
The problem: actions nobody typed
As dev.to reported, in a post from the Sandscale team, coding agents connected to MCP servers make tool calls that no person typed. MCP is a way of plugging outside tools into an AI agent. Most of these calls only read data, but some start machines, write files or change settings.
Ask a team what the agent did yesterday and the honest answer depends on where you look. Each place records something different, or nothing at all.
Why it matters
As agents take actions for you, "what did it do yesterday?" becomes a real question for teams. The post's answer is to decide ahead of time which record counts as the truth. It also shows that the log itself can leak secrets if you save too much.
Three places a call leaves a trace
The first is the client, the agent program such as Claude Code, Codex, Cursor or Gemini CLI. It sees every call, but it runs on the developer's machine under the developer's control. That makes it weak evidence.
The second is the MCP server. What it logs is up to its author, and a locally installed one may log nothing, or only to that same machine.
The third is the system behind the server. Many MCP tools are thin wrappers around an API, so a call becomes an ordinary API request. If that API keeps an audit log, the call is recorded there after the usual identity checks, and the developer can't edit it. The post's rule of thumb is to treat this record as the truth and use client logs only to fill gaps.
What to record, and what to leave out
For each call, the post says a team ends up wanting to know:
- who the agent acted for, not just a key ID
- which client or app made the call
- which tool or operation, and on what resource
- whether it was allowed or refused
- when and where it happened
Arguments are deliberately missing from that list. They hold the detail, but also the secrets: tokens in commands, file contents, connection strings copied from a .env file. A long-lived log that stores them becomes a second hiding place for secrets.
The suggestion is to keep arguments, if needed, only briefly in a masked, rotating log on the agent's own machine.
A small example, and the vendor angle
For Claude Code, the post shows a hook, a small script that runs after each MCP call, which writes one line per call to a local file without arguments. It gives a timeline per machine but cannot detect tampering.
The post then describes how Sandscale's own servers log into its audit log, and which CLI commands read it. Since Sandscale sells this service, read that part as a product description. The general advice stands on its own: pick tools backed by systems with their own audit logs, review refusals weekly, and run log-less local servers on a dedicated agent machine rather than a laptop holding everyone's credentials.
What to watch
- Will agent tools start shipping audit logs by default, instead of leaving it to each server's author?
- How will teams balance having enough detail to investigate with not storing secrets in logs?
Try it
Pick one tool your agent uses and find out whether the system behind it keeps its own audit log, and who can edit it.
More stories
ClaudeA plain-English rulebook for AI coding agents, in three lists
ClaudeMagister Marketing adds a tracker for how brands show up in AI assistants
ClaudeGoogle AI subscriptions may come to OpenClaw after Logan Kilpatrick's December 2 teaser
ClaudeAzoma launches Azoma Sentiment as Walmart Sparky and Alexa criticize brands more
Get The Daily
AI news, explained in 5 minutes a day. Free. The first issue is coming soon.
No password. Unsubscribe any time. Privacy
Say why
Liked it? Say why
Add a line for other readers.
No account needed. We never show your email. Comments with links, ads or abuse are held and not shown. Your comment shows after a quick check.
Sources
The reporting and documents this story is built from. Each link opens the original.
- ReportingDEV Community: the article we sourced dev.to
Written with AI by the SI Agent News Desk from the reporting above. Every number is checked against it.Spot a mistake or a concern? Contact us · Corrections.