Skip to main content
Foil detects AI-controlled browsers, stealth automation, and anti-detect tools by combining hundreds of signals collected in the browser with server-side cross-validation. The browser never sees the results — your backend makes the decisions.

The pipeline

1

Load the SDK

Your page imports t.js and calls Foil.start(). The SDK opens an encrypted session and begins collecting signals immediately.
2

Collect signals

The SDK runs environment probes, fingerprinting, and behavioral observation. All data is encrypted and streamed to Foil’s servers in real time.
3

Freeze the fingerprint

Once enough data is collected, the SDK freezes a durable device fingerprint. The browser learns that fingerprinting is ready, but never receives the fingerprint itself.
4

Get a session handoff

When the user performs a sensitive action, your code calls getSession(). Foil flushes pending observations, evaluates the session, and returns { sessionId, sealedToken }.
5

Verify on your backend

Your server verifies the sealed token (locally, no network call) or fetches the full session from the API. Then it applies your policy.

What gets scored

Foil combines 350+ signals across seven scoring categories, with a server-side anti-tamper layer that cross-validates them:
CategoryWhat it detectsExamples
EnvironmentAutomation frameworks, headless browsersnavigator.webdriver, Playwright globals, stealth artifacts
FingerprintSpoofed or manipulated device profilesWebGL anomalies, canvas noise, anti-detect patterns
Event trustSynthetic vs real user eventsisTrusted === false, clicks without mousemove
MouseAutomated mouse movementLinear paths, teleported cursor, Fitts’ Law violations
KeyboardAutomated typingUniform timing, paste-only input, missing rollover
TimingInhuman speed patternsSub-50ms first interaction, >800 CPM form entry
TouchSynthetic touch eventsOn mobile: speed variance, multi-touch ratios
On top of the seven scored categories, anti-tamper runs server-side: it compares client claims against signals the browser can’t forge — UA vs TLS (JA4) fingerprint, HTTP headers vs JS claims — and feeds the result back into scoring.

Why scoring is server-side

Foil intentionally keeps all scoring logic off the browser:
  • Thresholds stay server-side — nothing in the browser reveals scoring logic
  • Observations are encrypted — binary payloads, not readable JSON
  • Server cross-validates — compares browser claims against TLS fingerprint, IP context, and request headers
  • The browser never sees results — no verdicts, scores, or visitor IDs leak to the page
  • Your backend is the policy point — you decide what to do, not the browser

Evaluation phases

PhaseWhen it runsWhat it usesConfidence
SnapshotImmediatelyEnvironment, fingerprint, anti-tamperCatches obvious automation fast
BehavioralAfter user interactionMouse, keyboard, touch, timingHigher confidence for ambiguous sessions
Most sessions get a snapshot result within 200ms of getSession(). If the user has interacted with the page, the behavioral phase adds significantly stronger signals.

What’s next