Challenge Settings
Challenges can be configured globally (via command-line flags) or per-rule (in the policy file).Global Configuration
2
Per-Rule Configuration
Challenge Parameters
Difficulty
Difficulty controls the number of leading zero bits required in the proof-of-work hash.| Field | Type | Range | Default |
|---|---|---|---|
difficulty | int | 0-64 | 2 |
- Too low (
< 0):ErrChallengeDifficultyTooLow - Too high (
> 64):ErrChallengeDifficultyTooHigh
Recommended Difficulty Levels
| Difficulty | Solve Time | Use Case |
|---|---|---|
| 0 | Instant | Development/testing only |
| 1 | < 100ms | Meta refresh challenges |
| 2 | ~200ms | Default for most traffic |
| 3 | ~500ms | Moderate suspicion |
| 4 | ~1s | High suspicion |
| 8 | ~10s | Extreme cases (use with care) |
| 16+ | Minutes | Effectively blocks all traffic |
Algorithm
Anubis supports multiple challenge algorithms:| Algorithm | Description | Client Support |
|---|---|---|
fast | SHA-256 proof-of-work | Modern browsers |
metarefresh | HTML meta refresh (no JavaScript) | All browsers |
preact | React-based challenge UI | Modern browsers |
slow | Deprecated SHA-256 (use fast instead) | Legacy |
fast
Challenge Methods
Fast (Recommended)
SHA-256 proof-of-work challenge using WebCrypto API:- Fast client-side computation
- No external dependencies
- Works in all modern browsers
- JavaScript enabled
- WebCrypto API support (all modern browsers)
Meta Refresh
HTML-only challenge using<meta http-equiv="refresh">:
- No JavaScript required
- Works in text browsers (lynx, w3m)
- Accessible to screen readers
- Lower difficulty only (recommend
difficulty: 1) - Slower user experience
- Cannot use client-side computation
- Accessibility requirements
- JavaScript-disabled environments
- Low-suspicion traffic
Preact
React-based UI with visual feedback:- Better user experience
- Progress indicators
- Error handling UI
- Modern JavaScript support
- Same as
fastalgorithm
Slow (Deprecated)
Legacy algorithm. Usefast instead:
slow is detected. Update to fast when possible.
Challenge Configuration Examples
Lightweight Protection
Standard Protection
Heavy Protection
Graduated Protection with Weights
Custom Status Codes
By default, challenges return HTTP 200 to deceive scrapers. You can customize this:Challenge Cookies
Successful challenge solutions are stored in cookies:Cookie Configuration
Cookie Names
Cookies are prefixed (default:anubis):
JWT Signing
Challenge solutions are signed with Ed25519 or HMAC-SHA512. See Security for key configuration.Validation
Common configuration errors:Missing Algorithm
Invalid Difficulty
CHALLENGE without Challenge Config
Performance Considerations
Client-Side
- Difficulty 2: ~200ms on modern devices
- Difficulty 4: ~1s on modern devices, ~5s on older devices
- Difficulty 8+: May timeout on mobile devices
Server-Side
Challenges are stateless and require no server computation. Server load comes from:- Challenge page delivery (minimal)
- JWT verification (fast)
- Storage backend operations (depends on backend)
Testing Challenges
Test challenge configuration without blocking traffic:Next Steps
- Challenge Methods - Detailed algorithm documentation
- Bot Rules - Configure when to challenge
- Thresholds} - Weight-based challenge selection
- Security - JWT signing and key generation