Skip to content

Challenge Types

KEPCA supports six challenge types. Each can be enabled or disabled per site from the dashboard or via the REST API. The adaptive risk engine selects the appropriate challenge based on the visitor's risk score.

Overview

ChallengeRisk TierUser InteractionBot ResistanceAccessibility
Invisible1 (low)NoneMediumPerfect
PoW1-2None (spinner)HighPerfect
Checkbox2Single clickMediumGood
Slider2-3Drag interactionHighModerate
Grid3 (high)Image selectionVery HighModerate
Interactive3 (high)Custom puzzleVery HighModerate
Text2-3Text inputHighGood

Invisible Pass

When the risk score is below the invisible_max threshold, the user passes without any visible challenge. The widget briefly shows a spinner while signals are evaluated, then displays a green checkmark.

No configuration needed -- this is the default behavior for low-risk traffic.

Proof of Work (PoW)

A SHA-256 hash puzzle solved in a Web Worker (or via Rust WASM for faster performance). The difficulty scales with the risk score using adaptive difficulty.

json
{
  "active_challenges": ["pow"],
  "risk_thresholds": {
    "invisible_max": 0.3,
    "pow_max": 0.8
  }
}

Adaptive PoW difficulty

The difficulty parameter controls how many leading zero bits the hash must have. KEPCA adjusts this dynamically:

Risk ScoreDifficulty (bits)Approximate solve time
0.3 - 0.412~50ms
0.4 - 0.515~200ms
0.5 - 0.618~1s
0.6 - 0.720~4s
0.7 - 0.822~15s

Higher difficulty forces bots to spend more CPU, making large-scale attacks economically impractical.

WASM solver

The widget ships with a Rust-compiled WASM solver that is 3-5x faster than the JavaScript fallback. It is loaded automatically when the browser supports WebAssembly. You can force the JS-only solver with:

html
<maptcha-widget data-sitekey="..." data-solver="js"></maptcha-widget>

Checkbox

The classic "I am not a robot" checkbox. When clicked, the full signal collection and risk scoring pipeline runs behind the scenes. If the risk score stays low, the checkbox turns green immediately. Otherwise, an additional challenge is issued.

json
{
  "active_challenges": ["checkbox"],
  "risk_thresholds": {
    "checkbox_max": 0.6
  }
}

Good for login pages and forms where you want visible user confirmation.

Slider

A drag-to-target slider challenge. The user drags a handle to a marked position. The widget collects mouse trajectory signals (speed, acceleration, deviation) to distinguish human drag patterns from scripted movements.

json
{
  "active_challenges": ["slider"],
  "risk_thresholds": {
    "slider_min": 0.4
  }
}

Configuration

OptionTypeDefaultDescription
slider_tolerancenumber5Pixel tolerance for target position
slider_track_widthnumber280Track width in pixels

Grid

An image grid challenge where the user selects cells matching a prompt (e.g., "Select all images containing traffic lights"). Uses server-side generated grids with distortion to resist OCR-based solvers.

json
{
  "active_challenges": ["grid"],
  "risk_thresholds": {
    "grid_min": 0.6
  }
}

Configuration

OptionTypeDefaultDescription
grid_sizestring"3x3"Grid dimensions: "3x3" or "4x4"
grid_min_selectnumber3Minimum cells user must select

Interactive

Custom interactive puzzles that are highly resistant to automated solving. These include map-based challenges (drag a pin to a location), pattern-drawing challenges, and object-rotation puzzles.

json
{
  "active_challenges": ["interactive"],
  "risk_thresholds": {
    "interactive_min": 0.6
  }
}

Interactive challenges collect the richest behavioral signals and are recommended for high-security scenarios (payment forms, account recovery).

Available puzzle types

PuzzleDescription
map_pinPlace a pin on a map at the described location
pattern_drawDraw the displayed pattern on a canvas
object_rotateRotate a 3D object to match a target angle

Text

Text-based challenges for accessibility or low-bandwidth scenarios. Includes simple math problems, word completion, and basic reasoning questions.

json
{
  "active_challenges": ["text"],
  "risk_thresholds": {
    "text_min": 0.4
  }
}

Example challenges

  • "What is 7 + 3?"
  • "Complete the word: Eleph___"
  • "Which of these is a color: bicycle, red, piano?"

Text challenges serve as the primary accessibility fallback. They are automatically offered when the widget detects a screen reader.

Combining challenges

You can enable multiple challenge types per site. The adaptive engine picks the best challenge for each request based on risk score and client capabilities:

json
{
  "active_challenges": ["pow", "checkbox", "slider", "grid", "interactive", "text"],
  "risk_thresholds": {
    "invisible_max": 0.3,
    "checkbox_max": 0.5,
    "pow_max": 0.6,
    "slider_min": 0.4,
    "grid_min": 0.6,
    "interactive_min": 0.7,
    "text_min": 0.4
  }
}

Behavioral signals

KEPCA collects passive behavioral signals to improve risk scoring without requiring user interaction.

Tier 1 signals (collected on page load)

SignalDescription
time_on_page_msTime since page load
submit_time_msTime between page load and form submit
honeypot_filledWhether a hidden field was filled
user_agentBrowser UA string and anomaly detection
tls_fingerprintJA3/JA4 TLS fingerprint
request_countRequests from same source in window
ip_hashSHA-256 of client IP

Tier 2 signals (collected during interaction)

SignalDescription
mouse_movementsMouse trajectory, speed, acceleration patterns
mouse_clicksClick coordinates, timing, and frequency
keyboard_dynamicsTyping speed, key hold duration, flight time
scroll_behaviorScroll depth, speed, direction changes
touch_patternsTouch pressure, swipe velocity (mobile)
focus_changesTab/window focus events and timing

Tier 2 signals are privacy-safe: raw data never leaves the browser. The analyzer computes feature vectors locally and sends only aggregate scores.

ML scoring foundation

The risk scoring engine uses a lightweight gradient-boosted model trained on labeled traffic data. The model evaluates all available signals and produces a composite risk score (0.0 to 1.0). Site owners can retrain the model on their own traffic patterns via the dashboard.

Model inputs:

  • Tier 1 passive signals (7 features)
  • Tier 2 behavioral signals (6 feature groups)
  • Historical session data (repeat visitor patterns)
  • Challenge solve metrics (time, accuracy, retries)

Next steps

  • Security -- rate limiting, key rotation, and token verification
  • Enterprise -- team management, custom domains, and billing
  • REST API -- endpoint reference for challenge configuration

KVKK/GDPR Uyumlu — Verileriniz yurt icinde kalir.