Skip to main content

Protections are defenses that Clerk builds and maintains, and that you can turn on for your application. Each one targets a specific kind of abuse, such as sign-ups from cloud servers or disposable email addresses.

How protections work

  • Each protection applies to specific steps. Some apply to sign-ups, some to sign-ins, and some to both. A few also apply when a user adds an email address. The Applies to column in Available protections shows which.
  • Each protection takes one kind of action. Most block or challenge the attempt. Others reject an email address. The Action column shows which.
  • Most are off until you turn them on. These protections are on by default:
  • Clerk also rate-limits sign-up and sign-in requests on every plan. Each IP address can only start so many sign-ups and sign-ins, and submit so many passwords and codes, in a short time. These limits aren't a protection you manage. See Frontend API requests.

Available protections

Each protection's page lists what it requires. See pricing.

Included on every plan

ProtectionWhat it doesApplies toAction
Challenge suspicious sign-upsChallenges sign-ups that look automated or come through VPNs, Tor, or proxies.Sign-upsChallenge
Require Device Intelligence checksBlocks a sign-up created by a browser that has no verified Device Intelligence result.Sign-upsBlock
Require a minimum ClerkJS versionBlocks sign-ups and sign-ins from ClerkJS versions older than the minimum you set.Sign-ups and sign-insBlock
Block email subaddressesRejects an email address that adds a subaddress to one that already has an account, such as user+1@example.com.Sign-ups and adding an email addressReject email address
Block disposable email addressesRejects email addresses known to be disposable.Sign-ups and adding an email addressReject email address

Included on Pro or higher

The Blocklist, shown as Block account identifiers in the Dashboard, requires Pro or higher.

Included in the Business plan

The following advanced protections require the Business plan:

ProtectionWhat it doesApplies toAction
Block sign-ups from suspicious network typesBlocks sign-ups from VPNs, Tor, proxies, and hosting networks.Sign-upsBlock
Challenge residential proxiesChallenges sign-ups that come through residential proxies.Sign-upsChallenge
Block sign-ups by countryBlocks sign-ups by country, using a blocklist or an allowlist.Sign-upsBlock
Limit sign-ups per IP addressBlocks sign-ups from an IP address when it exceeds your hourly limit.Sign-upsBlock
Limit sign-ups from shared infrastructureBlocks sign-ups that appear to use the same infrastructure when they exceed your hourly limit.Sign-upsBlock
Limit sign-ups per email domainBlocks sign-ups from an email domain when it exceeds your hourly limit.Sign-upsBlock
Block risky email domainsBlocks sign-ups from email domains that Clerk rates as risky.Sign-upsBlock

Protections that block or challenge

The guidance below applies to protections that Block or Challenge an attempt. For protections with other actions, see their individual guides for when they apply and what users see.

When protections check an attempt

  • Sign-ups through your application are checked. These protections don't affect existing users' sign-ins, except Require a minimum ClerkJS version, which checks sign-ins too.
  • Users you create yourself aren't checked. These protections don't apply to users you create with the Backend API, in the Clerk Dashboard, or by importing them.
  • Automated tests aren't checked. A sign-up or sign-in that carries a valid Testing Token isn't checked by these protections, so end-to-end tests keep running.

What blocked users see

When a protection blocks a sign-up or sign-in, the attempt doesn't go through. What the user sees depends on where it's blocked and which versions of Clerk's SDKs your application runs:

  • Prebuilt components with @clerk/ui 1.36.0 or later and ClerkJS 6.34.1 or later show a screen explaining that the user can't continue, with a reference code. Core 3 SDKs load the latest versions automatically. The screen appears when the attempt is blocked on the first step, or when the user returns from a social or SSO provider.
  • A block at a later step, such as after the user enters a password or a verification code, shows a short error message instead of the full screen. So do older SDK versions.
  • In a , the request fails with an error whose code is action_blocked. See Error handling.

If a blocked user sends you the reference code from that screen, use it to find the decision behind it and see which protection or rule blocked them.

When a protection challenges an attempt instead, the user completes a verification step and then carries on.

When more than one protection matches

If more than one protection matches the same attempt, a block applies before a challenge.

Where decisions appear

Every block and challenge appears as a Protect event in Application Logs, so you can see what a protection is doing once it's on. When an event's payload has a trace_id, select the event to see the decision behind it, including the protection or rule that made it.

If you proxy Clerk's Frontend API

Several of these protections decide based on where an attempt comes from, so Protect needs each visitor's IP address. If you proxy Clerk's Frontend API through your own server, your proxy must send the visitor's IP address in the X-Forwarded-For header, as described in Configure your proxy server. Otherwise every attempt looks like it comes from your proxy, and those protections can block everyone or no one.

Manage protections in the Dashboard

In the Clerk Dashboard, under Protect, navigate to the Protections page. It has Basic and Advanced tabs. Basic includes protections on every plan, plus Block account identifiers (Blocklist) for Pro or higher. Advanced protections require the Business plan.

Protections you can manage show a Status. Most have a settings icon. Select it to enable a protection, change its settings, or disable it when supported. Block account identifiers has a chevron instead, which opens its page. Each protection is also tagged with what it does, such as Block, Challenge, or Rate limit, and the flows it applies to, Sign in or Sign up.

Without the Business plan, the Advanced tab shows its protections locked: select the lock icon on a protection, or the Upgrade button above them, to upgrade. Without the Pro plan, Block account identifiers shows an Upgrade button instead of opening its page. To test protections before you enable them in production, see Enable protections.

Feedback

What did you think of this content?

Last updated on