Appearance

Language

Build a personal website from 0

What Breaks After You Launch an AI-Built Site in 2026: Failed Deploys, Leaked Keys, Database Permissions

Silent deploy failures, leaked API keys and wrong database permissions break sites after launch. Real incidents, check commands, a move-out order and a checklist.

Kelvin Wang · · 15 min read

Key points

  1. A failed build leaves the site on the old version. After every push, check the build result and confirm the live page has the new content.
  2. Keep keys out of the repo and the front end. If one leaks, revoke and replace it at the provider first, then find the cause.
  3. Turn on RLS and write policies for every new Supabase table, and revoke anon access when visitors don't need it.
  4. Manage your own domain and DNS, keep content as files in a repo, and export the database once, so you can move if your host closes.

Deploys fail quietly, so the live site stays on the old version while you think your fix shipped. API keys leak, and someone else spends your money or reads your data. Database permissions are wrong, so anyone can read and write your tables, or a feature stops working because the rules are too strict. None of these shows a red warning on the page. You have to go and check. My own site (Astro, Cloudflare Workers and Supabase, written with Claude Code) has hit all three, and every case here has a real record and a check you can run.

Failed deploys: you pushed, the site didn’t change

Most modern setups deploy the same way. You push code to GitHub, the hosting platform gets notified, runs a build (npm run build) on its own machine, and only swaps in the new version if the build succeeds. My site uses Cloudflare’s Workers Builds, so every push to main deploys automatically.

When a build fails, the site doesn’t go down. It stays on the previous version. The push succeeded and the site still loads, so it is easy to assume your change is live.

What happened: 5 of 7 pushes never shipped

  • Harm done
  • Positive step
  1. Harm done: Before 2026-11-05

    5 of the last 7 pushes failed to build on Workers Builds

    The error was EMFILE: too many open files. Builds passed on my own machine and failed only on Cloudflare's builder.

  2. Positive step: 2026-11-05

    Cause found and fixed (commit 44ec11e)

    Rollup, the bundler under Astro, opens up to 1,000 files at once by default. Workers Builds has a lower open-file limit. Lowering the limit locally with ulimit -Hn 512 reproduced the failure. With maxParallelFileOps set to 64, the build passed at limits of 512 and 256.

  3. Positive step: 2026-11-06

    Test added so nobody undoes it (commit 30044f1)

    The test reads astro.config.mjs and fails if the setting is missing or above 128.

The fix is one line in the vite block of astro.config.mjs:

// astro.config.mjs (excerpt)
export default defineConfig({
  vite: {
    // Rollup opens up to 1000 files at once by default; Workers Builds has a lower open-file limit (EMFILE)
    build: { rollupOptions: { maxParallelFileOps: 64 } },
  },
});

And the guard in tests/build-config.test.ts:

const config = readFileSync(new URL('../astro.config.mjs', import.meta.url), 'utf8');
const m = config.match(/maxParallelFileOps:\s*(\d+)/);
expect(m, 'vite.build.rollupOptions.maxParallelFileOps must stay set').not.toBeNull();
expect(Number(m![1])).toBeLessThanOrEqual(128);

A local build passing doesn’t mean the deploy will pass: the builder’s environment is not your laptop.

How to confirm a deploy actually shipped

  1. Check the build. In the Cloudflare dashboard, go to Workers & Pages, pick your Worker, open Deployments, and check the latest build. If it failed, open its build log.
  2. Check the live page. Open the page you changed, or fetch it with curl, and look for the new content. My site has an automated test for exactly this: it looks for a marker that only exists in the new version inside the live /app bundle, and the deploy only counts once the marker is there (commit b13f2b9).
  3. Roll back first, fix second. On the Deployments page, pick the version you want, open the three-dot menu and choose Rollback. Or use Wrangler:
npx wrangler deployments list   # recent deployments and versions
npx wrangler rollback           # back to the previous version, or pass a version ID

Two limits apply. You can only roll back to the 100 most recent versions, and connected resources such as databases and KV are not rolled back, so old code may fail if the new version changed your data’s shape 1.

Go deeper Cloudflare Workers Tutorial 2026: Astro SSR and Wrangler Deployment setup from zero, and what to check when a build fails.

Leaked keys: someone else is using your credentials

Connecting to a database, calling an AI model or sending email all need a key (an API key, password or token). Whoever holds it can use that service as you, on your bill. Keys usually leak one of three ways:

  1. Committed to GitHub. Deleting the file later doesn’t help. The key is still in git history.
  2. Shipped in front-end code. Any JavaScript the browser downloads is readable by any visitor.
  3. Stored on a platform that gets breached. You can’t control this one. You can only limit the damage.

