AI Development

An AI agent wiped a photographer’s drive: 3 rules for running Claude Code safely on a VPS

To keep your PC files safe, run Claude Code on an isolated VPS: a user without admin rights, only the keys it needs and a snapshot before long jobs.

Luca Di Domenico

Luca Di Domenico

· 6 min read

In short

Google Antigravity wiped a photographer’s entire D drive, bypassing the Recycle Bin, and in August 2025 malicious versions of Nx used locally installed Claude Code, Gemini CLI and Amazon Q to steal keys and passwords. The official Claude Code documentation recommends running unattended sessions in a container or a virtual machine. I use a VPS with three rules: a user without administrator privileges, only the keys the agent needs and a snapshot before every long job.

To let Claude Code or Codex work on their own without putting the files on your computer at risk, run them in an isolated environment. I use a VPS, a cloud computer dedicated only to agents, with three rules: a user without administrator privileges, only the keys the agent needs, and a snapshot before every long job. This is the same direction the official Claude Code documentation points to.

What happened to the photographer using Google Antigravity?

Google Antigravity, Google’s agent-based development environment, wiped a user’s entire D drive, bypassing the Recycle Bin. The files could not be recovered. The Register reported it on December 1, 2025.

The user is Tassos M., a Greek photographer and graphic designer who is not a developer. The agent only had to clear the project cache, a folder of temporary files. Instead, the command targeted the root of the D drive and deleted everything.

When the photographer asked the agent whether he had ever given it permission, the answer was: "No, you absolutely did not give me permission to do that".

Two details matter for anyone running an AI agent on their own PC:

  • the agent was running in Turbo mode, the mode where it executes commands without asking for confirmation;
  • the photographer was partly saved because he had already copied most of his files to another drive.

Are AI agents only dangerous when they make mistakes?

No. An AI agent installed on your computer can also be used by whoever is attacking you.

On August 26 and 27, 2025, malicious versions of Nx, a widely used developer tool, were published on npm, the JavaScript package registry. Anyone who installed them unknowingly ran a script that looked for AI agents already on the computer.

According to Snyk’s analysis, the script launched Claude Code, Gemini CLI and Amazon Q with the options that skip permission prompts, such as --dangerously-skip-permissions for Claude Code. It asked the agents to look for:

  • GitHub and npm access keys;
  • SSH keys, the keys used to log into servers;
  • .env files, where passwords and API keys are usually stored;
  • cryptocurrency wallets.

The collected data ended up in a public repository created in the victim’s own GitHub account. In practice, the AI agent was working for the attacker with all of the user’s permissions.

What does Anthropic recommend for running Claude Code on its own?

Anthropic recommends running Claude Code in an isolated environment when you let it work unattended. The Choose a sandbox environment page of the official documentation puts it this way: "With no prompts to catch mistakes, the isolation boundary you choose is what protects your system."

For sessions with --dangerously-skip-permissions, the guide says to always use a container, a virtual machine or Anthropic’s sandbox runtime. A virtual machine gives the strongest separation between the agent and your computer, and the guide lists cloud instances among the examples.

Permission prompts alone are not enough: after dozens of commands, people end up approving without reading. I covered this in the article on human approval of an AI agent’s commands.

Why do I use a VPS for Claude Code?

A VPS is a cloud computer, on 24 hours a day, that holds none of the files on your PC. That is what makes it an isolated environment: it becomes the computer only your agents use.

If Claude Code or Codex runs a wrong command on the VPS, the files on your PC stay where they are. And if a malicious package tries to use the agent, all it finds on the VPS is what you put there.

I use a Hostinger VPS, and Hostinger sponsored this video. Hostinger has a template with Claude Code already installed that you can deploy on the VPS in one click. With my link and the code LUCADD you get an extra 10% off annual plans.

What are the 3 rules for using Claude Code safely on a VPS?

The three rules limit the damage when something goes wrong: an agent mistake or an attack.

1. Create a regular user, not an administrator

Have the agent work as a regular user, without administrator privileges, unless you really know what you are doing. A regular user cannot change the system, so a wrong command does less damage.

Hostinger’s guide to the template shows the login as root, the server administrator: create a regular user right away and use that one. Claude Code itself, on Linux and macOS, refuses to start with --dangerously-skip-permissions when you run it as root.

2. Give the agent only the keys it needs

Put on the VPS only the keys and access the agent needs for its work. For example:

  • yes to the GitHub key and the project’s database key;
  • no to your bank password and access to your email.

The Nx case shows why: the malicious script asked the agents to look for exactly those keys and passwords. What is not on the VPS cannot be stolen.

3. Take a snapshot before a long job

A snapshot is a full picture of the VPS at a given moment. If the agent deletes files, you restore the snapshot and go back.

On Hostinger you create it from the Snapshots & Backups page. According to the official backup guide, Hostinger keeps one snapshot at a time and deletes it after 1 day, so take it right before the job. Hostinger also runs an automatic backup every week, and you can turn on paid daily backups if you want them.

What should you do if you run Claude Code or Codex on your PC?

If today you let Claude Code or Codex work on your computer, next to your files and passwords, move the autonomous work to an isolated environment. A VPS with a regular user, few keys and a snapshot before long jobs protects you from both agent mistakes and attacks. And if you know someone who lets an AI agent work on their own PC, send them this article: now is a good time to put their files somewhere safe.

Sources

Want to know what this means for your product?

If you're building software with AI and want a second opinion on how you're working, tell me about your project.

Tell me about your project
Claude CodeAI AgentsSecurityVPSAI Development

Follow the blog

One email for every new article

I only write when an article is out: title, summary and link. You can unsubscribe with one click from any email.

RSS feed

An RSS feed is the up-to-date list of articles: add it to a reader app like Feedly or Inoreader and new articles show up there, no email needed.

lucadidomenico.studio/en/blog/rss.xml