GUIDE · CLOUDFLARE · 11 NOVEMBER 2026
AI changed your site? Test it before release with Cloudflare Worker Previews
You asked an AI coding agent to change the sign-in form or a game's catalogue. The code is ready, but publishing is risky: what if the site breaks? Cloudflare lets you open the change on a separate URL, test it on your phone, and only then release it to everyone. Here is how it works and where the remaining risk lies.

What is a Worker Preview?
A Git branch holds changes that have not reached your main site yet. Worker Preview gives that branch its own live URL. You can click buttons, open pages, and inspect errors there. Deploying again updates the same Preview URL; a separate deployment URL keeps a link to the exact version you tested.
For example, an agent redesigns a game page. Open the Preview URL on your phone, launch the game, check the menu, and give the agent a specific bug to fix. Visitors to the production site still see the previous version.
How to start a Preview
You need an app that runs as a Cloudflare Worker, its Git repository, and Wrangler 4.135.0 or newer. If your agent works in Cursor or Claude Code, give it access to that project. Do not paste passwords or API keys into the chat.
Create a separate branch for the task. Add a previews block to wrangler.jsonc with test settings. It can be empty if you do not need additional settings. Before running anything, review every database, file storage, and external-service binding in the next section.
Run the command below from that branch. Wrangler returns a Preview URL. Test the key flow, the mobile layout, and the logs. Merge into the main branch and deploy to production only after the review.
npm i -D wrangler@latest
npx wrangler previewSources for this section: [2]
The catch: a separate URL does not isolate your whole system
Cloudflare automatically isolates Durable Objects and Containers for each Preview. D1, KV, R2, and other resources are isolated only when you bind separate test resources. If you accidentally leave a production database or bucket attached, testing can change real data. Check binding names and IDs before clicking around in a Preview.
There are other limits: a service binding from a Preview can call the production Worker; messages sent to a production Queue may be consumed in production. Workflows are not automatically recreated per Preview. Use test keys and destinations for sign-in, payments, and email; stop the test if you cannot tell where an action goes.
Preview URLs are public by default. The workers.dev URL has a noindex header for search engines, but noindex does not block other visitors. Protect private data or unfinished features with Cloudflare Access.
What to check before release
- Open the Preview URL on desktop and mobile. Complete the exact flow you changed.
- Confirm writes, files, email, and payments go to test resources, not real users.
- Inspect the Preview logs after the flow. Find the cause of a blank page or a 500 error before release.
- Ask the agent for the changed files and test results. If a check was not run, do not mark it as passed.
A ready prompt for your coding agent
Paste this into Cursor, Claude Code, or another agent with access to your project files. Replace the brackets with your own feature.
Work only in a separate Git branch on [describe the change]. This project runs on Cloudflare Workers. First check the Wrangler version and current bindings in wrangler.jsonc. Configure a Worker Preview for this branch without changing production. Use separate test resources for D1/R2/KV, email, payments, queues, and any other external actions. If you cannot confirm that a binding is isolated, stop and show me the risk before running it. Do not copy secrets into chat or the repository. Run npx wrangler preview, test [the flow] at the Preview URL on desktop and mobile, and inspect the logs. Return the Preview URL, changed files, test results, and any checks you could not perform. Do not deploy to production or merge the branch without my separate decision.
The takeaway
Worker Previews give you and your agent a real test URL for each branch. You can see a change before release, but must configure the test environment deliberately: a separate URL does not guarantee a separate database or private access. Start with one small change, complete the flow yourself, and publish only after it works.
Discussion
Share a thought or ask about the article. Your nickname and comment will be public.
Sign in with email
Get a one-time code. No password needed.
The code expires in 10 minutes. Signing in does not subscribe you to the newsletter. Data use.
Or sign in with ChatGPT ↗Loading comments…