Keep keys out of the repo

Put keys in a .env file and exclude it in .gitignore. My site added this rule on the day the repo was created (2026-06-10), keeping only a .env.example with no real values:

# ignore every .env file except the example
.env*
!.env.example

For local development with Wrangler you can also keep secrets in .dev.vars. Cloudflare’s docs say neither .dev.vars nor .env should be committed, so ignore both 2. Production secrets go to Cloudflare with a command, never into wrangler.jsonc:

npx wrangler secret put SUPABASE_SECRET_KEY

GitHub helps too. Push protection for users is on by default and stops you from pushing secrets it recognizes to public repositories. Push protection at the repository level is off by default, so turn it on in the repo’s settings 3. It won’t recognize every secret, so don’t rely on it alone.

Know which keys are safe to expose

Supabase has two kinds of key, and the difference matters 4:

  • Publishable key (formerly the anon key): safe in front-end code. What it can reach is decided entirely by your database permissions (RLS, next section).
  • Secret key (formerly the service_role key): bypasses every RLS policy. Server-side only.

Supabase rejects browser requests that carry a secret key with a 401, but a leaked secret key still works from any other tool. Supabase’s guidance is to fix the cause of the leak, then rotate the key, and to give each backend component its own key so a leak only means rotating one.

Assume your platform will be breached one day

Zeabur, a deployment platform popular with developers in Taiwan, had two security incidents in two months in 2026 and announced in October that it was shutting down, naming the incidents as one of the reasons 9. In August, an attacker got in through a vulnerable NextChat instance one user had deployed and worked up to an AWS root key, then read project environment variables 7. In October, an attacker used a cluster admin token created in January 2024 that had no expiry and had never been rotated (how they got it is unconfirmed in the preliminary report), and read 3,218,965 environment variables and 321,810 accounts 8.

A key you paste into a platform’s environment variables page is only as safe as that platform. What you can do is keep the damage small:

  • One key per project, so each can be revoked on its own.
  • Usage caps and billing alerts on anything that costs money, AI and cloud keys first.
  • After a leak, rotate the leaked key and everything that key could read.
Go deeper Will AI Leak Your API Keys to GitHub? 2026 Pre-Launch Check Checking git history, front-end output and your host before launch, and revoking first after a leak.

Database permissions: anyone can read your tables

Supabase lets a web page read and write the database straight from the browser, using the publishable key that anyone can see. What stops strangers is Row Level Security (RLS): rules on each table that decide who can read and write which rows.

Permissions go wrong in two directions.

Too loose: everyone can see the data

Supabase’s docs are blunt: a table in an exposed schema without RLS is readable and writable by any role with a grant on it, and on existing projects a new table in public starts with every privilege granted to all three roles, including anon, the logged-out visitor 5. Create a table, forget RLS, and anyone with your project URL can read, change and delete its rows.

My site ran into this twice:

  • 2026-09-26: new admin tables came up with an anon grant even though the migration never issued one, because of Supabase’s default privileges. Every RLS policy was limited to logged-in users, so visitors saw zero rows, but a second migration revoked the anon grant anyway.
  • 2026-10-24: a table of exchange promotions was readable by visitors. Paused promotions kept their old codes and links for internal use, and the public API kept serving them. The fix was a public policy that only returns active rows, using (active) (commit 1650aa8).

Too strict: features break

On 2026-09-28, image upload used an upsert (update if present, insert if not), but the storage bucket had no SELECT policy, so RLS blocked the upsert. The fix was a fresh file name on every upload and no upsert (commit 20e8391). When RLS blocks a request, the front end often sees “no data” or a vague error, which looks like a bug in your code.

Every new table, in this order

-- 1. Enable RLS: with no policies, nothing is readable
alter table public.notes enable row level security;

-- 2. Add a policy: logged-in users read and write their own rows
create policy "own notes" on public.notes
  for all to authenticated
  using ((select auth.uid()) = user_id)
  with check ((select auth.uid()) = user_id);

-- 3. Revoke the default grant if visitors never need the table
revoke all on public.notes from anon;

-- 4. Verify: should return false
select has_table_privilege('anon', 'public.notes', 'select');

using controls which existing rows can be read or changed. with check controls what new data can be written. Write both.

