Work with custom rulesets
Last updated Apr 16, 2026 Use the following workflow to deploy a custom ruleset:
- Create a custom ruleset, optionally providing a list of rules to include in the custom ruleset.
- (Optional) Add rules to your custom ruleset.
- Deploy the custom ruleset by adding an
executerule to a phase entry point ruleset. If you skip this step, the rules of the custom ruleset will not run.
Currently, custom rulesets are only supported by the Cloudflare WAF, both at the account and the zone level.
Note
You cannot execute a custom ruleset from another custom ruleset, only from an entry point ruleset.
Change the behavior of a custom ruleset
To modify custom ruleset behavior, Cloudflare recommends creating a new custom ruleset or editing the custom ruleset instead of using overrides.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/ruleset-engine/custom-rulesets/#page","headline":"Work with custom rulesets","description":"Create, deploy, and manage custom rulesets using the API.","url":"https://developers.cloudflare.com/ruleset-engine/custom-rulesets/","inLanguage":"en","image":"https://developers.cloudflare.com/ruleset-engine/custom-rulesets/og.png?v=23aff571ffcf4bd2","dateModified":"2026-04-16","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Add rules to an existing custom ruleset using the API. title: Add rules to a custom ruleset image: https://developers.cloudflare.com/ruleset-engine/custom-rulesets/add-rules-ruleset/og.png?v=a1e99c8df0b2d666
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/ruleset-engine/llms.txt
Use this file to discover all available pages before exploring further.
Docs