Bot Prevention
Menu

Operate

Configure protection

Change what is protected, switch between monitoring and protection, and tune limits. Every setting is a CloudFormation parameter of your stack.

Change a setting

  1. Open your stack

    In CloudFormation in us-east-1, select the stack wid-<installation ID>.

  2. Update with the existing template

    Choose Update, then Use existing template. Change only the parameters that you want to change and keep all others.

  3. Submit

    Acknowledge IAM resource creation, submit, and wait for UPDATE_COMPLETE. CloudFront can take a few more minutes to apply the change everywhere.

With the setup script, edit .wid/customer.json, then run plan and apply.

Monitor or protect

Rollout selects the mode. With enforce, flagged visitors without a session must verify, and Bot Control blocks bots that identify themselves and that AWS cannot verify, such as HTTP libraries and non-browser user agents, and requests from data centers that bots typically use. AI bots are only labeled. With count, nobody is challenged or blocked, and AWS WAF counts the requests that it would flag or block.

Before you enforce, check the Bot Control metrics in count for your own API clients, apps, webhooks and monitors that identify themselves as bots. Add an Allow rule to your Web ACL for each one that you want to keep. Your rules run before the World ID rules, so allowed requests are neither blocked nor challenged.

Bot Control needs about 5 minutes of traffic for session-based labels, and up to 24 hours for coordinated-activity labels. To see what it detects before you enforce, run in count for at least a day. Changing the mode does not revoke existing sessions.

Always-verified paths

AlwaysVerifiedPaths names the paths where every visitor without a session must verify, in addition to the requests that Bot Control labels.

To verifyAlwaysVerifiedPaths
Only requests that Bot Control labelsEmpty
/account and everything below it/account
/account and /checkout/account,/checkout
The whole website*
  • A path includes its subpaths: /account includes /account/settings, but not /accounting.
  • Matching ignores letter case. Enter the paths in lowercase.
  • Enter up to eight paths, separated by commas, without spaces and without a trailing slash. Paths can contain letters, digits and - . _ ~.
  • The /__wid/* routes are never challenged. Always-verified paths also apply to static files, which Bot Control does not inspect.

AWS WAF script

Most Bot Control labels need the aws-waf-token cookie, which the AWS WAF script sets in the browser. With SdkInjection=true, the stack turns on AWS WAF's automatic script insertion for your Web ACL, and CloudFront adds the script to your HTML pages. This affects the whole Web ACL:

  • CloudFront fetches responses uncompressed from your origin and removes Range headers.
  • Your Content Security Policy must allow https://*.awswaf.com in script-src and connect-src.
  • Cache behaviors with origin-event Lambda@Edge functions or Origin Shield do not get the script.
  • HTML pages already in the CloudFront cache get the script when they expire, or when you invalidate them.

Set SdkInjection=false if your pages already load the AWS WAF script. The stack then leaves this setting of the Web ACL unchanged.

Credential

Credentials selects what visitors prove: proof_of_human (Proof of Human) or selfie (Proof of Presence | Selfie Check). Contact the World ID team to enable Selfie Check for your app before you choose it.

Session length

WindowSeconds sets the session length and the uniqueness window, from 600 to 86400 seconds (24 hours, the default). A shorter window makes visitors verify more often, and each new verification is billed. After a change, visitors who already verified can verify again at once, because the new window has new actions.

Rate limits and capacity

ParameterDefaultLimits
ApiRate5000Verification API requests per IP address in 300 seconds. Visitors behind one IP address, such as a company network, share it.
VerifyRate100Proof submissions per IP address in 60 seconds. Stops a few addresses from using up the shared budget.
RequestsPerMinute1200Proof verifications per minute for the whole installation. More get HTTP 429 and raise the VerifyRefused alarm. It is not a billing cap.
ApiConcurrency0Reserved Lambda concurrency for the verification API. 0 reserves none.

Size RequestsPerMinute for your peak verification traffic. Raise VerifyRate only if many visitors share one IP address. AWS WAF rate limits are approximate.

Alarms

Set NotificationEmail to receive the ApiErrors and VerifyRefused alarms, then confirm the SNS subscription email from AWS.

Add a hostname

The verification API accepts only the hostnames of your distribution. After you add an alias to the distribution, update the stack with a new HostsRevision value, any 64-character hexadecimal string, before you send traffic to the new hostname. The setup script does this on every plan.

Terminal

openssl rand -hex 32

View traffic metrics

  1. Find your Web ACL

    In the stack's Outputs, note WebAclName and open TrafficMetricsUrl, or open AWS WAF.

  2. Open the dashboard

    Choose Global (CloudFront), select the Web ACL and open Traffic overview. In monitor-only mode, choose Switch to count action in the Top 10 rules pane.

The FlagByLabel rule of the rule group named by RuleGroupName counts the requests that match your policy, including requests with a valid session. It is not a count of challenges or unique visitors. Metrics can take a few minutes to appear.

Settings reference

The CloudFormation console shows the parameters in this order. The setup script stores the same settings in .wid/customer.json.

Console labelParameterDefaultValues
RP signing key ARNRpSigningKeyArnnoneECC_SECG_P256K1 KMS key ARN in us-east-1
Credential that visitors verify withCredentialsproof_of_humanproof_of_human or selfie
CloudFront distribution IDDistributionIdnoneDo not change after installation
Web ACL ARN (optional)WebAclArnemptyEmpty creates a Web ACL. Do not change after installation
After installationRolloutenforceenforce or count
Always-verified paths (optional)AlwaysVerifiedPathsemptyEmpty, *, or up to eight paths such as /account,/checkout
Insert the AWS WAF scriptSdkInjectiontruetrue, or false if your pages load it
Alarm email (optional)NotificationEmailemptyEmail address for alarms
Session lifetime in secondsWindowSeconds86400600 to 86400
API requests per IP address in 5 minutesApiRate500010 or more
Proof submissions per IP address per minuteVerifyRate10010 or more
Verifications per minute for the installationRequestsPerMinute12001 to 1000000
Reserved API concurrencyApiConcurrency00 to 1000
IAM permissions boundary (optional)PermissionsBoundaryArnemptyIAM policy ARN for the execution roles
World ID environmentWorldIdEnvironmentproductionKeep production; sandbox accepts simulator proofs and blocks no bots
Hostname refresh valueHostsRevisioninitialA new 64-character hex value after you add a hostname
Attachment modeAttachmentModeautomaticDo not change after installation