Use case · Secure web gateway

Cloudflare GatewayGateway Forward

Make your secure web gateway enforce the rules your business actually has.

Your web gateway can allow, block, isolate or log. Your business asks for a reason, a training check, an alert to the on-call team.

Brixio designs and builds the rules your secure web gateway (SWG, the gateway that filters your users' web traffic) can't express, as code running inside Cloudflare Gateway, alongside the rest of your Cloudflare One deployment.

The shift

Before · Allow or Block

The rule lives in a ticket

After · Programmable

The rule runs where the traffic is

TL;DR

Most web filtering stops at a handful of terminal actions, so the rules your business actually has end up in tickets, scripts and side proxies. Since 15 October 2026, Cloudflare Gateway can hand allowed web traffic to your own code with the Forward action, in public beta on all Zero Trust plans; Custom Functions, which turn code into policy conditions, are expected before the end of the year, according to Cloudflare. Brixio reviews your rules, keeps native what can stay native, and builds and tests the rest as Cloudflare Workers.

This sits within our managed SASE and Zero Trust approach.

Cloudflare, launch post of 15 October 2026

4

terminal actions most web gateways decide with: Allow, Block, Isolate, Log

Cloudflare, launch post of 15 October 2026

5 to 15 min

delay of a log-to-SIEM-to-Slack pipeline built to flag a new SaaS sign-up

Cloudflare, launch post of 15 October 2026

4+ years

of customer requests for justification pages, one of the most requested Gateway features

Cloudflare documentation

15 Oct 2026

Gateway Forward enters public beta, on all Zero Trust plans

Interactive · Rule placement

Where should this rule live?

Pick a rule and answer four questions. You'll get a verdict straight away; nothing to fill in.

Step 1 of 5
Which rule do you need?

Several answers possible.

01

The problem

Why can't web filtering on your secure web gateway enforce your business rules?

Web filtering on a secure web gateway follows one model: match a condition, apply a terminal action. Category, URL, user group, device posture: the condition can be precise, but the outcome is always one of a few verdicts. URL filtering knows where a user is going. It doesn't know why, whether their security training is up to date, or whether the on-call team should hear about it.

So the rule moves elsewhere. A pool of NGINX proxies to add a header in front of an internal app. A pipeline from logs to a SIEM (security information and event management system) to Slack, which flags a new SaaS sign-up minutes after the fact. A ticket, a manual exception, and someone who has to remember to remove it. Each workaround is one more system to patch, monitor and explain to an auditor.

This is web filtering at the HTTP level, after TLS decryption (TLS: the protocol that encrypts web traffic), where the gateway sees the URL, the body and the user's identity. Filtering at the DNS level, before any connection, is a different control: see DNS filtering in our glossary, and secure web gateway for the definition.

A policy engine answers yes or no. Your business rarely does.

02

The rules

Which rules does your web gateway need that Allow or Block can't express?

Documented template

Ask for a reason before a sensitive site opens

Your users need occasional access to a sensitive category, and you want to know why, without opening a ticket each time. Cloudflare documents a coaching page template that shows a page without contacting the destination; according to Cloudflare, a Worker can also record the reason and keep a session so the user isn't asked on every request. We build the unlock, the audit trail and the session around your groups and your retention rules.

Custom build

Keep an application closed until security training is done

Your auditors want proof that only trained staff reach the finance or HR application. No Cloudflare template does this. A Worker can check your training records before letting the request through and return an explanatory page otherwise; we design that check with your HR system and decide with you what happens when it can't answer.

Documented template

Alert the team when someone signs up to a new SaaS or AI tool

You want to know about a new tool the day someone signs up, without blocking them. Cloudflare documents a Slack notification template: the request goes through, and the alert is sent in the background. We map the sign-up endpoints of the tools you care about and route the alert to your on-call tool. This complements our shadow AI detection, which finds the AI tools already in use in your organisation.

Native + custom

Pass identity to internal apps

Your internal apps expect the user's identity or role in a header, and today a reverse proxy adds it. For identity passed as it is (email, groups, or a SAML or OIDC attribute, from the single sign-on protocols of your identity provider), a native Allow policy is enough: Gateway adds the header with dynamic variables, with no code. A Worker is only needed when the value requires logic, such as turning groups into an application role. Either way, the NGINX proxies placed in front of internal apps are no longer needed.

Documented template

Set aside downloads for review

Your analysts want a copy of certain downloads for review. Cloudflare documents a template that copies files of up to 25 MiB to a private R2 bucket (R2: Cloudflare's object storage) while the user gets the download. The copy is taken before Gateway's final response inspection, so we keep the bucket private, apply retention, and integrate a third-party sandbox case by case.

DLP feature

Check whether a leaked secret is still live before blocking

Your DLP (data loss prevention) flags API keys, and some of the alerts are for keys already revoked. This is not a Forward rule: it is a separate DLP capability that runs a Worker to score or veto a match, available and enabled account by account. It sharpens detection without uploading reference data, as Exact Data Match (EDM) would require. See our managed DLP service.

03

The mechanism

Your code runs after the policy, not instead of it

Cloudflare Gateway evaluates your HTTP policies first: a Block always wins. Only then does a Forward policy hand the allowed request to your Worker. Gateway inspects the original body before passing it to the Worker; if that inspection blocks, it interrupts the Worker, even one already running. The Worker can modify the request, answer it itself, raise an alert, or let it through, once, to its original destination. Gateway inspects the final response before the user sees it. According to Cloudflare, Gateway and Workers run on the same servers. Three prerequisites: Gateway HTTP filtering, TLS decryption, and a trusted root certificate on users' devices.

The device, running the Cloudflare One Client (formerly WARP) with a trusted root certificate, sends its web traffic to Gateway. HTTP policies decide first, and a Block stops everything. A matching Forward policy then selects your Worker. Gateway inspects the original body, including DLP, before the Worker receives it, and can block or interrupt it. The Worker reads, modifies, answers or alerts, and can call the original destination once with next(). The final response is inspected before it reaches the user.
Your code fits in after the policy, without replacing it. Redrawn from Cloudflare's Forward traffic documentation.

See Gateway Forward in Cloudflare One, and how Gateway Forward works, step by step.

04

The decision

Native policy, Forward Worker or custom function: where should each rule live?

Your needNative policyForward Worker (public beta)DLP validation (available)Custom Function (announced)Outside the gateway
Block a category, allow a domainyes
Pass identity in a header (email, groups, SAML or OIDC attribute)yes (dynamic variables)
Compute a role from groupsyesyes (Cloudflare's example)
Ask for a reason and keep a recordyes (coaching page template, KV, D1)
Warn the on-call team without blockingyes, in the background (Slack template)
Mask a field before it leavesyes (JSON redaction template), without bypassing DLP
Watermark a page with the user's nameyes (watermark template)
Copy a download for reviewyes (capture to R2 template)
Gate access on external data (training, risk score)possible, to designyes, as a condition
Decide whether a detected secret is still livenoyes
Layer 4 rule (ports, protocols)noyes
WebSocket, CONNECT, uninspected trafficnoyes (another control)

Custom Functions: expected before the end of the year, according to Cloudflare.

The principle is simple: native as long as the policy can express the rule, code only when the rule justifies it, because every coded rule has to be maintained. KV, D1 and R2 are Cloudflare's key-value store, SQL database and object storage.

05

The boundaries

What does a programmable gateway not do?

A Worker attached to Cloudflare Gateway only sees decrypted HTTP traffic. Traffic exempted from inspection, WebSocket connections and CONNECT tunnels go straight to their destination, and if the Worker fails, the request fails rather than passing unchecked.

We design every rule with these limits in mind:

  • Traffic exempted from inspection never reaches the Worker, including applications with pinned certificates.
  • WebSocket, CONNECT tunnels, protocol upgrades and HTTP trailers bypass the Worker.
  • On error, the request fails (fail closed). If a Worker is deleted before its policies are updated, matching requests return HTTP 500.
  • Gateway inspects the original body before the Worker. What the Worker adds to a request is not scanned again by DLP on the request side.
  • Traffic your own Workers send through Workers VPC (their private connection to your networks) is dropped if it matches a Forward policy. Exclude it from your policies.
  • A Forward policy can't be triggered by a DLP result. That decision belongs to DLP validation.
  • Forward is in public beta. Pilot on a narrow scope first.

Expert tip. Before you delete a Worker, update every Forward policy that points to it. Gateway doesn't remove the policy, and matching requests start returning HTTP 500.

Code on Workers is not new to us: our engineers built Bot Shield entirely on Workers for an airline.

06

The operator

How does Brixio design and build your gateway rules?

Review your rules

  • We go through what your gateway, proxies and scripts enforce today, and decide which rules stay native and which need code.

Put the prerequisites in place

  • If Gateway HTTP filtering or TLS decryption isn't deployed yet, we deploy it first.

Write and test

  • Each rule is built as a Worker, tested on a pilot group and host, and put into production progressively, in warn-only mode before it blocks.

Hand over a maintainable rule

  • Versions, tests, rollback and a runbook for each rule, reviewed as Cloudflare's features evolve.
Seven steps. Review the rules. Decide native or code: a rule the policy can express stays native, with no code. Put Gateway prerequisites in place. Write and test the Worker. Pilot on one group. Run warn-only, then blocking. Maintain and review, which feeds the next review.
A coded rule is managed like software.

Cloudflare ASDP

Authorized Service Delivery Partner

Cloudflare only

no other vendor in delivery

ISO 27001:2022

certified

450+

delivered projects

5 hubs

Paris · Dubai · Singapore · Casablanca · Zurich

The offer is called Programmable Gateway modules. Brixio, a Cloudflare Authorized Service Delivery Partner (ASDP) with more than 450 projects delivered, decides which rules stay native and which need code, and builds them as Cloudflare Workers, alongside your Cloudflare One deployment, from Paris, Dubai, Singapore, Casablanca and Zurich. Our own site, brixio.io, is built and served on Cloudflare Workers.

See also our professional services and custom application development.

Talk to a Cloudflare One engineer →

Questions and answers

What security teams ask about programmable gateways.

A programmable secure web gateway runs your own code on the web traffic it has already allowed. On Cloudflare, the Gateway Forward action, in public beta since 15 October 2026 on all Zero Trust plans, hands matching HTTP requests to a Cloudflare Worker that can modify them, answer them or trigger an alert.
Everything the existing selectors and actions can express: categories, domains, groups, device posture, and identity headers through dynamic variables. Code is only worth it when the rule needs logic the policy can't hold, because every coded rule has to be maintained. The decision table above sorts the common cases.
Yes, at least Cloudflare Gateway: you need its HTTP filtering and TLS decryption, with a root certificate on your users' devices. If they aren't in place, we deploy them first, as part of our managed SASE and Zero Trust approach.
Yes, on a pilot scope: one group, one host, and rules that warn or record before they block. Forward has been in public beta since 15 October 2026, on all Zero Trust plans.
A coded rule is maintained like software: versions, tests, rollback and keeping up with Cloudflare's changes. When we scope a module, we agree with you who owns each rule, and we hand over the code, the tests and a runbook.
On Cloudflare's side, each Worker call is billed as a standard Workers request. The engagement itself is scoped after we review your rules.
DNS filtering acts when a name is resolved, before any connection, on every device and site, without decryption. Web filtering on a secure web gateway acts on decrypted HTTP traffic, where it sees the URL, the body and the identity, and where a rule can become code.

Programmable Gateway modules

Your business rules, enforced at the gateway.

We review the rules you need and tell you which stay native and which need code.

Talk to an expert

Your business rules, enforced at the gateway.

  1. Your requestA few lines are enough: what your gateway, proxies and scripts enforce today, and what they can't. No questionnaire, no commitment.
  2. Our reviewA Cloudflare One engineer looks at your context before replying, so the answer fits your rules.
  3. Our proposalA review of your rules (which stay native, which need code), a pilot on one group and one host, or simply an answer to your question.
  4. Your decisionGo further or stop there: the choice is yours.
No pressure, no commitment.We help you see your situation clearly, then you decide if and when to go further. Your details stay confidential. ISO 27001:2022.
Step 01 · Send your message

Tell us a bit, get a callback.

Already a Cloudflare customer? (optional)