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.ja4 Cloudflare reference, learn safe WAF enforcement against rotating actors, or start with the short JA4 definition.

Start with a JA4 investigation

A useful investigation connects the TLS observation to what a request did on your site:

  1. Confirm where TLS was observed. Record the collector and whether it sees the visitor connection or a proxy connection.
  2. Decode the value. Open this sample in the free JA4 decoder, then replace it with a value from your own logs. The sample demonstrates the format; it has no client or threat label.
  3. Check the evidence behind a database match. Keep the capture date, software version and source beside any label. An unfamiliar hash is an investigation lead.
  4. Correlate requests. Compare paths, rates, responses and other available detection signals for the group sharing that fingerprint.
  5. Observe before enforcing. Check ordinary visitors and legitimate automation against a scoped rule, with a rollback path.

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.

JA3: The Foundation

Before diving into JA4, understanding JA3 provides essential context. Developed by Salesforce in 2017, JA3 was the first widely-adopted TLS fingerprinting method.

How JA3 Works

JA3 creates a fingerprint from the TLS ClientHello message by concatenating five fields:

  1. TLS Version (2 bytes) - The protocol version offered
  2. Cipher Suites (variable) - Encryption algorithms in preference order
  3. Extensions (variable) - TLS extensions in order
  4. Elliptic Curves (variable) - Supported key exchange curves
  5. EC Point Formats (variable) - Elliptic curve point format support

These values are joined with commas and hyphens, then MD5 hashed:

TLSVersion,Ciphers,Extensions,EllipticCurves,ECPointFormats

Example 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,0

MD5 hash:

ab768a652fce4cbffeb274a3d6382529

JA3 Limitations

JA3 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: Next-Generation TLS Fingerprinting

JA4 was released in 2023 by FoxIO to address JA3’s shortcomings. It represents a fundamental rethinking of TLS fingerprinting methodology.

The JA4 Family

JA4 is actually a suite of fingerprinting methods:

FingerprintTargetUse Case
JA4TLS ClientHelloPrimary client identification
JA4STLS ServerHelloServer configuration analysis
JA4HHTTP headersApplication-layer fingerprinting
JA4XX.509 certificatesCertificate chain analysis
JA4TTCP parametersNetwork stack identification
JA4SSHSSH handshakeSSH client fingerprinting

For AI scraper detection, JA4 and JA4H are the most relevant.

JA4 Structure

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_b0da82dd1658

Breaking this down:

Section 1: t13d1516h2

  • t - TCP (vs q for QUIC)
  • 13 - TLS 1.3
  • d - SNI extension present (vs i when absent)
  • 15 - 15 cipher suites offered
  • 16 - 16 extensions present
  • h2 - HTTP/2 ALPN (Application-Layer Protocol Negotiation)

Section 2: 8daaf6152771

  • Truncated SHA256 of the cipher suite list, sorted in hex order

Section 3: b0da82dd1658

  • Truncated SHA256 of the sorted extension list joined to the signature algorithms, which are left in their original order
  • SNI (0x0000) and ALPN (0x0010) are excluded from this hash, since both already appear in section 1

Full field reference: every character position, the GREASE and empty-list rules, the raw JA4_r variant, and the Cloudflare cf.bot_management.ja4 field are documented in JA4 Fingerprint Format.

What normalization changes

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.

Building a client fingerprint corpus

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 investigatingEvidence to retain
Browser driven by an AI agentBrowser build, launch settings, automation setup and observation point
Hosted browser sessionService configuration, browser build and proxy path used in the capture
Python, curl, Go or Node clientClient and TLS-library versions, options, and offered protocols
Visitor trafficCollector, 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.

Building a JA4 Detection System

Here is a practical architecture for security teams implementing JA4-based detection.

Data collection: NGINX, Cloudflare and the origin

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.

Build an observed fingerprint corpus

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.

Correlate before choosing a response

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 path

Low 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.

Keep useful evidence in alerts

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.

Analysis Workflows for Security Teams

Investigating Suspicious Traffic

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 -20

Step 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;

Move from an observation to a scoped rule

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.

Reporting Dashboard Metrics

Track these JA4-related metrics:

  • Fingerprint diversity: Unique JA4 hashes per day
  • Mismatch rate: Requests where JA4 contradicts User-Agent
  • Corroborated detections: Requests with additional evidence, separated from fingerprint-only observations
  • New fingerprint alerts: Previously unseen JA4 hashes
  • Enforcement outcomes: Which scoped rules blocked requests, along with false-positive review and rollback results

Cloudflare implementation

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.

Limits when investigating AI agents

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.

WebDecoy’s JA4 Implementation

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:

  • A claimed client that differs from your documented handshake baseline
  • Shared fingerprints associated with repeated abuse on a particular route
  • Requests with supporting browser, rate or decoy evidence
  • Changes after a client, proxy or collector update

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
}));

Put the observation to work

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

Decoded the fingerprint? See what those requests do on your site.

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 WordPress detection log from a controlled WooCommerce lab, showing test detections with scores, sources and user agents.
Actual WebDecoy lab capture: controlled WordPress and WooCommerce tests. This illustrates the detection log, not JA4 collection or a production detection rate.
Watch the 20-second controlled canary demo ↗

WebDecoy · Bot detection and protection

Choose your installation guide.

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

Want to see WebDecoy in action?

Get a personalized demo from our team.

Request Demo