{
  "id": 22334373,
  "title": "I Let AI Agents Move Files on a Mac. Here's How I Kept It Safe.",
  "url": "https://urgent.news/2026/11/28/i-let-ai-agents-move-files-on-a-mac-heres-how-i-kept-it-safe",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-28T09:22:30.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/md_ayanbag_03a42545b17ac/i-let-ai-agents-move-files-on-a-mac-heres-how-i-kept-it-safe-obj"
  },
  "original_language": null,
  "account": "One Mac app, Tidy Mac, was enhanced with an MCP server that enables AI agents such as Claude Code to inspect a Mac's storage and, with consent, relocate files to the Trash. This capability introduces a significant risk, as an agent granted access to files could cause substantial harm in an instant. In this account, the design measures employed to mitigate this risk will be elucidated, along with guidance for those developing an MCP server handling genuine data.\n\nFirstly, the server distinguishes between tools that merely provide information and those that modify data. Eight tools solely offer details like disk usage overview, storage allocation, and duplicate file identification. However, there exists one tool that can effect change: moving files to the Trash. This tool is explicitly marked as destructive, prompting the client application to exercise additional caution when invoking it. Implementing a single destructive tool simplifies the process of safeguarding the system compared to having multiple potential sources of harm.\n\nHuman oversight is crucial at every stage where data can be altered. Upon invoking the move_to_trash function, a pop-up appears, explicitly listing the files slated for deletion. The user must manually approve or deny the action. If no response is received within a 60-second window, the request defaults to denial. Additionally, if the Mac remains unattended, approval is automatically denied. Multiple simultaneous requests are managed through a queue, ensuring a single action is processed at a time.\n\nTo recover from erroneous approvals, the app maintains a History log with an Undo function. This allows users to revert changes resulting from a mistaken approval, transforming an undesirable outcome into a mere inconvenience rather than a catastrophic event. For actions that cannot be undone, such as deleting sensitive data, the server is programmed to refuse such requests outright.\n\nCertain directories are off-limits to all requests, regardless of user consent. These include system folders, keychains, iCloud Drive, SSH keys, and any data belonging to running applications. The server verifies each requested path against this blacklist, ensuring that critical system areas remain impervious to unauthorized deletion. Moreover, the server enforces a cap of 200 paths per request to prevent abuse and performs a thorough cleanup of paths to thwart attempts at circumventing restrictions using relative paths like ~ or ..\n\nWhen the server declines a request, it communicates the reason back to the agent. This granular feedback enables the agent to determine an appropriate course of action. If the user has opted out of AI agent interactions through the app's settings, the refusal message will instead guide the agent to display the affected paths, thereby maintaining transparency.\n\nThe server communicates with agents using a JSON-RPC protocol over standard input and output streams. To ensure the integrity of this communication, only JSON-RPC protocol messages are permitted in the server's stdout output. All other informational messages are directed to stderr. This separation prevents the client from misinterpreting server output, which could otherwise disrupt the flow of operations.\n\nThe server's initial handshake allows it to convey essential information to the agent, including the types of data it can measure and the necessity of approval for any deletion actions. Furthermore, descriptions of each tool are provided, categorizing them as \"Fast\" for quick operations and detailing slower processes. This contextual information empowers agents to prioritize efficiency while adhering to safety protocols.\n\nIn summary, the design of Tidy Mac's MCP server revolves around compartmentalizing functionality, safeguarding users through clear feedback mechanisms, and ensuring reversibility of actions. By keeping destructive actions under active human supervision, writing systematic refusal messages, and maintaining clean communication protocols, the server provides a secure environment for AI agents to interact with Mac storage systems while minimizing potential risks.",
  "summary": "Lessons from shipping an MCP server inside a Mac app: one tool that changes anything, eight that only look, and a human in the loop every time. I build a Mac storage app called Tidy Mac. This year I added an MCP server to it, so AI agents like Claude Code can ask what’s filling a Mac and, with permission, move files to the Trash. That’s a scary sentence to write. An agent with access to someone’s…",
  "summary_source": "publisher",
  "key_points": [
    "Tidy Mac app enhanced with MCP server for AI agents",
    "Server distinguishes between info-giving and data-modifying tools",
    "Human approval required for destructive file move actions"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}