
Defeat IP Rotation: Block Bots by JA4 at the WAF
WebDecoy now tracks bots as persistent actors and pushes a JA4 rule to your AWS WAF or Cloudflare, blocking rotating scrapers across every IP they use.
securityInvestigate AI scraper traffic with JA4: collect at a trusted TLS endpoint, decode a sample, document client labels, and correlate signals before enforcement.
JA4 fingerprinting helps detect AI scrapers by summarizing the TLS ClientHello produced by their network stack, independently of the User-Agent they claim. It is most useful for collection, correlation, mismatch detection, and layered scoring—not as standalone proof that a client is automated.
This guide walks through JA4: the modern successor to JA3, with a worked decode and a collection workflow you can adapt to your own traffic. Use it to connect a TLS observation to request behavior and a response you can verify.
Choose the page for your task: decode a JA4 value and look it up in the JA4 database, read the
cf.bot_management.ja4Cloudflare reference, learn safe WAF enforcement against rotating actors, or start with the short JA4 definition.
A useful investigation connects the TLS observation to what a request did on your site:
AI agents using an ordinary browser can share its TLS fingerprint. JA4 helps group connections and investigate inconsistencies; it does not reveal who is controlling the browser.
Before diving into JA4, understanding JA3 provides essential context. Developed by Salesforce in 2017, JA3 was the first widely-adopted TLS fingerprinting method.
JA3 creates a fingerprint from the TLS ClientHello message by concatenating five fields:
These values are joined with commas and hyphens, then MD5 hashed:
TLSVersion,Ciphers,Extensions,EllipticCurves,ECPointFormatsExample raw string:
771,4866-4865-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513-21,29-23-24-25,0MD5 hash:
ab768a652fce4cbffeb274a3d6382529JA3 served well for years but has significant limitations:
Collector consistency: Compare fingerprints produced with the same method and normalization. JA4 explicitly excludes GREASE values before counting and hashing; the full format reference documents those rules.
Extension order sensitivity: JA3 captures extension order, but browsers can reorder extensions without functional impact. This creates unnecessary fingerprint variance.
Transport coverage: JA4 defines client fingerprinting for TLS over TCP, QUIC and DTLS. Record the transport when comparing observations.
Impersonation: A client can imitate another TLS stack. A matching fingerprint alone cannot establish that its requests are legitimate.
These limitations motivated the development of JA4.
JA4 was released in 2023 by FoxIO to address JA3’s shortcomings. It represents a fundamental rethinking of TLS fingerprinting methodology.
JA4 is actually a suite of fingerprinting methods:
| Fingerprint | Target | Use Case |
|---|---|---|
| JA4 | TLS ClientHello | Primary client identification |
| JA4S | TLS ServerHello | Server configuration analysis |
| JA4H | HTTP headers | Application-layer fingerprinting |
| JA4X | X.509 certificates | Certificate chain analysis |
| JA4T | TCP parameters | Network stack identification |
| JA4SSH | SSH handshake | SSH client fingerprinting |
For AI scraper detection, JA4 and JA4H are the most relevant.
Unlike JA3’s opaque MD5 hash, JA4 uses a human-readable format with three sections:
[protocol][version][SNI][cipher_count][extension_count][ALPN]_[cipher_hash]_[extension_hash]A format example looks like:
t13d1516h2_8daaf6152771_b0da82dd1658Breaking this down:
Section 1: t13d1516h2
t - TCP (vs q for QUIC)13 - TLS 1.3d - SNI extension present (vs i when absent)15 - 15 cipher suites offered16 - 16 extensions presenth2 - HTTP/2 ALPN (Application-Layer Protocol Negotiation)Section 2: 8daaf6152771
Section 3: b0da82dd1658
0x0000) and ALPN (0x0010) are excluded from this hash, since both already appear in section 1Full field reference: every character position, the GREASE and empty-list rules, the raw
JA4_rvariant, and the Cloudflarecf.bot_management.ja4field are documented in JA4 Fingerprint Format.
JA4 removes GREASE values and sorts the cipher and extension lists used for hashing. This makes the result less sensitive to list reordering. Its readable prefix lets you inspect the transport, offered TLS version, SNI flag, counts and ALPN representation. See FoxIO’s JA4 specification for the precise algorithm.
Normalization improves correlation. It does not prevent a client from using a real browser or imitating another TLS stack.
A durable lookup needs a documented observation. Labels such as “Playwright,” “Browserbase” or “Python requests” should come from controlled captures with the exact client version, TLS library, configuration and network path recorded.
| Client you are investigating | Evidence to retain |
|---|---|
| Browser driven by an AI agent | Browser build, launch settings, automation setup and observation point |
| Hosted browser session | Service configuration, browser build and proxy path used in the capture |
| Python, curl, Go or Node client | Client and TLS-library versions, options, and offered protocols |
| Visitor traffic | Collector, timestamp, requested route and supporting signals |
These categories are capture plans, not a list of fingerprints that identify those clients. The same JA4 can appear in legitimate and abusive traffic. A library or browser update can also change the value you observe.
Here is a practical architecture for security teams implementing JA4-based detection.
Collect at a point that can see the relevant ClientHello or supplies a fingerprint computed from it. Record which connection the value describes.
NGINX: the standard ssl_preread module exposes protocol, SNI and ALPN information without terminating TLS. Enabling it does not by itself produce JA4: those variables do not supply the complete ordered lists needed by the algorithm. Use a JA4-capable collector or module and verify its output with traffic you control. See FoxIO’s implementations for available tooling.
Cloudflare: cf.bot_management.ja4 is documented for Enterprise customers with Bot Management. Handle an absent fingerprint; it is not evidence that the request is human or a bot. The Cloudflare JA4 guide covers the field and collection path, and Cloudflare’s documentation describes availability and missing values.
Origin applications: a forwarded header is trustworthy only when your trusted ingress computes or supplies it and prevents visitors from injecting their own value. A header called X-JA4 is not evidence of a captured handshake by itself. Confirm the origin’s access path and header handling before using it for a verdict.
Maintain a corpus that maps fingerprints to clients you have identified through controlled capture or other documented evidence:
CREATE TABLE tls_fingerprints (
id SERIAL PRIMARY KEY,
ja4 VARCHAR(50) NOT NULL,
ja4h VARCHAR(100),
client_name VARCHAR(100),
client_version VARCHAR(50),
is_browser BOOLEAN DEFAULT FALSE,
is_automation BOOLEAN DEFAULT FALSE,
is_known_bot BOOLEAN DEFAULT FALSE,
threat_score INTEGER DEFAULT 0,
first_seen TIMESTAMP DEFAULT NOW(),
last_seen TIMESTAMP DEFAULT NOW(),
occurrence_count INTEGER DEFAULT 1,
notes TEXT
);
-- Index for fast lookups
CREATE INDEX idx_ja4 ON tls_fingerprints(ja4);
CREATE INDEX idx_ja4h ON tls_fingerprints(ja4h);
-- Populate this table from your own documented captures.
-- Keep capture source, software version and observation time with each label.The schema is a starting point, not a threat-intelligence feed. An is_automation label describes a captured client; it does not establish that every request sharing the fingerprint is abusive. The lookup and decoder explains the readable fields and reports the hash sections without assigning a client identity.
Use JA4 to assemble an investigation group. Then evaluate the evidence for the action you protect. This is a workflow outline, not executable detection code or a calibrated scoring model:
Trusted collector supplies JA4
-> validate its format and retain the collection source
-> group requests sharing the value
-> compare paths, timing, outcomes and available browser/decoy signals
-> inspect legitimate traffic that shares the fingerprint
-> choose a scoped response based on corroborating evidence
-> review outcomes and keep a rollback pathLow cipher counts, TLS versions or a particular ALPN value alone do not establish abuse. Calibrate any threshold against your actual clients. A User-Agent mismatch also needs a documented baseline, since proxying or a stale client label can explain a difference.
Record the timestamp, collector, JA4, requested route, decision, rule version and supporting signals. Include a client label only with its source and observation date. Keep raw traffic and visitor identifiers within your normal access and retention controls.
When reporting to a SIEM, separate “fingerprint observed,” “automation signal recorded” and “request blocked.” A monitored detection does not establish that enforcement occurred.
The queries below assume your own access_logs table and a known_chrome_fingerprints baseline built from documented captures. They illustrate investigation queries, not a drop-in detector.
Step 1: Extract fingerprints from logs
This example assumes your collector already writes a ja4= field. It does not add JA4 collection to NGINX.
# Parse nginx logs for JA4 data
grep "ja4=" /var/log/nginx/access.log | \
awk -F'ja4=' '{print $2}' | \
cut -d' ' -f1 | \
sort | uniq -c | sort -rn | head -20Step 2: Identify anomalous patterns
-- Investigation candidates absent from your observed Chrome baseline.
-- This query does not classify them as bots.
SELECT
ja4,
user_agent,
COUNT(*) as requests,
COUNT(DISTINCT source_ip) as unique_ips
FROM access_logs
WHERE user_agent LIKE '%Chrome%'
AND ja4 NOT IN (SELECT ja4 FROM known_chrome_fingerprints)
GROUP BY ja4, user_agent
ORDER BY requests DESC;Step 3: Cross-reference with your observed corpus
-- Match against automation fingerprint database
SELECT
l.ja4,
l.user_agent,
k.client_name as observed_client_label,
COUNT(*) as request_count
FROM access_logs l
JOIN tls_fingerprints k ON l.ja4 = k.ja4
WHERE k.is_automation = TRUE
GROUP BY l.ja4, l.user_agent, k.client_name
ORDER BY request_count DESC;Start with the route and behavior you need to protect. Inspect matching requests in monitoring first, including legitimate clients that share the JA4. Require corroborating evidence before selecting a block or challenge in the system responsible for that response.
Avoid copying a public fingerprint into a global deny rule. For current Cloudflare fields, plan requirements and scoped expressions, use the Cloudflare JA4 reference. For WebDecoy’s actor-level response workflow and safeguards, see JA4 WAF enforcement for rotating actors.
Track these JA4-related metrics:
Cloudflare customers encounter JA4 through cf.bot_management.ja4. Cloudflare currently documents the field for Enterprise zones with Bot Management, including Ruleset Engine expressions and request.cf.botManagement.ja4 in Workers. The field can be missing when Bot Management cannot calculate it, so production code must handle an absent value.
This guide does not duplicate the vendor-specific configuration:
Keeping those tasks on their canonical pages lets this practical guide stay focused on collection, detection logic, observed corpora, and evasion.
A browser driven by an agent can produce the same TLS handshake as a visitor using that browser. TLS impersonation and proxies can further change what the collector observes. Keep the fingerprint’s collection point and baseline visible in the investigation.
Combine request-level observations with the browser and decoy signals available in your installation. Each sensor has different coverage: a browser script only observes clients that execute it, while an edge or origin collector sees the requests that reach that layer.
JA4 can complement Cloudflare’s controls and WebDecoy’s application-level observations. Neither a database label nor a matching hash is a universal AI-agent verdict.
See the workflow before installing: decode a sample JA4 and watch a controlled detection demo. The recording shows a WordPress canary probe in monitor mode, not JA4 collection. Choose WordPress, Shopify, or a custom-site installation beside the demo. For Node.js, follow the Express setup guide and verify your integration before enabling enforcement.
WebDecoy can use JA3 and JA4 alongside other detection signals (it does not compute JA4H). Where WebDecoy terminates TLS itself, as on decoy domains, JA4 is computed from the raw ClientHello. The Node.js SDK cannot see the ClientHello (Node does not expose it), so it does not generate JA4 on its own: if a reverse proxy or CDN in front of your app computes JA4 and forwards it in a header, the SDK’s detection engine reads it from the headers you list in trustedJA4Headers.
Detection flow:
Request → TLS Handshake → Extract JA4
↓
Compare against database
↓
Cross-reference with User-Agent
↓
Add to threat score
↓
Combine with behavioral signals
↓
Verdict: allow or block (enforce mode)What to investigate:
Middleware fragment for an existing Express app:
import { webdecoy } from '@webdecoy/express';
app.use(webdecoy({
apiKey: process.env.WEBDECOY_API_KEY,
mode: 'monitor', // inspect detections before enabling enforcement
}));Start with a fingerprint from a trusted collector, decode its fields, and compare the matching traffic with your application’s behavior. Retain the evidence behind client labels and verify a scoped response against legitimate traffic before enforcement.
For a visible next step, try the decoder and controlled WebDecoy detection demonstration. The demonstration shows a labeled canary probe in monitoring; it does not demonstrate collecting JA4 or identify real visitors as AI agents.
Ready to add JA4 detection to your security stack?
Explore WebDecoy’s bot scanner or Node.js SDKs to see how JA4 becomes one signal in a layered bot verdict, then start free. Available evidence depends on your installed sensors; notifications and blocking depend on the response actions and mode you choose.
Questions about implementing JA4 analysis? Read our documentation or contact us directly.
Related Resources:
From a fingerprint to an investigation
Use WebDecoy to inspect the bot activity your integration observes: detection signals, request context and the actions behind suspicious traffic. Start in monitor mode and check the evidence before choosing a response.
To correlate activity by JA4, your TLS endpoint or trusted proxy must supply the fingerprint. A browser script or WordPress plugin alone cannot capture the TLS ClientHello.

WebDecoy · Bot detection and protection
Install for your stack, confirm it reports, then inspect your own traffic. Available evidence depends on the integration and collection layer.

WebDecoy now tracks bots as persistent actors and pushes a JA4 rule to your AWS WAF or Cloudflare, blocking rotating scrapers across every IP they use.
security
How browser fingerprinting works, what privacy protections change, and how to combine canvas, WebGL and JA4 signals in a bot detection system.
securityFollow verified HexStrike AI model-tool activity from the Node SDK through ingest validation to two explainable correlation findings.
securityLike this post? Share it with your friends!
Get a personalized demo from our team.