Engineering guide · Security

Adaptive Bot Protection

Status: currentReviewed: 2026-07-25Audience: authentication developers, security engineers, identity operators, incident responders
On this pageEnforcement OrderOkta-Compatible ConfigurationObserve Before EnforceAdaptive InputsAtlas Challenge ContractEvidence And PrivacyFailure ContractTest And Docker Evidence

Atlas adaptive bot protection is an organization-level, pre-authentication control that is independent from CAPTCHA Challenge Providers. Its management contract preserves Okta’s level, mode, and supportedFlows vocabulary and route:

GET  /api/v1/bot-protection/configuration
POST /api/v1/bot-protection/configuration

Atlas adds an observe-before-enforce lifecycle, stateful cross-replica pressure, keyed privacy boundaries, explicit remediation, Network Zone exemptions, optimistic concurrency, actor-bound idempotency, and independently verifiable evidence. Bot protection runs independently from Threat Intelligence; both are composed at the gateway.

Enforcement Order

The authentication gateway derives every enforcement input on the server. clientIp, userAgent, likelihood, score, and exemption state supplied in a JSON body are never trusted.

transport peer
  -> trusted-proxy chain resolution
  -> organization Network Zone blocklist
  -> source-quorum threat intelligence
  -> bounded source and target pressure guard
  -> adaptive bot-protection evaluation
  -> optional external CAPTCHA policy
  -> credential verifier
  -> authentication outcome feedback
  -> session and continuous-risk policy

A failure of a required storage, Network Zone, integrity, or remediation authority returns 503; it does not restore legacy credential processing. Blocklist denial dominates an exemption. A policy zone may exempt bot remediation but cannot exempt Threat Intelligence, rate limits, credential policy, or continuous session controls.

Okta-Compatible Configuration

level is the configured likelihood threshold:

Level Remediation threshold

ANY

Any nonzero likelihood score.

LOW

Low, medium, or high likelihood.

MEDIUM

Medium or high likelihood.

HIGH

High likelihood only.

mode is DISABLED, LOG_ONLY, or ENFORCED. LOG_ONLY calculates the same decision and records wouldRemediate, but always permits the request to continue to the next control. Supported flow values retain Okta-friendly names: SIGN_IN, SSR for self-service registration, and SSPR for self-service password recovery. Atlas also supports ACCOUNT_UNLOCK.

Atlas fields are:

  • remediation: ATLAS_CHALLENGE or BLOCK;

  • challengeDifficulty: 12 through 22 leading SHA-256 zero bits;

  • challengeTtlSeconds: 30 through 300 seconds; and

  • exemptNetworkZoneIds: at most 32 active policy-zone IDs.

Create a monitoring configuration:

curl --fail-with-body \
  -X POST https://id.atlas.example/api/v1/bot-protection/configuration \
  -H "Authorization: Bearer ${ATLAS_OPERATOR_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: bot-observation-baseline-20260725" \
  --data '{
    "level": "LOW",
    "mode": "LOG_ONLY",
    "supportedFlows": ["SIGN_IN", "SSR", "SSPR"],
    "remediation": "ATLAS_CHALLENGE",
    "challengeDifficulty": 16,
    "challengeTtlSeconds": 90,
    "exemptNetworkZoneIds": ["managed-mission-egress"],
    "reason": "collect production likelihood evidence before enforcement"
  }'

The first persisted version must be DISABLED or LOG_ONLY. A direct ENFORCED create is rejected. Updating an existing singleton requires the exact If-Match ETag and a new Idempotency-Key.

Observe Before Enforce

The production service requires at least 25 observations and 15 elapsed minutes under the current LOG_ONLY detection configuration. GET exposes monitoringObservations and enforcementReady. Changing a detection input starts a new observation period.

Enforcement additionally requires:

  • security.bot-protection.manage;

  • fresh AAL3;

  • an actor other than the operator who configured the monitored version; and

  • the exact current If-Match version.

curl --fail-with-body \
  -X POST https://id.atlas.example/api/v1/bot-protection/configuration \
  -H "Authorization: Bearer ${INDEPENDENT_AAL3_TOKEN}" \
  -H 'If-Match: "v1"' \
  -H "Idempotency-Key: bot-enforcement-approval-20260725" \
  -H "Content-Type: application/json" \
  --data '{
    "level": "LOW",
    "mode": "ENFORCED",
    "supportedFlows": ["SIGN_IN", "SSR", "SSPR"],
    "remediation": "ATLAS_CHALLENGE",
    "challengeDifficulty": 16,
    "challengeTtlSeconds": 90,
    "exemptNetworkZoneIds": ["managed-mission-egress"],
    "reason": "independent approval after observation review"
  }'