When AI writes a table for you, check what the policy means, not only that it runs. My site’s CLAUDE.md has a rule for this: the admin area is a shared workspace, so new tables must use the workspace-member check and never owner_id = auth.uid(), which would hide rows from the other members. A policy can be valid SQL and still be wrong, and tests won’t always catch it.

Supabase’s dashboard also lists public tables with RLS off under Advisors → Security (lint 0013_rls_disabled_in_public, level ERROR) 6. Open it after adding a table.

Go deeper Supabase RLS Tutorial: Policies, using vs with check, Testing Writing policies and testing them as different users.

Your host shuts down or changes direction: how do you prepare to move?

The first three are mistakes in your own setup. This one happens when you did nothing wrong and the platform under your site changes: it gets acquired, stops investing in a product, or closes. Four recent cases, each from an official announcement:

  • Harm done
  • Warning or reduced service
  1. Warning or reduced service: 2023-09-07

    Google Domains registrations move to Squarespace

    Accounts moved to Squarespace Domains ([11]); domains using Google Domains for DNS can't change a record until they switch DNS providers ([12]).

  2. Warning or reduced service: 2025-04-08

    Cloudflare steers new projects to Workers

    Cloudflare said Pages will continue to be supported, but all of its investment, optimizations and feature work will go to Workers, and new projects should start on Workers ([13]). The Pages docs now say "Start new projects with Workers" ([14]).

  3. Harm done: 2025-07-08

    Glitch ends project hosting

    Glitch announced on 2025-05-22 that project hosting and user profiles would shut down on July 8. The dashboard stayed open through the end of 2025 for downloading code and setting up forwarding for project addresses ([10]).

  4. Harm done: 2026-12-31

    Zeabur stops every service and deletes data

    Zeabur announced on 2026-10-17 that it is shutting down. It recommends finishing migration by November 30. From December 1, running services on shared clusters are paused (you can resume them manually to back up), and dedicated servers close as they expire. On December 31 every service stops and service data is deleted ([9][15]).

Every one was announced in advance, but not always far in advance: Glitch gave about six weeks between the announcement and the end of hosting. Pages didn’t close, and new features go to Workers, so the effect is slower, but official guides will center on Workers too. My earlier sites ran on Next.js, and one of them depended on the next-on-pages adapter to deploy to Cloudflare Pages. When we upgraded that project from Next.js 13 to 14 in 2023, the adapter didn’t support the new version yet, and the deploy setup had to change along with it. The adapter is now deprecated, and its repo was archived in October 2026. After that experience, this site started on Astro and Workers from day one.

Go deeper Next.js on Cloudflare in 2026: What to Do Now That next-on-pages Is Deprecated Changing how you deploy when the adapter stops being maintained.

Keep the site movable before you need to move it

  • Keep the domain apart from the host. Buy it at a separate registrar and manage the account, payment method and renewal date yourself. If the host closes, you point DNS somewhere else and the address stays the same. If the new site also keeps the same paths, your search rankings and other people’s links carry over. If paths change, 301-redirect the old URLs to the new ones (see the launch SEO checklist).
  • Keep DNS where you can edit it. The Google Domains case shows that frozen DNS stops you from even pointing the domain at a new host. Before you need it, check you can log in to wherever your DNS lives.
  • Keep content as plain files in a repo. Posts written in Markdown or MDX in your own git repo go with you to any host. My site’s articles used to live in a Supabase table. On 2026-11-05 they all became files in the repo, so moving no longer needs a separate article export.
  • Know which host-only features you use. Built-in forms, image processing, cron, KV, edge functions: each needs a replacement on a new host. You don’t have to avoid them, but list them so nothing gets missed in a move.
  • Keep a list of environment variables. Names and purposes only; the values go in a password manager, never in the repo. When a host closes, its environment variables page goes with it.
  • Back up the database and know how to export it. For PostgreSQL that’s pg_dump. The Supabase CLI’s supabase db dump exports only the schema by default; run it again with --data-only for the data (and --role-only for custom roles). It also dumps the local database by default, so add --remote to target your linked cloud project 16. Files uploaded to Storage are not in the database dump; download them separately. Do a real export at least once and confirm it restores.
  • Ship static output where you can. A build that is a folder of HTML, CSS and JS runs on any host. The more server-side features you depend on, the fewer places you can move to.

