<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amneek Singh</title>
    <description>The latest articles on DEV Community by Amneek Singh (@amneeksingh).</description>
    <link>https://dev.to/amneeksingh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4279096%2F0376ce78-d615-4004-9c45-163c6a3a29cc.png</url>
      <title>DEV Community: Amneek Singh</title>
      <link>https://dev.to/amneeksingh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amneeksingh"/>
    <language>en</language>
    <item>
      <title>An AI agent deleted production in 9 seconds. I checked what mine could reach.</title>
      <dc:creator>Amneek Singh</dc:creator>
      <pubDate>Wed, 02 Dec 2026 18:37:26 +0000</pubDate>
      <link>https://dev.to/amneeksingh/an-ai-agent-deleted-production-in-9-seconds-i-checked-what-mine-could-reach-1cfn</link>
      <guid>https://dev.to/amneeksingh/an-ai-agent-deleted-production-in-9-seconds-i-checked-what-mine-could-reach-1cfn</guid>
      <description>&lt;p&gt;In April 2026 a Cursor agent at PocketOS hit a permissions error on a staging task. It went looking for another way through, found a Railway token in an old script, and called the API. The production volume was deleted. The backups lived on that volume, so they went too. About nine seconds, start to finish.&lt;/p&gt;

&lt;p&gt;I read that and opened a terminal. My first question wasn't "how do I stop rm -rf". Nothing like that ran in the incident. It was one ordinary API call with a valid key. The question was: &lt;strong&gt;what keys can my agent read right now, and what could each one do?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Agents run as you
&lt;/h2&gt;

&lt;p&gt;Claude Code, Cursor and Codex run with your user's permissions. Anything you can open, they can open:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.env&lt;/code&gt; files in every project&lt;/li&gt;
&lt;li&gt;deploy and migration scripts with a token pasted in&lt;/li&gt;
&lt;li&gt;shell history (&lt;code&gt;~/.zsh_history&lt;/code&gt; keeps every &lt;code&gt;export FOO=…&lt;/code&gt; you ever typed)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~/.aws/credentials&lt;/code&gt; and other CLI logins&lt;/li&gt;
&lt;li&gt;MCP configs where you gave other servers a token&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of that is exotic. It's every laptop I've worked on.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a check finds
&lt;/h2&gt;

&lt;p&gt;I built a small open-source CLI to answer the question, prodlock. It looks in those places, and for each production credential it finds it asks the provider, read-only, what the key can do. No secret value is printed or uploaded.&lt;/p&gt;

&lt;p&gt;Here it is on a demo project (fake keys, &lt;code&gt;--offline&lt;/code&gt; so nothing leaves the machine):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Famneeksingh%2Fprodlock%2Fmain%2Fdocs%2Fdemo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Famneeksingh%2Fprodlock%2Fmain%2Fdocs%2Fdemo.gif" alt="prodlock scan on a demo project" width="800" height="484"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; CRITICAL  Railway API token
            Can destroy: Railway services, databases and volumes the token can reach
            …and the backups you would restore from.
            Found: acme-app/scripts/deploy.sh:2 (RAILWAY_TOKEN) — in a project file your coding agent can read

 CRITICAL  Supabase service_role key
            Can destroy: read, change or delete every row in every table, ignoring Row Level Security
            Found: acme-app/.env:2 (SUPABASE_SERVICE_ROLE_KEY)

 CRITICAL  Postgres connection string  (user postgres on db.….supabase.co)
            Can destroy: drop every table in postgres, or the whole database
            Found: acme-app/.env:3 (DATABASE_URL)

Summary
  4 credentials an AI agent on this machine can reach. 4 can destroy production. 1 can also destroy the backups.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three files, four keys, and one of them takes the backups down with production. That's the PocketOS shape exactly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed after running it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Moved production keys out of project folders and history&lt;/strong&gt;, and rotated the ones that had been in history.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gave agents weaker keys.&lt;/strong&gt; Read-only or staging-scoped tokens for agent work; full-power keys stay with me.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Made agents ask.&lt;/strong&gt; &lt;code&gt;prodlock init&lt;/code&gt; adds an MCP server and a skill to Claude Code, Cursor, Codex and Claude Desktop. The rules: never use a credential you found in a file, ask before anything destructive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Made one backup no key can delete.&lt;/strong&gt; &lt;code&gt;prodlock backup run&lt;/code&gt; dumps Postgres to a bucket with S3 Object Lock in compliance mode; &lt;code&gt;backup verify --restore-to … --try-delete&lt;/code&gt; proves it restores and can't be deleted.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @prodlock/cli scan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rust, MIT, no account, nothing uploaded. I'd love to hear what it misses, especially providers it doesn't know yet: &lt;a href="https://github.com/amneeksingh/prodlock" rel="noopener noreferrer"&gt;https://github.com/amneeksingh/prodlock&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I built prodlock; this post is about why.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>devops</category>
      <category>claudecode</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
