Comparison

Cloudflare vs Arcjet

Cloudflare’s WAF, bot management, rate limiting, and AI Gateway evaluate inbound traffic at the edge. Arcjet runs inside your application request handlers and on agent tool calls the edge cannot see. They are complementary more often than they are substitutes.

13 min read
In short: Cloudflare’s WAF, bot management, rate limiting, and AI Gateway evaluate inbound traffic at the edge. Arcjet runs inside your application request handlers and on agent tool calls the edge cannot see. They are complementary more often than they are substitutes.

Key differences: Cloudflare vs Arcjet

Cloudflare vs Arcjet is the usual pairing: Cloudflare at the edge, Arcjet in the application. Teams evaluating a Cloudflare WAF alternative often keep Cloudflare for DDoS and use Arcjet for application-aware rules.

This comparison uses primary documentation reviewed on August 13, 2026. Products change, so check the linked sources before you decide.

Cloudflare's application-security products run at the network edge. Rules evaluate before a request reaches your origin, which means that DNS and traffic must go through Cloudflare. Arcjet runs inside your application: in request handlers, and on agent tool calls and background jobs the edge never sees. It works alongside any CDN, including Cloudflare, rather than replacing it.

That layer split drives the rest of the comparison. Edge rules see IP, TLS fingerprint, path, headers, and other network signals. In-app rules see session, plan tier, route, and the input to a tool call. They're complementary more often than they're substitutes.

What each layer covers

Cloudflare is strong at DDoS, coarse bot and WAF filtering, and, through AI Gateway, caching and content moderation in front of model providers. Arcjet covers application-aware bots and Shield WAF on HTTP, plus prompt-injection detection, per-user token spend, and sensitive-information checks before content hits a model, including inside agent tool calls. Bot detection is an HTTP control in request handlers.

Configuration

You change Cloudflare rules at the CDN in a dashboard, through the API, or with Terraform. You change operational in-app remote rules in the Arcjet dashboard or through MCP: block a country, ASN, IP, or VPN during an attack; turn on a global bot category; add a temporary site-wide rate limit; dry-run then promote. Those updates take effect immediately: create, update, delete, or promote from dry-run to live, with no code edit and no application restart. They still enforce inside the application, combined with any code rules into one decision, so they keep the request context that the edge doesn't have.

App-specific rules stay in code because they need application context: route, user, tenant, plan, prompt, tool call, or request body. That includes per-user token budgets, prompt-injection detection, sensitive-information checks for personally identifiable information (PII), email validation, and identity-keyed limits. Operational HTTP remote rules support fixed-window and sliding-window rate limits, bots, filters, and Shield WAF. You set token-bucket budgets in application code because each call declares how many tokens it consumes. Those remote rules are site-wide: every HTTP check for the site.

Labeled tool-call policies let a security team change the policy for a labeled action without changing the tool. That's a separate system from request remote rules.

Bot detection

Cloudflare offers Bot Fight Mode (all plans, a single domain-wide toggle), Super Bot Fight Mode (Pro, Business, and Enterprise without the Bot Management add-on: category actions, no per-request scoring), and Bot Management for Enterprise (per-request scores and custom rules). Per-request scores and custom rules sit on the Enterprise add-on. Arcjet classifies known bots by name and category in your request handlers, on self-serve plans, and can add browser-based signals for headless-browser detection without a CAPTCHA.

Rate limiting

Cloudflare rate limiting is heavily tiered. Free: 1 rule, IP only, 10-second max window. Pro: 2 rules, 1-minute max. Business: 5 rules, 10-minute max. Enterprise: 100 rules. Keying on headers, cookies, JSON body fields, or query parameters requires Enterprise Advanced Rate Limiting. You configure Arcjet rate limiting in code, and it can key on user ID, account, session, or plan on self-serve plans. You set token-bucket budgets in application code, not as remote rules.

AI Gateway vs in-app AI protection

AI Gateway sits between your application and model providers. It provides caching, request-count rate limiting, retries, analytics, Guardrails for harmful-content moderation, and data loss prevention (DLP) for PII on prompts and responses. The Guardrails documentation doesn't mention prompt-injection or jailbreak detection, and AI Gateway rate limiting is request-count-based with no concept of your authenticated users. Separately, Cloudflare's WAF AI Security for Apps (Enterprise paid add-on) can score inbound HTTP prompts for injection. That score still sits on edge HTTP, so it doesn't cover tool calls, queued jobs, or fan-out work inside the application. You configure Arcjet's AI checks in your application code: prompt-injection detection (the Arcjet Cloud API evaluates the prompt text), per-user token budgets keyed in code, and sensitive-information detection that runs entirely in your application. Sensitive-information detection uses a built-in local engine, plus an optional on-device ML model for names, addresses, and government or financial identifiers. That isn't a hosted DLP service that you route prompts through. For sensitive-info detection, the raw body isn't sent to Arcjet for inspection.

Turnstile vs advanced signals

Turnstile is a per-form CAPTCHA-replacement widget. Tokens expire after 300 seconds, are single-use, and require a verification round-trip on the protected submission. Arcjet advanced client signals collect browser-environment anomalies, persist a cookie, and evaluate with server-side bot classification and IP reputation. See CAPTCHAs vs Arcjet.