Development tests may inject a shorter observation requirement through the Go service configuration. The gateway production constructor uses the compiled 15-minute and 25-observation floor; the public API cannot reduce it.

Adaptive Inputs

Atlas combines stateless and stateful evidence. The initial deterministic classifier currently evaluates:

  • missing or known automation user-agent characteristics;

  • missing browser accept and language headers;

  • missing opaque device binding;

  • a server-owned Threat Intelligence match input;

  • source and submitted-target request velocity; and

  • prior invalid-credential outcomes for the source and target.

Scores range from 0 through 1000 and map to NONE, LOW, MEDIUM, and HIGH. Reason codes explain which feature families contributed. Detection is not authorization: a username is an attacker-submitted target, so its failed attempts never become risk evidence about an authenticated session owned by that user.

The first integrated SIGN_IN path records the authentication result after the credential verifier. Registration, recovery, and unlock use the same package and flow vocabulary; each public flow must call the shared evaluator before it claims coverage.

Atlas Challenge Contract

ATLAS_CHALLENGE is a first-party, provider-independent proof-of-work gate. Atlas generates 256 random bits and returns:

{
  "requiresBotProtection": true,
  "botProtectionChallenge": {
    "token": "opaque-one-time-value",
    "algorithm": "SHA-256",
    "difficulty": 16,
    "expiresAt": "2026-07-25T18:31:30Z"
  },
  "botProtectionDecisionSha256": "..."
}

Find a nonce for which the digest has the required leading zero bits:

SHA-256(token || 0x00 || UTF8(nonce))

Resubmit the same sign-in request with botProtectionChallengeToken and botProtectionProof. The challenge is bound to tenant, policy version, flow, server-resolved source, submitted-target HMAC, and opaque-device HMAC. Atlas atomically consumes it in PostgreSQL. A second replica, process restart, changed source, changed target, changed device, expiry, or replay is denied.

The token and proof are never logged or stored. PostgreSQL stores only the token SHA-256 digest and key-separated HMAC bindings.

Evidence And Privacy

Read verified observations and configuration events:

GET /api/v1/bot-protection/observations?limit=100
GET /api/v1/bot-protection/events

Both require security.bot-protection.read, fresh AAL2, and tenant scope. Observations include likelihood, score, action, wouldRemediate, reason codes, policy version, and decision digest. They contain HMAC references instead of raw:

  • IP addresses and forwarding headers;

  • usernames or recovery identifiers;

  • device identifiers and user-agent strings;

  • challenge tokens and work proofs; and

  • idempotency keys.

The HMAC key is domain-separated by data class and must contain at least 256 bits in ATLAS_BOT_PROTECTION_INTEGRITY_KEY_B64. Production refuses to initialize without that key and PostgreSQL. Rotate it through a staged dual-verifier migration; changing it in place would intentionally make old evidence unverifiable. Development may use an ephemeral key and memory store, and that downgrade is rejected outside a development-like environment.

Configuration and observation reads recompute evidence. Events, observations, outcomes, and replay bindings are append-only. Database triggers reject direct mutation. Challenge rows permit exactly one consumed_at transition and no binding changes.

Failure Contract

400 indicates invalid mode, threshold, flow, work factor, zone ID, limit, or body. 403 indicates missing capability, stale assurance, failed independent approval, block remediation, invalid work, or changed challenge binding. 409 indicates optimistic version, idempotency, observation readiness, or Network Zone conflict. 410 indicates expiry at a management verification boundary. 428 indicates a missing If-Match on an existing configuration. 503 indicates unavailable storage, Network Zones, or failed evidence integrity.

Test And Docker Evidence

Atlas service proves monitoring semantics, adaptive classification, independent enforcement, privacy minimization, server-resolved zone exemption, work verification, and replay denial.

API gateway proves the first-party challenge is applied before credential code and that a replay is rejected. The gateway OpenAPI tests validate the Swagger contract.

Atlas service applies the real migration and proves exact replay, monitoring-to-enforcement transition, shared PostgreSQL pressure, one winning challenge claim across two service replicas, restart recovery, absence of raw authentication material, and trigger-enforced immutability.

Run the bounded, memory-aware Docker gate:

scripts/test/run-bot-protection-docker-validation.sh

The runner exits 75 without starting Docker when the host has less than its configured memory floor and writes checksummed evidence under artifacts/bot-protection-docker-validation/<timestamp>/.