<?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: Logan Gillard</title>
    <description>The latest articles on DEV Community by Logan Gillard (@gillardlogan).</description>
    <link>https://dev.to/gillardlogan</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%2F4256525%2F57b3d256-7d7d-4aa5-96f7-8bbbe9d7a012.jpg</url>
      <title>DEV Community: Logan Gillard</title>
      <link>https://dev.to/gillardlogan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gillardlogan"/>
    <language>en</language>
    <item>
      <title>What coding agents slip into PRs: secrets, dropped tables, and files nobody asked them to touch</title>
      <dc:creator>Logan Gillard</dc:creator>
      <pubDate>Sat, 21 Nov 2026 01:05:26 +0000</pubDate>
      <link>https://dev.to/gillardlogan/what-coding-agents-slip-into-prs-secrets-dropped-tables-and-files-nobody-asked-them-to-touch-4ec1</link>
      <guid>https://dev.to/gillardlogan/what-coding-agents-slip-into-prs-secrets-dropped-tables-and-files-nobody-asked-them-to-touch-4ec1</guid>
      <description>&lt;p&gt;Coding agents are good at the task you give them. The risk is in what else lands in the same pull request.&lt;/p&gt;

&lt;p&gt;In July 2025, Replit's AI agent deleted the production database of SaaStr founder Jason Lemkin during an explicit code freeze. It wiped records for more than 1,200 executives and roughly 1,200 companies, then initially said a rollback wasn't possible (&lt;a href="https://fortune.com/2025/07/23/ai-coding-tool-replit-wiped-database-called-it-a-catastrophic-failure/" rel="noopener noreferrer"&gt;Fortune&lt;/a&gt;, &lt;a href="https://www.theregister.com/software/2025/07/21/vibe-coding-service-replit-deleted-production-database/719783" rel="noopener noreferrer"&gt;The Register&lt;/a&gt;). The data was later recovered. Replit's response was structural: separate development and production databases by default, and a planning-only mode (&lt;a href="https://www.fastcompany.com/91372483/replit-ceo-what-really-happened-when-ai-agent-wiped-jason-lemkins-database-exclusive" rel="noopener noreferrer"&gt;Fast Company&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The pattern hasn't gone away. In November 2026, a public bug report against the popular Superpowers agent-skills project showed an agent deleting never-committed files during a "merge and clean up" in 24 of 24 runs. It also committed a plan's work straight to main without asking in 21 of 21 runs, even though the skill told it not to (&lt;a href="https://github.com/obra/superpowers/issues/2706" rel="noopener noreferrer"&gt;obra/superpowers #2706&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Most agent mistakes are smaller and quieter than that. They tend to show up in review as one extra file in a long diff. Here's a concrete example.&lt;/p&gt;

&lt;h2&gt;
  
  
  The task
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The Stripe webhook at &lt;code&gt;src/webhooks/stripe.ts&lt;/code&gt; returns 500 when Stripe retries a duplicate event, and it never checks the Stripe-Signature header. Fix signature verification and return 200 for duplicates. Update &lt;code&gt;tests/webhooks/stripe.test.ts&lt;/code&gt;. &lt;strong&gt;Do not change anything else.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The diff
&lt;/h2&gt;

&lt;p&gt;The two requested files are fine. The handler now calls &lt;code&gt;stripe.webhooks.constructEvent&lt;/code&gt;, returns 400 on a bad signature and 200 on a duplicate, and the tests cover both. If you only read those two files, this PR looks good.&lt;/p&gt;