Comparison

AreaArcjetCloudflare
Where it runs

Inside your application: request handlers for HTTP, and agent tool calls, MCP handlers, and jobs for the work that the edge can't see.

At the Cloudflare network edge, before requests reach your origin. Requires routing traffic through Cloudflare.

Configuration

Operational HTTP rules (bots, Shield WAF, filters, fixed/sliding rate limits) change in the Arcjet dashboard or through MCP and take effect immediately, still inside the app. App-specific rules stay in code: per-user token budgets, prompt injection, PII, and identity-keyed limits.

Dashboard, API, or Terraform. Fast global propagation. Separate from the application codebase; static rules only.

HostingWorks on any provider, alongside any CDN, including Cloudflare.

Requires DNS routed through Cloudflare. Works with any origin behind the Cloudflare proxy.

Languages

JavaScript, TypeScript, and Python are the documented SDKs. Go is pre-release.

Any language or framework behind the Cloudflare proxy. Workers has first-class support for JavaScript, TypeScript, Python, and Rust.

Bot detection

Known bots by name and category in request handlers, plus optional advanced client signals. Self-serve. Bot detection is an HTTP control.

Bot Fight Mode (all plans, no configuration). Super Bot Fight Mode (Pro, Business, and Enterprise without Bot Management). Bot Management with per-request scores: Enterprise add-on.

AI bot blocking

AI crawler category configured in code, with per-bot allow/deny. HTTP only.

AI bot policies on all plans, including Free: Search, Agent, and Training presets, with the crawler list maintained by Cloudflare.

AI app protection

Prompt-injection detection, per-user token budgets in code, and in-process sensitive-info (built-in local engine, optional on-device ML model). Same checks can run on tool and job inputs.

AI Gateway: caching, request-count rate limiting, retries, analytics, Guardrails (harmful content), DLP PII. No documented prompt-injection or jailbreak detection on the gateway. WAF AI Security for Apps (Enterprise paid add-on) can score inbound HTTP prompts. No per-user token-cost budgets tied to your users.

CAPTCHA / browser

Advanced client signals compose with server-side bot detection and a missing-cookie filter. Covers later HTTP requests, including pages that have no form.

Turnstile is a per-form widget. Tokens expire after 300s and are single-use.

WAF / attack coverage

Shield WAF in request handlers detects SQLi, XSS, path traversal, and other common attacks.

Cloudflare Managed Ruleset and OWASP Core Ruleset (Pro+). A Free Managed Ruleset is available on all plans.

Rate limiting

Key on user ID, account, session, plan, or any computed value. Token-bucket budgets are set in application code.

Free: 1 rule, IP only, 10s max. Pro: 2 rules, 1min max. Business: 5 rules, 10min max. Enterprise: 100 rules. Non-IP keys: Enterprise Advanced Rate Limiting only.

Custom rulesNo per-project rule count limit; rules are code.

Free: 5. Pro: 20. Business: 100. Enterprise: 1,000. Log action: Enterprise only.

DDoS

Runs inside your application, so pair it with a network-layer DDoS provider.

Always-on L3/L4/L7 DDoS mitigation across all plans, including Free.

Agentic / non-HTTP

Checks on tool, MCP, and queue inputs: token spend, prompt injection, and sensitive-info. Bot detection is an HTTP control in request handlers.

WAF, Bot Management, Rate Limiting, and AI Gateway sit on inbound HTTP at the edge. They don't see tool calls, queued jobs, or fan-out work inside the application.

Local developmentSame behavior as production; inspect decisions in code.

WAF and bot rules apply only to traffic routed through Cloudflare.

AI agent runtime: what the edge can't see

Once you ship an agent, an MCP server, or a background pipeline, the risky work is often after the HTTP request. This comparison doesn't claim that Cloudflare is an agent-security product, and that work isn't inbound bot management (automated clients that target /login). Inbound bot management stays on HTTP controls – Cloudflare's edge bot products, and Arcjet in your request handlers.

Cloudflare's WAF, Bot Management, Rate Limiting, and AI Gateway all sit on inbound traffic. After a request is inside your application, a model can fetch a page and re-enter its context, a tool can burn tokens in a loop, or a queue job can send a support ticket to a third-party LLM with PII attached. None of those surface as a fresh HTTP request that the edge can rule on.

Arcjet runs prompt-injection detection, per-user token budgets, and in-process sensitive-info at those points. You pass the tool or job input directly. Bot detection is an HTTP control in request handlers. Labeled tool-call policies let a security team change the policy for a labeled action without changing the tool; that system is separate from site-wide HTTP remote rules. The SDK names those two surfaces protect() (HTTP request handlers) and guard() (tool calls and jobs).

When a security check can't finish (a timeout, a transport issue, or an incomplete policy), you choose what happens next. A direct Guard call returns allow with error codes rather than treating the incomplete check as a denial. Vercel AI SDK and LangChain wrappers fail closed unless you opt into continuing on error. HTTP request checks can fail open when your application can't reach Arcjet's cloud; that behavior is configurable. If you can't accept a check that didn't finish, then look at the error codes. For more information about the error codes, see the Guards reference. JavaScript, Python, and Go are the documented languages for that path; the Go SDK is pre-release.