If your host announced a shutdown tomorrow, move in this order

  1. Take inventory. List the domain, where DNS lives, where the code lives, environment variables, the database, uploaded files, cron jobs and webhooks, and OAuth callback URLs.
  2. Lower the DNS TTL first. Set the TTL on the records you’ll change to about 300 seconds and wait for the old TTL to run out, so the switch takes effect quickly. On Cloudflare, proxied records (the orange cloud) have a fixed TTL of 300 seconds that you can’t change 17. If the move also changes nameservers, how long resolvers cache them is set by the parent zone (such as .com), not by you, and Cloudflare’s setup docs say to allow up to 24 hours for your registrar to update them 18, so switch nameservers early.
  3. Deploy in parallel on the new host. Move the database and files and set the environment variables again: create a separate new key at each provider for the new host, and revoke the old one only in step 6. The exception is an old host that leaked keys; rotate those right away. Run it on a test subdomain.
  4. Switch only after testing. Try login, forms, payments and cron jobs on the test address, then point the production domain’s DNS at the new host. If the site writes data (accounts, forms, comments), pause writes before the switch or sync the database once more as you switch, or anything written to the old host after step 3 stays behind.
  5. Verify. Use curl or a private browser window to confirm responses come from the new host, HTTPS works, and search tools such as Search Console show no wave of errors.
  6. Cancel the old host last. Keep it a few days as a fallback. Once no traffic reaches it, do a final data export, revoke the old keys and cancel the plan.

Why Zeabur closed and how the two breaches happened is in part 1 and part 2. To move a domain to another registrar, transfer prices and steps are in domain renewal prices.

Go deeper Zeabur Migration Guide (with a copy-paste AI prompt): Moving to Supabase and Cloudflare Workers Databases, files, sites, APIs, cron jobs and domains, step by step. Go deeper Buy a Domain and Set Up DNS with Cloudflare, Plus Free Email Forwarding (2026) Keep the domain and DNS separate, so changing hosts is a record change.

Website maintenance checklist

WhenWhat to checkHow
After every pushThe build succeededCloudflare dashboard → Deployments, or npx wrangler deployments list
After every pushThe live site is the new versionOpen the changed page, or curl it and look for the new content
A new version is brokenRoll back, then fixRollback in the dashboard, or npx wrangler rollback
Every new tableRLS is on and the policy is rightSupabase Advisors → Security; try as a visitor and as a logged-in user
Every new tableVisitors actually need accesshas_table_privilege('anon', ...)
Every new keyIt isn't in code or the front endIgnored in .gitignore; stored with wrangler secret put
MonthlyBills and usage look normalEach provider's billing page; usage caps on keys that cost money
MonthlyFree plans aren't paused or near limitsSupabase project status and storage use
Suspected leakRevoke, replace, check bills, find the causeFollow "If a key leaks, in this order" above
Every six monthsThe site can still moveYou can log in to the registrar and DNS; the environment variable list is current; do one real database export

Sources

  1. 1. Rollbacks · Cloudflare · checked 2026-11-07
  2. 2. Secrets · Cloudflare · checked 2026-11-07
  3. 3. About push protection · GitHub · checked 2026-11-07
  4. 4. Understanding API keys · Supabase · checked 2026-11-07
  5. 5. Row Level Security · Supabase · checked 2026-11-07
  6. 6. Database Advisors · Supabase · checked 2026-11-07
  7. 7. Zeabur August 2026 security incident · Zeabur · 2026-09-07
  8. 8. Zeabur October 2026 security incident (preliminary report) · Zeabur · 2026-10-19
  9. 9. Zeabur shutdown announcement and migration plan · Zeabur · 2026-10-17
  10. 10. Changes are coming to Glitch · Glitch · checked 2026-11-16
  11. 11. Squarespace Completes Acquisition of Google Domains Assets · Squarespace · checked 2026-11-16
  12. 12. Export domains / Google Domains migration to Squarespace · Google Cloud · checked 2026-11-16
  13. 13. Your frontend, backend, and database — now in one Cloudflare Worker · Cloudflare · checked 2026-11-16
  14. 14. Cloudflare Pages · Cloudflare · checked 2026-11-16
  15. 15. Service migration, refunds, and security incident claims · Zeabur · 2026-10-22
  16. 16. supabase db dump · Supabase · checked 2026-11-16
  17. 17. Time to Live (TTL) · Cloudflare · checked 2026-11-16
  18. 18. Change your nameservers (Full setup) · Cloudflare · checked 2026-11-16

About the author

Kelvin Wang

Electrical engineer building tools with AI agents, sharing hands-on notes on engineering and investing.

More about me