Cloudflare has introduced Precursor, a system that continuously analyzes how a visitor behaves within a web application to distinguish between a human and a bot or automated agent. Instead of judging each request individually or verifying the user only during login, this technology builds a comprehensive view of the entire session.
The product uses JavaScript injected by Cloudflare to observe signals such as mouse movement, keyboard usage pace, focus changes, and the duration the page remains visible. This data is processed on the company’s perimeter servers and incorporated into their bot scoring, security rules, and decisions on when to present a challenge.
Cloudflare Precursor: the key points in 20 seconds
- Analyzes behavior throughout the entire session, not just a single request.
- Uses a small script added to HTML responses by Cloudflare.
- Gathers mouse movements, keyboard activity, focus, and visibility signals.
- Cloudflare claims it records typing rhythm but not individual keystrokes.
- Data is periodically sent to their infrastructure for evaluation.
- Accumulated information can modify the session’s bot score.
- Updates the status stored in the
cf_clearancecookie. - Can re-verify a user who has already passed a challenge.
- Complementary to Turnstile and replaces JavaScript Detections when activated.
- Available for Enterprise Bot Management clients and will be free until its general release later in 2026.
Precursor aims to close a vulnerability of current systems. An advanced bot can run JavaScript, control a real browser, and behave correctly during the brief moment a CAPTCHA appears. Maintaining credible behavior over several minutes—browsing pages, filling forms, reacting to various elements—is considerably more difficult.
Cloudflare states that it analyzes over a trillion requests daily through its network, and Turnstile is executed approximately 3 billion times each day. These figures, communicated by the company itself, demonstrate the scale of data used to train and fine-tune their detection mechanisms.
From point-in-time checks to session behavior profiling
Traditional systems often make decisions based on a specific action: a visitor opens a page, logs in, creates an account, or completes a purchase. At that moment, signals like IP address, headers, device reputation, browser, and others are evaluated.
While effective against simple automation, this approach provides a very short snapshot. An attacker can prepare the browser to pass the test and continue malicious activity afterward—exfiltrating content, testing credentials, reserving products, creating fake accounts, or automating purchases.
Precursor transforms this snapshot into a sequence. The system checks if actions maintain human-like coherence throughout the visit and cross-references signals. For example, it can verify whether mouse movement matches the time the tab was visible or if keyboard activity occurred while a text field was focused.
Cloudflare uses mouse movement to explain the difference. Automation libraries can add random noise, pauses, or curves to avoid perfectly straight trajectories. However, human movements are influenced by wrist motion, small corrections, physiological tremors, and the time it takes for a person to interpret on-screen information.
A bot can generate an apparently natural Bézier curve in a single action. But imitating the variation in speed, direction, accuracy, and response times over an entire session is much harder. Excessive repetition, overly precise clicks, or constant return to the same point may reveal automated behavior.
How Precursor works
| Stage | System action |
|---|---|
| Injection | Cloudflare adds a JavaScript package to HTML responses |
| Collection | The browser records interaction signals via lightweight events |
| Temporary storage | Events are compressed and stored in memory |
| Sending | Information blocks are periodically sent to the edge |
| Evaluation | Multiple analyzers cross-reference the received signals |
| Integration | Results update the session state |
| Response | The bot score, WAF, and challenges can act based on this context |
The package is dynamically generated, obfuscated, and doesn’t require the website owner to manually insert third-party libraries. As HTML responses pass through Cloudflare, the platform embeds the code before delivering it to the browser.
This operational convenience means the product can be activated from the dashboard without modifying the application. However, it also depends on the page passing through Cloudflare’s network and allowing script execution.
Precursor does not cover all forms of automated traffic. A client calling directly to an API without loading HTML or executing JavaScript won’t generate the same signals. Protection still relies on network analysis, rate limiting, authentication, reputation, WAF rules, and specific abuse controls.
Implications for Cloudflare administrators
Documentation outlines two modes: Minimize Friction, enabled by default, attempts to keep sessions in the background without showing an intermediate page. It reduces interruptions, though Cloudflare acknowledges it cannot guarantee all sessions are fully verified.
Maximize Security mandates a light challenge when there’s no valid session yet. It provides a stricter check but may cause a noticeable pause for the user. Cloudflare recommends this when prioritizing complete verification of all sessions.
Rules can apply different policies based on the zone. For example, a store might use the less intrusive mode on catalogs but enforce stricter verification on /checkout. Similarly, login, registration, and pages handling personal data could be more rigorously protected.
The session state ties into the cf_clearance cookie, which indicates that a browser has passed certain checks. Precursor can reduce or invalidate this authorization, trigger a new challenge, and re-evaluate the visitor during the session. Refreshing the page isn’t enough to immediately reset the accumulated behavior.
Precursor doesn’t replace Turnstile. Turnstile verifies specific moments like form submissions or purchases, while Precursor maintains session-wide assessment. Their combination allows for rechecking a seemingly legitimate session if its behavior changes.
Precursor also replaces the previous JavaScript Detections feature, which performed point-in-time browser checks. Cloudflare recommends disabling it when Precursor is active to prevent overlap.
Results are shown in Security Analytics, where the company now emphasizes session-based views. Teams can see typical browsing paths, where visits deviate, and which signals suggest automation.
This information also influences the bot score, ranging from 1 to 99: lower values suggest higher automation probability, higher values indicate human traffic. Users can incorporate this score into WAF rules to permit, challenge, or block requests. The detailed scoring is reserved for organizations with Enterprise Bot Management.
Privacy concerns and false positives will be the most delicate testing points
Precursor introduces continuous telemetry collection in the browser, so privacy considerations are critical for companies to review before deployment.
Cloudflare states that it doesn’t record keystrokes or their content—only timing and rhythm. It also claims signals are analyzed as aggregate patterns, not linked to accounts, login identities, or persistent profiles, and aren’t directly accessible via client dashboards.
While this reduces data sensitivity, it doesn’t make data collection irrelevant from a legal or privacy standpoint. Administrators should understand what data is sent, how long it’s stored, where it’s processed, and what documentation they need to provide users per jurisdiction.
Cloudflare’s documentation notes that Bot Analysis incorporates behavioral and biometric detections from Precursor. However, it doesn’t specify whether “biometric” refers to an internal technical category or has legal implications under regulations like GDPR. Clarification is advisable before deploying in highly regulated sectors.
False positives must also be evaluated, as not all users interact similarly. Movements can vary due to touchscreens, trackpads, assistive technologies, remote desktops, or adapted devices. Users may navigate via keyboard, keep tabs in background, or complete forms using password managers.
Legitimate automation might appear malicious, and well-designed systems can learn to mimic pauses, errors, and realistic paths. The detection shouldn’t be seen as definitive proof but rather as an additional signal within a broader security policy.
Cloudflare believes that having session context improves accuracy and reduces challenges presented to legitimate users. No public detection rates, false positive metrics, or independent comparisons have been published yet to quantify this benefit.
What a company should test before activation
| Test | Reason |
|---|---|
| Mousing, keyboard, and touch interactions | Detect device differences |
| Screen readers and assistive tech | Ensure accessibility |
| Password managers and autofill | Test rapid form completion |
| Remote desktops and high-latency networks | Identify patterns that may seem artificial |
| Enterprise clients with scripts | Distinguish authorized automation |
| Checkout and login pages | Measure conversion and abandonment rates |
| Different countries and browsers | Assess behavior and legal requirements |
| Observation mode before enforcement | Analyze results without blocking traffic |
Bot detection remains a cat-and-mouse game. The more emphasis placed on movement, pauses, and navigation patterns, the more incentive automation developers have to simulate those behaviors.
Precursor raises the bar, since surpassing a single control is no longer enough. The bot must maintain a convincing persona throughout the journey, react to changes, and avoid large-scale repetitive patterns. It’s not impossible, but it requires more sophisticated browsers, greater resource usage, and better-behaved models.
This approach shifts security from just HTTP requests to the overall user experience. It can enhance protection against fraud, scraping, account hijacking, and agents operating browsers, but also demands more attention to privacy, accessibility, and transparency regarding automated decisions.
Frequently Asked Questions
What is Cloudflare Precursor?
A detection system that analyzes browser signals throughout an entire session to differentiate human traffic from bots and automated agents.
Does it log keystrokes?
Cloudflare states it captures only timing and rhythm data, not specific keystrokes or written content.
Does Precursor replace Turnstile?
No. Turnstile verifies at specific points; Precursor extends assessment over the whole session. It does replace the previous JavaScript Detections feature when activated.
Is it available to all Cloudflare customers?
Precursor is part of Enterprise Bot Management. Deployment began in July 2026 and it will be free until its general release later that year.
via: blog.cloudflare
