Blog
2 min read

Cloudflare Protected Quick Tunnels: Share Localhost Only With the Emails You Choose

Cloudflare's Protected Quick Tunnels (Birthday Week 2026) add an --allowed-mail flag to cloudflared 2026.9.3+, so a quick tunnel to your local dev server only admits listed email addresses or domains, verified with a one-time PIN — no Cloudflare account needed on either side. How it works, its limits, and the coding-agent angle.

Quick Tunnels have been a favourite developer trick since 2021: one cloudflared command gives your local app a public trycloudflare.com URL. The catch was that anyone with the link could open it. On 2 October 2026, Cloudflare added Protected Quick Tunnels. (What Is ngrok?, Cloudflare Tunnel)

How to use it

Add --allowed-mail to the usual command (requires cloudflared 2026.9.3 or later):

cloudflared tunnel --url http://localhost:8080 --allowed-mail alice@example.com
  • Repeat the flag for more people.
  • Allow a whole company: --allowed-mail '*@example.com'.
  • Wrangler supports it too: npx wrangler tunnel quick-start http://localhost:8080 --allowed-mail alice@example.com.

Without the flag, the tunnel is public as before.

How it works

  1. A visitor opens the tunnel URL and enters their email.
  2. Cloudflare Access sends a one-time PIN to that address; entering it proves they control the inbox.
  3. cloudflared on your machine checks the verified email against your list and decides whether to let them in.

The authorisation decision happens locally: a stateless broker handles the email proof and stores no guest lists, so Cloudflare doesn't learn who you invited. Nobody needs a Cloudflare account. Sessions last up to four hours.

It also fails closed: if email authentication can't be confirmed, cloudflared refuses to start rather than falling back to a public tunnel.

Limitations

  • You can't change the guest list on a running tunnel — restart it, which ends everyone's access.
  • Hostnames are random. For a stable hostname or identity-provider groups, use a named Cloudflare Tunnel with Access.
  • Email sign-in is built for browsers, not API clients.

The coding-agent angle

Cloudflare pitched this partly at AI coding agents, which often need a URL to share a preview, reach a home-hosted agent, or expose an MCP server — and can start a Quick Tunnel by themselves. Their suggestions:

  • Put a rule like "always add --allowed-mail me@example.com to tunnels" in your AGENTS.md or CLAUDE.md. (How to Write a CLAUDE.md)
  • Use JSON output so the agent can parse the URL.
  • Check cloudflared's output, which shows whether email authentication is active.

An agent exposing your dev server — with its debug endpoints, error pages and sometimes development MCP endpoints — to the whole internet is a real risk. Next.js just patched a dev-server MCP endpoint that leaked project data to malicious sites. (Next.js September 2026 Security Release, DNS Rebinding)

Source: Cloudflare: Protected Quick Tunnels


EasySpawn gives every branch a private preview on your own server, so sharing work in progress doesn't mean opening a tunnel from your laptop. See how it works or join the waitlist.

Related: Test Webhooks Locally · Preview Environments for Every Branch · What Is Localhost? · Cloudflare Birthday Week 2026

Keep reading