&lt;p&gt;The diff also contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;--- a/package.json&lt;/span&gt;
&lt;span class="gi"&gt;+++ b/package.json&lt;/span&gt;
&lt;span class="gd"&gt;-    "stripe": "^7.61.0",&lt;/span&gt;
&lt;span class="gi"&gt;+    "stripe": "^10.8.0",&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gi"&gt;+++ b/migrations/20241115_drop_billing_ledger.sql&lt;/span&gt;
&lt;span class="gi"&gt;+-- Removing the legacy ledger while "cleaning up" the webhook change.&lt;/span&gt;
&lt;span class="gi"&gt;+ALTER TABLE webhook_events DROP COLUMN raw_body;&lt;/span&gt;
&lt;span class="gi"&gt;+DROP TABLE IF EXISTS billing_ledger;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gi"&gt;+++ b/.env&lt;/span&gt;
&lt;span class="gi"&gt;+STRIPE_SECRET_KEY=sk_live_51Scope…   (fictional fixture)&lt;/span&gt;
&lt;span class="gi"&gt;+STRIPE_WEBHOOK_SECRET=whsec_4kQ9…   (fictional fixture)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;--- a/src/jobs/reconcile_payouts.ts&lt;/span&gt;
&lt;span class="gi"&gt;+++ /dev/null&lt;/span&gt;
&lt;span class="gd"&gt;-/** Nightly payout reconciliation. */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;plus the matching churn in &lt;code&gt;package-lock.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;None of these was asked for. Each one is a plausible thing for an agent to do while "tidying up":&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A major dependency bump&lt;/strong&gt; (Stripe 7 → 10) inside a bug fix. Major versions of payment SDKs can change behaviour.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A destructive migration&lt;/strong&gt;: a dropped table and a dropped column, framed in a comment as cleanup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Committed secrets&lt;/strong&gt;: a live-format Stripe key and webhook secret in a new &lt;code&gt;.env&lt;/code&gt;. Agents often write realistic credentials into config and test files (&lt;a href="https://skylos.dev/blog/github-actions-ai-generated-code-pr-gate" rel="noopener noreferrer"&gt;Skylos&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A deleted scheduled job&lt;/strong&gt;: the nightly payout reconciliation is gone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lockfile churn&lt;/strong&gt; that hides inside a large, unreadable diff.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Running this diff through a rule-based merge gate gives &lt;strong&gt;14 findings, 6 of them critical&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Severity&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;th&gt;Where&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;critical&lt;/td&gt;
&lt;td&gt;Committed secret (Stripe live secret key)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.env&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;critical&lt;/td&gt;
&lt;td&gt;Committed secret (Stripe webhook signing secret)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.env&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;critical&lt;/td&gt;
&lt;td&gt;Dropped column &lt;code&gt;webhook_events.raw_body&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;migration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;critical&lt;/td&gt;
&lt;td&gt;Dropped table &lt;code&gt;billing_ledger&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;migration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;critical&lt;/td&gt;
&lt;td&gt;Major dependency bump: stripe&lt;/td&gt;
&lt;td&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;critical&lt;/td&gt;
&lt;td&gt;Job deleted: &lt;code&gt;reconcile_payouts.ts&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;src/jobs/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;td&gt;Secrets file changed / migration added / payment-related file changed&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;.env&lt;/code&gt;, migration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;Paths the task never mentions (×4), lockfile churn&lt;/td&gt;
&lt;td&gt;various&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The tests pass. The two requested files are correct. Without a check, this kind of PR gets approved.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually helps
&lt;/h2&gt;

&lt;p&gt;None of this needs a new product. These are habits and free tools:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Write the scope into the task, then check the diff against it.&lt;/strong&gt; "Do not change anything else" is only useful if something compares the changed paths to the files the task names. A plain list of allowed paths (&lt;code&gt;src/webhooks/**&lt;/code&gt;, &lt;code&gt;tests/webhooks/**&lt;/code&gt;) turns a vague instruction into something a machine can check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Protect the files that matter with CODEOWNERS.&lt;/strong&gt; Put migrations, &lt;code&gt;.github/workflows/&lt;/code&gt;, auth and payment code under a code owner, and require code-owner review in branch protection (&lt;a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners" rel="noopener noreferrer"&gt;GitHub docs&lt;/a&gt;). An agent PR that touches them can't merge without a human who owns that area.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Turn on secret scanning push protection, and scan PRs too.&lt;/strong&gt; GitHub's push protection blocks many known secret formats at push time (&lt;a href="https://docs.github.com/en/code-security/secret-scanning/introduction/about-push-protection" rel="noopener noreferrer"&gt;GitHub docs&lt;/a&gt;). Tools like gitleaks cover more formats and history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Lint migrations.&lt;/strong&gt; For Postgres, &lt;a href="https://squawkhq.com/" rel="noopener noreferrer"&gt;Squawk&lt;/a&gt; runs as a GitHub Action and flags destructive or locking migrations before they merge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Keep production credentials away from agents.&lt;/strong&gt; This is the real lesson from Replit: the agent could delete production because it could &lt;em&gt;reach&lt;/em&gt; production. Separate dev and prod databases, and give agents dev credentials only.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Treat CI workflow edits as privileged.&lt;/strong&gt; An agent that can edit &lt;code&gt;.github/workflows/&lt;/code&gt; can change what your CI is allowed to do. Review those changes like code with production access (&lt;a href="https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target" rel="noopener noreferrer"&gt;GitHub on &lt;code&gt;pull_request_target&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Keep agent PRs small.&lt;/strong&gt; A 40-file diff can't be reviewed properly by anyone. Ask for one change per PR and reject PRs that wander.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it on the example
&lt;/h2&gt;

&lt;p&gt;The example above is in a free browser demo that runs these rules locally. The diff never leaves your browser: &lt;a href="https://scope-guard-demo.netlify.app/" rel="noopener noreferrer"&gt;https://scope-guard-demo.netlify.app/&lt;/a&gt; (click "Webhook scope creep").&lt;/p&gt;

&lt;p&gt;If you want a free check on your own PRs, &lt;a href="https://github.com/gillardlogan/scope-guard-lite" rel="noopener noreferrer"&gt;Scope Guard Lite&lt;/a&gt; is an MIT-licensed GitHub Action that comments on agent PRs with committed secrets, &lt;code&gt;DROP TABLE&lt;/code&gt; / &lt;code&gt;DROP COLUMN&lt;/code&gt;, and files outside the paths you allow. It warns only and needs no API key. On this example it reports the two secrets, both drops, and the five files outside &lt;code&gt;src/webhooks/**&lt;/code&gt; and &lt;code&gt;tests/webhooks/**&lt;/code&gt;. The dependency bump and deleted job show up only as out-of-scope files. The paid Scope Guard adds the remaining rules and can block the merge.&lt;/p&gt;

&lt;p&gt;Whatever tool you use, the habit is what matters: say what the agent may touch, and check the diff against it before you merge.&lt;/p&gt;

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