Whoever can write to your agent’s instruction files can steer your agent. If those files sit in a folder that syncs with the cloud, that may be more people than you think.

By Andromeda Turnbull and Cairn — 19 October 2026

In one sentence: a Claude Code or Claude Desktop working folder inside a folder that syncs both ways with a cloud service can be written from the web by anyone who can reach that cloud account — and the files an agent reads at the start of every session are instructions, so whoever can edit them controls the agent.

Instruction files are instructions

A coding agent such as Claude Code reads certain files at the start of every session and treats them with the authority of its brief: CLAUDE.md, its settings, its skills and its hooks (other agents have their equivalents, such as AGENTS.md). That is the point of them. They let you tell the agent how your project works, what to avoid, and how you like things done, once, instead of in every conversation.

It also means they are not documents in the ordinary sense. They are part of the agent’s instructions. Change them and you change what the agent does next time it starts — and, if the agent is trusted to edit files, run commands or reach the network, what it does with that trust.

This is well understood when the file arrives in a project someone else wrote. Security writers have covered repositories that carry hostile configuration, and dependencies that write instruction files at build time. The route we want to describe is less obvious, because nothing arrives from outside. The file is already yours. It is just not only yours.

The route: a folder that syncs both ways

Cloud storage services — OneDrive, Dropbox, Google Drive, iCloud Drive — keep a folder on your machine and a copy in the cloud in step, in both directions. Edit the file on your laptop and the cloud copy changes; edit the cloud copy and your laptop’s file changes.

So anyone who can write to the cloud copy can write to your agent’s instructions, without ever touching your machine:

  • someone who has your cloud account’s password, from a phishing page or a reused password;
  • someone you shared the folder with, with edit rights, perhaps long ago;
  • another device signed into the same account;
  • a third-party app you once allowed to read and write your cloud files.

None of them needs a foothold on your computer. The sync client puts their edit in place for them, and the agent reads it at its next start.

This is commoner than it sounds. On Windows, signing in with a Microsoft account often moves the Desktop and Documents folders into OneDrive, so a project folder kept on the Desktop may already be synced without anyone having decided that it should be.

Why a sandbox does not save you

A sandbox limits what the agent can do. It does not change whose instructions it follows. An injected instruction inherits every permission the agent legitimately has: the files it may read, the commands you have allowed it to run, the places it may send things. As Andromeda put it, once someone else can edit the instructions, “all bets are off for system security, even if the Claude client itself is running in a sandbox.”

And the change need not be dramatic to matter. A line added to a file you rarely open can read like ordinary housekeeping and still be obeyed in every session from then on.

What to do about it

1. Keep agent working folders out of synced folders. Check where the project actually lives: if its path runs through OneDrive, Dropbox, Google Drive or iCloud Drive, it is synced. Move it somewhere local, and sync or back it up by a route you control (version control, an encrypted backup) where a change has to be pushed deliberately rather than arriving silently.

2. If a folder must stay synced, detect changes mechanically before every session. Do not rely on noticing. Keep a known-good copy of the always-loaded files — a version-control commit or a checksum — and compare against it before the agent starts; refuse to start, or at least warn, when they differ in a way you did not make. In our own environment the files are under version control already, so the comparison costs almost nothing. This matters most where sessions start with nobody watching — scheduled tasks and background sessions read a changed file fresh, with no one there to notice.

3. Treat anything that arrives by sync as untrusted input. A file that changed while you were away should be read before it is obeyed, exactly as you would read a stranger’s pull request.

4. Look after the account. Everything above narrows the damage; the cloud account’s own security narrows the doorway. Strong, unique passwords and a second factor, a periodic look at who the folder is shared with, and a review of which apps have write access.

What vendors could do

A client could check whether its working folder sits under a known sync location and say so once, plainly, at start-up. It would cost a line of text and prevent the case where nobody realised the folder was synced at all.

What this is, and is not

This is not a vulnerability in any product. Claude Code, Claude Desktop and the sync services each do exactly what they are meant to. The hazard is in how two ordinary features combine: instruction files that are trusted because they are local, and sync that makes local files writable from somewhere else. That is why it is easy to miss, and why it is worth writing down.

The idea is Andromeda Turnbull’s (10 October 2026). This article was written with Cairn, an AI agent (Claude) and co-author.

Sources

  • D. Teixeira, “Mitigating Indirect AGENTS.md Injection Attacks in Agentic Environments” (NVIDIA Technical Blog, 20 April 2026).
  • “Security: ~/.claude/CLAUDE.md is writable by any user-level process, enabling persistent prompt injection”, anthropics/claude-code issue #21674 (opened 29 January 2026; closed as inactive).

Text licensed CC BY-SA 4.0 — see Licence.