A buyer question for any runtime control: can it use prior actions in a run when deciding the next one? A correlation ID ties Arcjet decisions to a run so that the sequence is reconstructable for investigation.

You can keep Cloudflare for DDoS, edge filtering, and AI Gateway caching or content moderation, and use Arcjet for the application-layer risks AI Gateway doesn't cover.

When to choose which

Choose Arcjet

Choose Arcjet if any of the following apply:

  • You want rules in application code.
  • You need per-user or per-plan logic that the edge can't see.
  • You aren't routing DNS through Cloudflare, or you might move hosts.
  • You want prompt-injection detection and per-user token budgets in the application.
  • You're shipping an agent, MCP server, or pipeline where the risky surface is after the HTTP request.
  • You want Shield WAF and advanced bot signals on a self-serve plan.

Choose Cloudflare

Choose Cloudflare if any of the following apply:

  • You need L3/L4/L7 DDoS mitigation.
  • You're already on Cloudflare and want zero-code network protection.
  • You want JA3/JA4 TLS fingerprinting as a rule condition (Enterprise Bot Management add-on).
  • You want a drop-in form widget (Turnstile).

Instant operational-rule changes aren't unique to the edge: Arcjet's dashboard and MCP update in-app HTTP rules immediately too.

In short: Cloudflare is the network and edge layer. Arcjet is the application layer, including the tool path. Many teams use both.

Compare: Vercel WAF vs Arcjet · CAPTCHAs vs Arcjet · All comparisons

Frequently asked questions

Can I use Arcjet and Cloudflare together?

Yes, and this is a common setup. Cloudflare operates at the network layer and Arcjet operates inside your application. Cloudflare handles DDoS mitigation and broad edge rules; Arcjet handles application-aware rules that depend on user identity, route context, and tool inputs. Arcjet works correctly behind Cloudflare’s proxy.

Does changing an Arcjet rule require a deploy?

Not for operational, site-wide HTTP rules. Those change in the Arcjet dashboard or via MCP and take effect immediately: country, ASN, IP, or VPN blocks; a global bot category; a temporary fixed-window or sliding-window rate limit; Shield WAF. They still enforce inside the application. App-specific rules stay in code: per-user token budgets, prompt injection, PII, and identity-keyed limits. Token-bucket budgets are set in application code. Tool-call policies are a separate labeled-action system.

How does Cloudflare AI Gateway compare to Arcjet AI runtime protection?

AI Gateway is a proxy in front of model providers. It caches responses, rate limits by request count, retries failures, produces analytics, moderates harmful content via Guardrails, and detects PII via DLP. Guardrails do not document prompt-injection or jailbreak detection, and the gateway has no per-user token-cost budget tied to your authenticated users. Cloudflare’s WAF AI Security for Apps (Enterprise paid add-on) can score inbound HTTP prompts for injection; that is still an edge HTTP control. Arcjet runs application-layer checks in your code, including on agent tool calls and jobs. Sensitive-information detection is a built-in local engine plus an optional on-device ML model. Bot detection stays on HTTP request handlers.

How does Cloudflare Turnstile compare to Arcjet?

Turnstile is a per-form CAPTCHA-replacement widget. Tokens are single-use and expire after 300 seconds, and the server must verify each submission. Arcjet advanced client signals collect browser-environment signals once, persist a cookie, and evaluate with server-side bot classification in your request handlers. See the CAPTCHAs vs Arcjet comparison.

Does Cloudflare WAF support per-user rate limiting?

Only on Enterprise with Advanced Rate Limiting. Cloudflare can key rate limits on headers, cookies, and body values, but mapping those to application users requires your application to emit an identifying header or cookie. Arcjet rate limiting is configured in code and can key on any value the application can compute. Token-bucket budgets stay in SDK configuration.

Does the Cloudflare WAF work in local development?

No. Cloudflare WAF rules only apply to traffic routed through Cloudflare’s network. Local development bypasses the WAF. Arcjet behaves the same in local development as in production.

What about agentic workloads with no HTTP request?

Cloudflare’s WAF, Bot Management, Rate Limiting, and AI Gateway sit on inbound HTTP at the edge. They do not see tool calls, queued jobs, or fan-out work inside the application. Arcjet can run token-spend budgets, prompt-injection detection, and in-process sensitive-info at those points. Bot detection is an HTTP control in request handlers. When a check cannot finish, a direct Guard call returns allow with error codes. Vercel AI SDK and LangChain wrappers fail closed unless you opt into continuing on error. HTTP request checks can fail open when Arcjet's cloud cannot be reached; that is configurable. If you cannot accept a check that did not finish, look at the error codes. A correlation ID ties Arcjet decisions to a run so the sequence is reconstructable for investigation. See the Guards reference.

Application security in your request handlers

Get Shield, bots, and rate limits in the app

Arcjet runs inside your application: identity-keyed rules in request handlers, plus checks on tool calls the edge never sees.