WebX Docs
← Catalog Raw Markdown Open console

Session Identity Platform — WebX

Document type: Architecture + Product Intent + Implementation Record + Operational Runbook + Decision History
Status: In Development (identity/network coherence platform landed on branch codex/session-identity-platform; default policy remains backward-compatible)
Engineering owner: WebX platform / browser runtime team
Product owner: WebX product (verified browser automation)
Repository: rust_mono_browser (workspace members under crates/)
Production: https://webx.agentslab.host (live data plane; identity policy env-gated)
Last materially reviewed: 2026-08-10
Consumer portal: /docs/session-identity (guide) · /docs/session-identity-system-record (this record) · catalog /docs
Schema versions: webx.session-identity.v1, webx.fingerprint.v1, policy version coherent-v1
Canonical code:


0. Executive Summary

What did we build?

A Session Identity Platform that composes browser fingerprint, managed proxy lease, geography, DNS mode, Chrome build, and persistence policy into one authoritative SessionIdentity document per session. Launch paths derive user-agent, locale, timezone, and egress from that structure instead of inventing independent facts. Persistent browser contexts store a secret-free webx-network-identity.json so cookie reuse also rebinds a compatible network family. Failover prefers minimum identity distance and fails closed when no safe route exists.

Why does it exist?

Logged-in portal automation fails trust and reliability when the browser “looks like” one place (UA, timezone, locale) while traffic exits another (proxy country), or when a retained login context silently continues over a different egress IP family. Sites treat that as fraud or bot risk; operators cannot prove what identity was actually used. The platform makes identity coherent, sticky, observable, and fail-closed under opt-in policy.

Who benefits?

ActorBenefit
Primary — automation integratorsStable geo + fingerprint contracts for Playwright/Browserbase-compatible sessions and agent tasks
Secondary — ops specialists running logged-in portalsSticky login contexts keep network identity beside cookies
OperatorsMetrics, quarantine, drift detection without DB surgery
Downstream trust layerIdentity digests bound into run manifests / receipts

What changed?

Before
Fingerprint patches, proxy leases, and persistent contexts were loosely coupled. Callers could request US proxy with a DE timezone; sticky contexts could reuse cookies while picking a different egress; failover could jump countries; receipts could not prove a coherent identity.

After
SessionIdentity::compose is the single composition point. WEBX_IDENTITY_POLICY=permissive|coherent|strict controls fail-closed behavior (default permissive for backward compatibility). Managed proxy acquisition honors preferred_lease_hash and identity distance (MAX_SAFE_IDENTITY_DISTANCE = 50; country change costs 100 → always unsafe). Context reuse under coherent/strict requires a compatible managed lease when prior network identity is concrete. Post-egress observation re-validates without fabricating exit country.

Current state

DimensionStatus
Product maturityBeta (platform primitives + UAT contracts; not a claim of anti-bot immunity)
Production usageLive WebX deployment; identity policy env-gated; managed proxies opt-in via pool inventory
ReliabilityFail-closed on coherent/strict; permissive default preserves existing callers
Security reviewIdentity contracts forbid credential logging; secret-free provenance; no JA3 spoof / “undetectable” claims
Operational ownershipWebX platform team
Major known limitationProbabilistic fingerprint simulation intentionally out of scope; external residential vendor adapters and full portable context v2 (object-store CAS) remain infrastructure-dependent
Next major decisionDefault production policy: keep permissive vs promote coherent for high-assurance tenants

One-sentence architecture

Client / agent taskrun_launch / Browserbase session create → SessionIdentity compose + ProxyManager.acquire → Chrome launch (fingerprint + profile dir) + egress lease → observation / drift / provenance on run manifest → durable logs & receipts.


1. Product Intent

Engineering decisions start with the outcome being created, not the technology selected.

1.1 Problem statement

User problem
Operators running logged-in third-party portals (invoices, compliance, supplier systems without APIs) need a browser session that stays the same person across steps and restarts: same cookies, same geography, same browser surface — and honest failure when that cannot be guaranteed.

Business problem
Without coherent identity, automation flunks anti-fraud checks, causes support load, and weakens WebX’s differentiator (verified, auditable runs). Competitors sell “browser infra”; WebX must sell trustable identity + evidence.

Technical problem
Historically independent knobs (UA spoof, proxy pool, Chrome profile dir, DNS mode) could contradict each other. Failover and context reuse could silently change network identity. Secrets risked leaking into logs/receipts if identity snapshots were naïve.

Why now?
Production authority hardening (2026-08-09), Browserbase-compatible session plane, managed proxy receipts, and multi-session persistent contexts made incoherent identity an unacceptable integrity hole before GA claims.

1.2 Target users / actors

ActorGoalPain today (without platform)Expected value
Aisha — API IntegratorCreate geo-pinned sessions via /v1/sessions with stable contractsContradictory UA vs proxy; silent geo downgradeFail-closed errors; proxy receipt; identity digests
Maya — Accounts Payable Specialist (via automation)Complete portal workflows while logged inSession “looks different” mid-run; forced re-loginSticky context + network continuity
Jordan — Platform OperatorDetect bad egress / quarantine / drift without DB surgeryOpaque proxy failures; no identity metricsBounded Prometheus metrics; quarantine; fail-closed acquire
Sam — Security / Compliance ReviewerProve what identity a run usedNo secret-free identity block on receiptsprovenance_block() digests on run manifests
Riley — Release EngineerGate releases on identity invariantsSoft claims without testsUAT-047..054 + cargo unit proofs

2. Outcomes and Success Criteria

2.1 Product outcomes

OutcomeMetricBaselineTargetMeasurement source
Coherent sessions admit cleanlyIdentity validation failure rate under coherentUnmeasured (pre-platform)Near-zero for correctly configured profileswebx_identity_validation_failures_total
No silent geo downgradeManaged lease rejects when inventory cannot satisfy geoSilent wrong-country possible100% reject with managed_proxy_unavailable / fail-closedUnit + UAT-048
Sticky context continuityContext reuse keeps compatible network familyCookies onlyCookies + webx-network-identity.json rebindingUAT-049, contexts tests
Operator-visible healthProxy quarantine & acquire outcomesAd-hoc logsMetric coverage without IP cardinalitywebx_proxy_*, webx_identity_*
Release confidenceUAT-047..054 pass under local-deterministic / production profilesNot in suiteMandatory gates as taggeduat/manifest/v1/uat-manifest.json

2.2 Engineering outcomes

OutcomeMeasureTarget
Availability (identity path)Composition + acquire on session createFail closed; do not admit contradictory identity under coherent/strict
LatencyIdentity compose + local pool acquireNegligible vs Chrome cold start (~2.5s); geo check is optional external RTT
CorrectnessNo fabricated observedCountryUnverified → null / unevaluable
RecoverabilityIdentity-preserving failoverPrefer min identity_distance; country change never silent
Data durabilityContext network identity on diskSurvive process restart for process-tier profiles
Deployment safetyUnknown WEBX_IDENTITY_POLICYAdmission fails closed via try_from_env
Cost efficiencyNetwork budget without pricePricingUnevaluable — no silent free ride

2.3 Non-goals

Non-goals prevent accidental architecture expansion.


3. Constraints

Hard constraints

ConstraintSourceConsequence
Backward-compatible default policyProduct / existing API clientsDefault IdentityPolicy::Permissive
No second persistent datastore for identity MVPPlatform simplicityNetwork identity lives beside context profile on disk (webx-network-identity.json); durable session catalogue remains SQLite/Postgres
Secrets never in receipts/logs/identity docsSecurityOnly lease hashes, digests, sanitized network facts
Must work with existing auth (x-api-key / Bearer / Browserbase X-BB-API-Key)PlatformIdentity does not introduce a new auth plane
Must integrate with process-tier Chrome profilesOrchestratorContexts meaningful under process orchestrator; shared-context tier accepts id without persistence effect
Production public bind policyRuntime profilesProduction/high_assurance invariants still apply at process level
Metric label cardinality boundsOpsExit IP and free-form domain must not appear as Prometheus labels
Fail closed on unknown identity policy in admissionProduction safetyIdentityPolicy::try_from_env errors on unknown nonempty values

Soft constraints


4. System Invariants

IDInvariantEnforcement
INV-01Downstream launch paths must derive browser/network attributes from composed SessionIdentity (or explicit honest omission), not invent independent UA/geo/proxy factssession_identity module contract; run_launch / browserbase_compat acquire path
INV-02Fingerprint profiles must be internally coherent (webx.fingerprint.v1) before launchFingerprintProfile::validate; invalid → no session
INV-03Under coherent/strict, high-value contradictions fail closed (timezone vs country, locale vs country, mobile proxy + desktop UA, requested vs observed country)IdentityValidator
INV-04Observed exit country is never fabricatedGeo check unset/fail → null; qualification unevaluable
INV-05Retrying/sticky acquire with preferred_lease_hash must not silently switch to an identity-distant route when fail-closed distance is requiredProxyManager + MAX_SAFE_IDENTITY_DISTANCE
INV-06Country-changing failover is never silent under identity-preserving modeDistance cost 100 > 50 threshold → NoSafeFailover
INV-07Persistent context with concrete prior network identity cannot silently continue on direct/external/none egress under coherent/strictIdentityError::IdentityContinuity
INV-08Identity snapshots are secret-free (no proxy passwords, no credential-bearing URLs)Type design + bind_network_identity refuse heuristic
INV-09Prior context may inform preference/validation but must not copy last_lease_hash into a claim of an active lease on a new direct sessionSessionIdentity::compose comments + logic
INV-10Prometheus metrics omit exit IP and free-form domain labelsmetrics.rs + UAT identity contracts
INV-11Documentation / UAT IDs for identity cases remain UAT-047..054Manifest + test_identity_network_contracts.py
INV-12Chrome major from live Browser.getVersion must match fingerprint major when both known and policy fail-closedvalidate_browser_product_against_profile / stealth path

When implementation changes, these invariants should survive.


5. Scope and System Boundary

5.1 In scope

5.2 Out of scope

5.3 Context diagram

                 ┌──────────────────────────┐
                 │ Integrator / Agent task  │
                 └────────────┬─────────────┘
                              │ REST / WS / MCP
                              ▼
              ┌───────────────────────────────┐
              │        webx-server            │
              │  Auth → run_launch / BB API   │
              │                               │
              │  ┌─────────────────────────┐  │
              │  │ Session Identity        │  │
              │  │ Platform boundary       │  │
              │  │  compose / validate     │  │
              │  │  ProxyManager.acquire   │  │
              │  │  ContextStore bind/load │  │
              │  └───────────┬─────────────┘  │
              └──────────────┼────────────────┘
                  │          │           │
         ┌────────▼──┐  ┌────▼─────┐  ┌──▼──────────────┐
         │ Profile   │  │ Proxy    │  │ Chrome (CDP)    │
         │ disk      │  │ inventory│  │ stealth apply   │
         │ contexts/ │  │ + geo    │  │ process tier    │
         └───────────┘  └──────────┘  └─────────────────┘
                  │
                  ▼
         Run manifest / receipts / metrics / session logs

5.4 Ownership boundaries

ResponsibilityOwner
UI (console / live view)WebX server frontend surfaces (consumes session metadata; not identity composer)
API (session/task create)webx-server HTTP / Browserbase compat
Domain rules (coherence, distance, continuity)session_identity + proxy_manager
Persistent context filescontexts + process orchestrator profile dirs
Durable session catalogueSessionStore / repositories (SQLite or Postgres)
Infrastructure (k8s, pool, Postgres)Platform / ops
MonitoringPlatform (Prometheus rules in ops/)
Incident responsePlatform on-call
Product decisions (default policy, geo product)Product + engineering

Ambiguous ownership is an operational defect — identity composition is not owned by the LLM agent.


6. Architecture

6.1 Repository architecture

rust_mono_browser/
├── crates/
│   ├── webx-server/          # API, SessionIdentity, ProxyManager, ContextStore, launch
│   │   ├── src/
│   │   │   ├── session_identity.rs   # canonical identity domain
│   │   │   ├── proxy_manager.rs      # lease, health, failover, inventory
│   │   │   ├── contexts.rs           # persistent profile + network identity files
│   │   │   ├── run_launch.rs         # compose + acquire on task launch
│   │   │   ├── browserbase_compat.rs # /v1/sessions path
│   │   │   ├── run_manifest.rs       # provenance binding
│   │   │   ├── metrics.rs            # proxy/identity golden metrics
│   │   │   └── stealth applied via webx-browser
│   │   ├── migrations/postgres/
│   │   └── tests/
│   ├── webx-browser/         # CDP, FingerprintProfile, apply_stealth
│   ├── webx-agent/           # ODEV loop (consumer of launched session)
│   ├── webx-verify/          # membrane / txlog / receipts (adjacent)
│   ├── webx-orchestrator/    # process tier profiles, engines
│   └── …
├── clients/                  # py / ts SDK surfaces
├── docs/                     # this record, MANAGED_PROXIES, UAT_RUNBOOK, …
├── uat/
│   ├── manifest/v1/uat-manifest.json   # UAT-047..054
│   ├── contracts/test_identity_network_contracts.py
│   └── runner/
├── ops/                      # backup, SLO rules, single-node manifests
├── k8s/                      # enterprise / egress proxy examples
└── scripts/                  # live UAT / production regression helpers

6.2 Runtime architecture

Request (task or /v1/sessions)
   │
   ▼
┌────────────┐
│ Edge/Auth  │  x-api-key / Bearer / X-BB-API-Key
└─────┬──────┘
      │
      ▼
┌──────────────────┐
│ Launch handler   │  run_launch / browserbase_compat
└──────┬───────────┘
       │
       ├─ load prior ContextNetworkIdentity (if contextId)
       ├─ ProxyManager.acquire(LeaseRequest{ geo, sticky, preferred_lease_hash, budget })
       ├─ SessionIdentity::compose(…)
       ├─ IdentityValidator (policy fail-closed?)
       │
       ▼
┌────────────────┐
│ Domain service │  identity + lease + provenance
└───┬─────────┬──┘
    │         │
    ▼         ▼
┌───────┐  ┌──────────────────┐
│Context│  │ Chrome process   │
│ disk  │  │ CDP + stealth    │
└───────┘  └────────┬─────────┘
                    │ optional geo-check through proxy
                    ▼
             apply_post_egress / drift
                    │
                    ▼
         Events / Metrics / Run manifest / Logs

6.3 Request / workflow lifecycle (sticky geo session)

  1. Integrator creates session with managed proxy geo + optional contextId / sticky key.
  2. Auth validates API key / project scope.
  3. Handler loads prior webx-network-identity.json if context exists.
  4. ProxyManager.acquire selects inventory entry: prefer preferred_lease_hash, else sticky key, else geo/type match; quarantine unhealthy; enforce capacity and network budget.
  5. If identity-preserving failover required and no candidate within distance ≤ 50 → NoSafeFailover / HTTP error.
  6. SessionIdentity::compose builds secret-free identity; validates fingerprint schema; applies continuity rules vs prior.
  7. Under coherent/strict failures → reject admission (invalid_identity_policy / coherence errors mapped to 400-class).
  8. Chrome launches with profile dir + fingerprint applied via apply_stealth.
  9. Optional egress verification updates observation.country via apply_post_egress (never invents).
  10. Context bind writes network identity snapshot; run manifest records digests.
  11. Telemetry increments acquire / validation metrics (bounded labels).
  12. On teardown, lease released; proxy receipt cleared; profile flush on release paths.
  13. Failure recovery: quarantine bad endpoints; do not silent country hop; operator re-runs with corrected pool/geo.

This section should make it possible to debug the system without reading every source file.


7. Data Model

7.1 Core entities

EntityPurposeIdentityLifecycle owner
SessionIdentityAuthoritative browser+network composition for one sessionsid_<uuid> or supplied id; schema webx.session-identity.v1session_identity / launch
FingerprintProfileImmutable coherent browser surfaceContent digest via profile JSON; schema webx.fingerprint.v1Env WEBX_FINGERPRINT_PROFILE_JSON or request path
ContextNetworkIdentitySticky secret-free network snapshot on a contextidentity_id + profile_digestContextStore
Lease / lease hashManaged proxy allocationOne-way leaseHashProxyManager
NetworkObservationObserved exit factsOptional IP/ASN/country; DNS flagsPost-egress checks
Proxy inventory entryOperator pool configserver + geo + optional ASN/type/pricingEnv / file / signed URL inventory
Run manifest identity blockEvidence for auditdigests onlyrun_manifest / receipts

7.2 State transitions

Identity composition

REQUESTED
   │
   ▼
COMPOSE (fingerprint validate)
   │
   ├──── invalid fingerprint ────► REJECTED
   │
   ▼
VALIDATE (coherence / continuity / DNS)
   │
   ├──── policy permissive ──► ADMITTED (findings may exist)
   ├──── policy fail-closed + findings ──► REJECTED
   │
   ▼
LEASED (managed) / DIRECT
   │
   ▼
OBSERVED (optional geo-check)
   │
   ├──── strict + missing verified country ──► REJECTED
   ├──── country mismatch (coherent/strict) ──► REJECTED
   │
   ▼
BOUND_TO_CONTEXT (optional)
   │
   ▼
ACTIVE_SESSION
   │
   ├──── drift detected ──► DRIFT_FLAGGED / fail-closed per policy
   │
   ▼
RELEASED (lease cleared, profile flush)
StateMeaningAllowed transitions
REQUESTEDInputs assembled→ COMPOSE
COMPOSEBuilding structure→ VALIDATE, REJECTED
VALIDATEDeterministic checks→ LEASED/DIRECT, REJECTED
OBSERVEDPost-egress facts applied→ BOUND, ACTIVE, REJECTED
ACTIVE_SESSIONBrowser running→ DRIFT_FLAGGED, RELEASED
REJECTEDFail-closed admission/runtimeterminal for that attempt
RELEASEDTeardown completeterminal

Illegal transitions should be impossible at the type/API boundary (compose returns Result, acquire returns ProxyError).

7.3 Data ownership

Field / artifactCreatesMutatesConsumesRetentionSensitive?Schema change
Fingerprint profileOperator / envImmutable per runStealth, validatorConfig lifetimeLow (public browser claims)Version webx.fingerprint.v1
Proxy credentialsOperator inventoryInventory refreshLaunch args onlySecret storeYesNever copy into identity JSON
leaseHashProxyManagerPer leaseReceipts, preferred reacquireSession lifetimeLow (one-way)Hash versioned prefix
observedCountryGeo-check through proxyapply_post_egressValidator, receiptSession / logsMedium (geo)Honest null allowed
Exit IPObservationDrift compareLogs (controlled); not metrics labelsShortMediumDo not label-metric
webx-network-identity.jsonbind on successRebind on reuseNext launchWith context dirSecret-free by constructionAdditive fields preferred
Identity digestsdigest() / provenanceImmutable for runManifests, auditorsWith run evidenceLowSchema version in material

8. API / Contract Design

Stable interfaces (identity-relevant)

InterfaceRole
POST /api/tasksAgent task launch; identity composed in run_launch
POST /v1/sessionsBrowserbase-compatible session create; proxies + context
GET /v1/sessions/:idReturns proxy receipt fields when managed lease present
Context APIs / launch fields using contextIdSticky profile + network identity
Env: WEBX_IDENTITY_POLICY, WEBX_FINGERPRINT_PROFILE_JSON, WEBX_PROXY_*Operator contracts
Run manifest / receipt identity provenance blockAudit consumers

Managed proxy request (Browserbase-shaped)

// POST /v1/sessions
{
  "proxies": [
    {
      "type": "webx",
      "geolocation": { "country": "US", "state": "CA", "city": "SAN_FRANCISCO" },
      "rotation": "per_session",
      "stickyKey": "login-flow-7"
    }
  ]
}

External proxy still supported verbatim (type: external).

Contract concerns

ConcernDefinition
Authenticationx-api-key, Authorization: Bearer, or X-BB-API-Key; query token for WS only
AuthorizationProject-scoped keys / existing RBAC; identity does not bypass tenancy
Request schemaProxies array; optional fingerprint via deployment env; contextId for stickiness
Response schemaSession id + optional proxy receipt (provider, requestedGeo, observedCountry, leaseHash, bytes, rotationPolicy)
Error contract400 managed_proxy_unavailable, invalid identity policy, coherence failures; no silent geo rewrite
IdempotencyRetained browser continuations made idempotent on branch; preferred lease hash reacquire
PaginationN/A for identity compose
Rate limitSession concurrency caps (WEBX_MAX_CONCURRENT_SESSIONS); proxy maxSessions
Compatibility policyDefault permissive; coherent/strict opt-in; fingerprint schema versioned

Error semantics (identity / proxy)

ErrorMeaningRetry?User action
400 invalid fingerprint / coherenceProfile or geo/timezone contradictionNoFix profile / geo / policy
400 managed_proxy_unavailableNo healthy inventory matchMaybe laterFix pool / geo / wait quarantine
400 / mapped NoSafeFailoverNo identity-safe alternate routeNo (without policy change)Fix inventory or accept new identity
400 identity_continuitySticky context needs compatible managed leaseNoRequest managed proxy matching prior
401Auth requiredNoAuthenticate
403Not authorizedNoRequest access
429 / capacitySession or proxy capacityYesBack off
5xxServer / dependency failureUsuallyRetry / escalate

Domain codes include: invalid_identity_policy, identity_continuity, identity_drift, proxy_geo_unverified, no_safe_failover, managed_proxy_unavailable.


9. Critical User Journeys

Journey J-01 — Geo-pinned Browserbase session

ActorAisha — API Integrator
TriggerPOST /v1/sessions with managed US proxy
BeforeSession might launch with mismatched locale/timezone or wrong egress
Happy path1) Auth OK → 2) Acquire US lease → 3) Compose identity → 4) Launch Chrome + stealth → 5) Optional geo-check records observed US → 6) Response includes proxy receipt
Expected outcomeReady connectUrl + coherent identity evidence
Failure pathsAuth fails → 401; no US inventory → 400 unavailable; geo mismatch under coherent → reject; geo-check down under strict → geo unverified
EvidenceUAT-047, UAT-048; unit tests in session_identity / proxy_manager
Telemetrywebx_proxy_acquire_total, webx_identity_validation_failures_total
Demodocs/BROWSERBASE_MIGRATION.md, docs/MANAGED_PROXIES.md

Journey J-02 — Persistent login context with network continuity

ActorMaya (via automation) / integrator reusing contextId
TriggerSecond session with same context after successful login
BeforeCookies restored but egress identity could change → site re-challenges
Happy path1) Load prior network identity → 2) Acquire with preferred_lease_hash → 3) Continuity validation passes → 4) Rebind snapshot → 5) Continue logged-in workflow
Expected outcomeSame network family + cookies
Failure pathsPrior concrete network + no managed lease under coherent → IdentityContinuity; country jump → drift fail-closed
EvidenceUAT-049; contexts isolation tests; scripts uat_persistent_context_workflow.py
Telemetrywebx_identity_drift_total

Journey J-03 — Identity-preserving proxy failover

ActorJordan — Platform Operator / system self-heal
TriggerPreferred endpoint quarantined (health / geo mismatch)
BeforeFailover might pick another country
Happy pathSelect min-distance healthy route within budget; continue
Expected outcomeSession survives without country hop
Failure pathsOnly far candidates → NoSafeFailover (honest)
EvidenceUAT-050; identity_preserving_failover cargo test

Journey J-04 — Cross-context isolation

ActorSam — Security reviewer
TriggerTwo contexts A/B with different bound identities
Happy pathSeparate dirs; separate webx-network-identity.json; digests differ
Expected outcomeNo identity cross-talk
EvidenceUAT-054; two_contexts_produce_isolated

10. Non-Functional Requirements

10.1 Reliability

ItemTarget / statement
Availability targetIdentity path must not silently degrade correctness; prefer refuse-over-lie under coherent/strict
Maximum tolerable data lossLosing a live browser kills the session (design); durable audit should survive; network identity file loss → lose stickiness, not invent new coherence
Maximum tolerable recovery timeSession-level: retry new session; pool quarantine temporary
Dependency failure behaviorGeo-check failure → honest null; inventory empty → unavailable; Chrome product mismatch → fail-closed when policy requires

10.2 Performance

Operationp50p95p99Maximum acceptable
Identity compose + validate<1 ms (CPU)<5 ms<10 msDominated by Chrome start
Proxy acquire (in-process static pool)<5 ms<20 ms<50 msInventory lock contention rare
Geo-check HTTP (optional)~100–400 ms<1 s<2 sMust not block forever; timeout per client defaults
Full session cold start~2.5 s (engine cold_start_ms)higher under loadBrowser-bound

Scale assumptions

AssumptionValue / note
Concurrent sessionsPOC ~4; enterprise N × cap or browser pool (see docs/SCALING.md)
Objects/dayOperator-dependent; enterprise 10s–100s concurrent high-value workflows, not consumer 1000s
Largest identity artifactFingerprint JSON + small network identity file (KB-scale)
Expected growthProxy inventory size and sticky keys grow with tenants

10.3 Scalability

ItemStatement
Current practical limitSingle-node process-tier browsers; in-process proxy health state
First bottleneckChrome processes / CDP, not identity compose
Next bottleneckLLM step rate for agent tasks; proxy vendor capacity for managed egress
Horizontal scalingAPI replicas + browser pool; identity files need shared volume or future context v2 for multi-worker stickiness
PartitioningContext ids under profile root; project_id in durable store
When redesign becomes necessaryMulti-worker sticky context without shared FS; multi-region sticky egress SLAs

10.4 Availability vs consistency

This workflow prefers consistency (coherence) of browser+network identity over availability of “any browser that starts.”

Under coherent/strict, WebX will refuse a session rather than admit a contradictory identity. Under default permissive, availability of existing clients is preferred and findings do not block admission.


11. Failure Model

Failure analysis

FailureDetectionUser impactRecoveryPrevention
Proxy dependency / endpoint downHealth check, transport failures, quarantineAcquire fails or failoverPrefer sticky; else min distance; else fail closedInventory redundancy same country
Geo mismatchObserved vs requested countryReject under coherent/strictFix inventory / geo-checkFail closed; quarantine endpoint
DB unavailableStore errors on durable pathsStatus/audit degraded; live session may continue in-memoryFail readiness in multi-replicaPostgres HA (operator)
Partial launch (lease ok, Chrome fail)Launch error pathSession not ready; lease should release on teardown pathsRetry sessionIdempotent release
Duplicate / sticky reacquirepreferred lease hashSame egress when healthyFallback min distanceUnit tests preferred_lease_hash
Bad deploy (bad fingerprint JSON)Profile validate at launchAll profiled sessions failRollback env / imageStartup checks; UAT
Identity continuity violationValidatorContext reuse rejectedRequest compatible managed proxyDocument sticky contract
DNS leak signallocal_dns_used + proxy DNS modeStrict/coherent failFix proxy mode (SOCKS remote DNS)DnsMode inference + validation
Network budget without pricesPricingUnevaluableAcquire rejectAdd inventory pricing or drop budgetCost-aware scheduling tests

Partial failure specifics

ScenarioBehavior
Database succeeds but external geo-check failsPersist session without fabricated country; strict may fail if verification required after observation attempt
Geo-check succeeds but response lostTreat as unverified; do not echo request country as observed
Worker crashes mid-sessionLive browser ownership lost → unrecoverable live session by design; audit may remain if durable
Client retries after timeoutPrefer idempotent continuation / same session id where supported; new session gets new identity compose
Two actors mutate same contextLast bind wins on file write; isolation is per context id, not multi-writer CRDT
Old and new app versions simultaneousSchema versions on identity/fingerprint; additive fields; unknown policy fails closed on admission

Retry behavior

ClassPolicy
RetryableTransient proxy transport; capacity 429; temporary quarantine expiry
Not retryableCoherence contradiction; invalid fingerprint; identity continuity without managed lease; no safe failover
BackoffClient/standard; pool quarantine temporary exclusion
Maximum attemptsSession-level product timeouts (timeout); not infinite acquire loops
Dead-letter / manual recoveryOperator fixes inventory; release stuck sessions; restore context from backup if profile dir lost

12. Security and Privacy

Threat model — assets

Threats

ThreatMitigation
Unauthorized cross-tenant accessExisting project authz; context path traversal hardening (is_safe_id)
Privilege escalationIdentity does not grant new roles
InjectionTyped JSON schemas; deny_unknown_fields on fingerprint
Secret leakageSecret-free identity types; receipts use lease hash; bind refuses password-like payloads
Sensitive logsControlled fields; no proxy passwords in receipts
Replay of lease credentialsCredentials not in client-visible identity docs
EnumerationStandard auth on APIs
Insecure direct object referenceContext ids unguessable UUIDs + authz on session APIs
Dependency compromisedeny.toml / supply chain practices at workspace level

Trust boundaries

Browser / integrator client
   │ UNTRUSTED
   ▼
Public API (auth required)
   │ authenticated boundary
   ▼
webx-server application (compose, acquire, launch)
   │ controlled boundary
   ▼
Chrome process / proxy egress / disk profiles / Postgres

Never trust client-side enforcement as authorization. Never treat client-supplied “observed country” as verified without server-side check.

Security controls

ConcernControl
AuthenticationAPI keys / Bearer / BB key
AuthorizationProject-scoped resources
Secret storageInventory env/files/secrets; not git
Encryption in transitTLS at ingress (https://webx.agentslab.host)
Encryption at restOperator/Postgres volume policy
Tenant isolationproject_id + context path isolation
Audit loggingSession logs, identity provenance digests, proxy receipts
Input validationFingerprint validate; geo normalize; policy parse fail-closed
Dependency securityWorkspace deny / CI

Sensitive-data rule

Treat as potentially public if placed in: browser bundle, public/, frontend env, public repository, downloadable artifacts, client-visible logs.
Therefore: proxy passwords and raw authenticated proxy URLs never appear in SessionIdentity, receipts, or webx-network-identity.json.


13. Observability

13.1 Logs

Logs should answer: what happened, for which request/session/project, which component (compose/acquire/stealth), duration, retry/quarantine, error code, correlation across services.

Recommended context fields: request_id, session_id, project_id / tenant, operation, duration_ms, result, error_code, proxy_provider (not password), identity_policy, lease_hash (not credentials).

Never log secrets. Exit IPs only in controlled durable fields, not high-cardinality metrics.

13.2 Metrics

Golden / identity platform metrics (bounded labels):

MetricPurpose
webx_proxy_leases_activeSaturation
webx_proxy_acquire_totalTraffic / outcomes
webx_proxy_connection_failures_totalErrors
webx_proxy_geo_mismatch_totalCorrectness
webx_proxy_http_status_totalDependency health
webx_identity_validation_failures_totalPolicy enforcement
webx_identity_drift_totalLong-run continuity
webx_sessions_by_proxy_typeProduct mix
webx_network_cost_microusd_totalCost
webx_identity_audit_event_totalAudit volume

Platform SLO rules (ops/webx-slo-rules.yaml) also page on durable terminal, verified receipt integrity, and correctness invariants for the broader WebX runtime.

13.3 Tracing

Important spans: request auth → identity compose → proxy acquire → Chrome launch → stealth apply → geo-check → bind context → run loop.

13.4 Alerts

AlertTriggerUser impactOwnerFirst action
Proxy acquire failure spikeElevated webx_proxy_acquire_total{result=error}Sessions cannot start with managed geoPlatformCheck inventory health / vendor
Geo mismatch stormwebx_proxy_geo_mismatch_total risingFail-closed rejects / quarantine thrashPlatformValidate geo-check URL + pool geo labels
Identity validation failuresFailures under coherent/strictAdmission rejectsPlatform + integratorsInspect fingerprint vs geo configs
Identity driftwebx_identity_drift_totalSticky sessions breaking site trustPlatformCheck failover distance / vendor rotation
WebXDurableTerminalSLOBurnSLO ruleRuns accept but lack durable terminalPlatformSee ops/webx-slo-rules.yaml

Avoid alerts that only say “CPU > 80%” without user impact.


14. Testing Strategy

Testing pyramid / portfolio

LayerWhat it provesWhere
Static analysisStructural correctnesscargo fmt, clippy / workspace CI
UnitCoherence, distance, continuity, quarantine, budgetssession_identity, proxy_manager, contexts, stealth
ContractSource surface + UAT ID presenceuat/contracts/test_identity_network_contracts.py
IntegrationLaunch paths call .acquire( / LeaseRequestrun_launch + browserbase_compat string/unit proofs
E2E / live scriptsPersistent context, selenium login, diagnosticsscripts/uat_*.py, production regressions
LoadCapacityproduction_capacity_regression.py
Failure injectionQuarantine / no safe failoverunit tests
SecuritySecret-free provenance; no banned marketing languageidentity contracts
Production smokeDeployed candidate evaluationwebx-eval, release workflows

Critical test catalog

IDScenarioRisk covered
UAT-047Identity consistency (browser + network composition)INV-01..03
UAT-048Proxy country enforcement and geo fail-closedINV-04, silent geo
UAT-049Sticky identity across persistent context reuseINV-07, INV-08
UAT-050Failover minimizes identity distance; fails closedINV-05, INV-06
UAT-051DNS mode coherence and leak fail-closedDNS leak
UAT-052Exit-IP / identity drift detectionLong-run drift
UAT-053Proxy health quarantineBad endpoint exclusion
UAT-054Cross-context identity separationIsolation
TC-unitdetect_drift_flags, preferred_lease_hash, identity_preserving_failover, network_budget_without_price, capacity_is_enforced_at_register, two_contexts_produce_isolatedImplementation proofs

Test-source-of-truth rule

KindPath
Canonical UAT IDsuat/manifest/v1/uat-manifest.json
Harness contractsuat/contracts/
Domain unit testscrates/webx-server/src/session_identity.rs (inline), proxy_manager.rs, contexts.rs
Docs mirrordocs/MANAGED_PROXIES.md, this system record, docs/UAT_RUNBOOK.md
Production authoritydocs/PRODUCTION_AUTHORITY_HARDENING_2026-08-09.md

Synchronization: UAT contracts assert source tokens and run focused cargo tests; do not re-implement WebX in Python toys.


15. Architecture Alternatives

Option A — Independent knobs (status quo ante)

Advantages: Simple; maximum caller freedom.
Disadvantages: Contradictions; silent trust failures; weak audit.
When it wins: Throwaway scrapes with no login stickiness.

Option B — Unified SessionIdentity composition (chosen)

Advantages: Single source of truth; policy ladder; secret-free evidence; sticky continuity; distance-bounded failover.
Disadvantages: More code paths; operators must configure inventory/geo-check for full value; default permissive still allows weak mode.
When it wins: Logged-in, geo-sensitive, auditable automation (WebX’s market).

Option C — Full probabilistic anti-detect browser farm

Advantages: Marketing appeal.
Disadvantages: Arms race, legal/ToS risk, unprovable claims, huge maintenance.
When it wins: Not aligned with WebX “honest verification” positioning.

Decision matrix

CriterionWeightA IndependentB Unified identityC Anti-detect farm
Product fit (trustable automation)HighLowHighMisleading high
Reliability / honestyHighLowHighLow (opaque)
SimplicityMediumHighMediumLow
Delivery speedMediumHighMediumLow
Operating costMediumLowMediumHigh
ReversibilityMediumHighHigh (policy env)Low

Selected: Option B with policy ladder and explicit non-goals against Option C claims.


16. Decision Log

ADR-001 — Unified SessionIdentity as composition root

StatusAccepted
ContextFingerprint, proxy, and context were independent and could contradict
DecisionIntroduce SessionIdentity + IdentityValidator as single composition point
AlternativesKeep independent knobs; soft warnings only
WhyTrust layer requires evidence; fail-closed needs a single object to validate
Consequences (+)Auditable digests; clearer launch code
Consequences (−)Launch path complexity
ReversibilityModerate (types wired into launch)
Revisit whenSchema needs multi-hop identity graphs or hardware-backed attestation

ADR-002 — Default policy permissive; coherent/strict opt-in

StatusAccepted
ContextExisting clients must not break on day one
DecisionWEBX_IDENTITY_POLICY default permissive; admission uses try_from_env fail-closed on unknown values
WhyBackward compatibility + safe misconfiguration detection
Revisit whenMajority of production tenants ready for coherent default

ADR-003 — Identity distance failover with hard country barrier

StatusAccepted
ContextFailover that changes country breaks sticky login trust
DecisionWeighted identity_distance; MAX_SAFE_IDENTITY_DISTANCE = 50; country delta = 100
WhyCountry changes must never be silent under identity-preserving mode
Revisit whenProduct explicitly supports multi-country rotation policies

ADR-004 — Secret-free context network identity file

StatusAccepted
ContextSticky network needed beside cookies without credential sprawl
Decisionwebx-network-identity.json stores digests/preferences only
WhyDisk profiles are sensitive enough without proxy passwords
Revisit whenPortable context v2 encrypts blobs in object storage

ADR-005 — Honest null observed geography

StatusAccepted
ContextTemptation to echo requested country as observed
DecisionNever fabricate observedCountry
WhyReceipts must be evidence, not theater
Revisit whenN/A (invariant)

ADR-006 — No probabilistic anti-detect claims in identity modules

StatusAccepted
ContextMarket pressure to claim “undetectable”
DecisionBanned language in identity/proxy modules; UAT contract asserts absence
WhyAlign with verified-execution product honesty

17. Implementation Journey

Phase 1 — Fingerprint foundation

HypothesisVersioned fingerprint profile can bind UA/platform/locale/timezone consistently
What we builtFingerprintProfile (webx.fingerprint.v1), validation, stealth application, UA client hints binding
Evidencewebx-browser stealth tests; production authority doc
SurpriseLive Chrome major vs profile major must be checked after connect
Mistake / limitationProfile alone does not fix network contradictions
DecisionProceed to unified composition
LessonValidate against Browser.getVersion, not only config strings

Phase 2 — Managed proxy receipts & inventory

HypothesisLeasing by geo + observed exit country creates real evidence
What we builtProxyManager, inventory refresh, quarantine, proxy receipt, bandwidth metering
Evidencedocs/MANAGED_PROXIES.md; unit tests
SurpriseSticky reuse and failover need identity distance, not only geo string match
LessonFail closed when inventory cannot satisfy — never silent region downgrade

Phase 3 — SessionIdentity platform (this branch)

HypothesisComposing browser + network + persistence policy closes the integrity hole
What we builtsession_identity.rs, continuity enforcement, context bind/load, launch integration, metrics, UAT-047..054
EvidenceBranch commits: coherent identities, persistent network continuity, profile flush, fingerprint major binding
SurprisePrior context must not copy lease hash into “active lease” claims on direct sessions
Mistake avoidedFabricating verified geography at lease time before egress check
LessonContinuity is a first-class error (IdentityContinuity), not a log line

Phase 4 — Operational hardening (ongoing)

HypothesisMetrics + UAT gates make the platform operable
What we builtBounded metrics; UAT contracts running cargo proofs; docs
RemainingPromote coherent default carefully; portable context v2; multi-worker sticky storage

18. Product Feedback Loop

FeedbackSourceInterpretationChange
“Sessions re-login randomly”Operator anecdotesNetwork identity changed beside cookiesSticky ContextNetworkIdentity + preferred lease
“Proxy said US but site localized DE”Support-style reportsTimezone/locale vs geo contradictionCoherence checks timezone/locale vs country
“Just pick any proxy”Integrator convenienceConflicts with evidence productReject unavailable geo; no silent downgrade
“Don’t break our existing scripts”IntegratorsNeed compatibilityDefault permissive policy
Production audit findingsCOMPLEX_PRODUCTION_AUDIT / authority hardeningNeed release evidenceUAT expansion + fail-closed production coverage
What users saidWant “stealth that always works”Overclaim riskExplicit non-goals; banned marketing language
What telemetry will showValidation failures / drift countersConfig quality vs code bugsOperator runbooks for inventory/fingerprint

19. Rollout Strategy

StageAudienceExit criteria
0. Local / unitEngineersCargo identity/proxy/context tests green
1. UAT harnessCI / release engpython3 -m uat.runner --profile local-deterministic includes UAT-047..054 contracts
2. Internal dogfoodPlatform team on staging/single-nodeManaged pool configured; coherent policy manual tests
3. Limited tenantsHigh-assurance customers opt-in WEBX_IDENTITY_POLICY=coherentNo unexpected admission regressions
4. Percentage / cohortBroader productionMetrics stable; support playbooks ready
5. GA default reconsiderProduct decisionEvidence that permissive default is the residual risk

Feature flag

FlagWEBX_IDENTITY_POLICY
Defaultpermissive (unset/empty)
ScopeDeployment / process environment
OwnerPlatform engineering
Removal planNot a temporary flag — permanent policy ladder; “removal” means choosing a new default, not deleting the control

Related flags: WEBX_FINGERPRINT_PROFILE_JSON, WEBX_PROXY_POOL*, WEBX_PROXY_INVENTORY_*, WEBX_PROXY_GEO_CHECK_URL.


20. Rollback Strategy

QuestionAnswer
Can application code be rolled back?Yes — standard image/deploy rollback
Can schema changes be rolled back?Identity files are additive JSON; durable DB migrations follow expand/contract separately
Can previous version read new identity files?Unknown fields may be ignored if serde allows; fingerprint uses deny_unknown_fields — pin schema carefully
Can the feature be disabled independently?Yes — set WEBX_IDENTITY_POLICY=permissive and omit fingerprint/managed proxies
In-flight operations?Running sessions keep their process; new admissions follow new binary/env
How do operators know rollback succeeded?Health/ready; acquire success rate; absence of new identity failure spike

Rollback command (illustrative): re-deploy previous webx-server image/tag; restore prior env ConfigMap/Secret; kubectl -n webx rollout undo deploy/webx-api (adjust to live manifests).

Rollback validation: GET /health, GET /ready; create a session without managed proxy; confirm permissive admission; check metrics not stuck failing.


21. Database / Schema Evolution

Identity platform MVP does not require a new SQL table for SessionIdentity; sticky network identity is a file beside the Chromium profile. Durable session catalogue remains in SQLite/Postgres (sessions, logs, etc.).

Evolution concernGuidance
Additive JSON fields on ContextNetworkIdentityPreferred
Fingerprint schema bumpNew webx.fingerprint.vN with explicit support window
Session identity schema bumpNew webx.session-identity.vN
Simultaneous old/new binariesKeep digests version-prefixed (webx.session-identity.v1\0)
BackfillNone for files; missing file ⇒ no prior network
Failed halfway writeSmall JSON replace; next bind overwrites
Postgres HAOperator-owned (enterprise manifest requires external HA)

Prefer expand → observe → contract for any future SQL-backed identity catalogue.


22. Capacity Planning

Current load (qualitative)

DimensionNote
Concurrent sessionsDeployment-dependent (POC 4; scale per docs/SCALING.md)
Identity CPUNegligible
Proxy inventory size10s–100s entries typical for static pools
Geo-check QPSOne per lease verification (optional)
DiskProfile dirs dominate; identity JSON trivial

Expected growth

HorizonDriver
3 monthsMore managed geo tenants; coherent opt-in
12 monthsMulti-replica sticky contexts may force shared storage / context v2
24 monthsMulti-region sticky egress productization

Resource bottlenecks

ResourceCurrentLimitHeadroom
Chrome processesPrimary costNode memory/CPUScale browser pool
Proxy vendor capacityExternalVendor contractMulti-provider inventory
Geo-check APIOptional dependencyProvider rate limitsCache carefully without lying
Profile diskGrows with contextsVolume sizeRetention / flush on release

23. Cost Model

UnitDrivers
Cost / sessionChrome runtime + LLM (agent) + proxy bandwidth/time
Cost / managed leaseVendor pricePerSession / GB / minute when configured
Cost / identity feature itselfNear-zero compute; engineering cost is correctness
Network budgetnetwork_usd / microusd metering; unknown pricing → unevaluable fail

Architecture choice: pay for honest managed egress + browser time, not for fake fingerprint entropy.


24. Dependencies

DependencyPurposeFailure modeOwnership
Chrome / Chromium process tierBrowserSession failWebX image pin
CDPControlLaunch/control failwebx-browser
Proxy inventory / vendorEgressUnavailable / quarantineOperator
Geo-check URLObserved countrynull / strict failOperator config
Disk profile volumeContextsLose stickinessOps
Postgres (multi-replica)Durable catalogueReadiness fail closedOps
LLM providerAgent decide (not identity core)Task failConfig

25. Configuration Reference

VariableMeaningDefault
WEBX_IDENTITY_POLICYpermissive | coherent | strictpermissive
WEBX_FINGERPRINT_PROFILE_JSONImmutable fingerprint profile JSONunset
WEBX_PROXY_POOL / _FILELegacy static pool JSONunset (managed opt-in)
WEBX_PROXY_INVENTORY_FILERefreshable inventoryunset
WEBX_PROXY_INVENTORY_URLSSigned HTTPS inventory endpointsunset
WEBX_PROXY_INVENTORY_SIGNING_SECRETHMAC for inventoryunset
WEBX_PROXY_GEO_CHECK_URLExit geo verificationunset → observed null
WEBX_PROFILES_DIRProfile/context roottemp webx-profiles
WEBX_DB_URLDurable storeSQLite local / Postgres prod cluster
WEBX_RUNTIME_PROFILEproduction / high_assurance constraintsdev-friendly local

26. Deployment

EnvironmentNotes
Localcargo run -p webx-server; optional pool JSON; permissive
Single-node k8sops/webx-single-node.yaml
Enterprisek8s/webx-enterprise.yaml — external HA Postgres, browser pool options
Production URLhttps://webx.agentslab.host

Deploy identity platform by shipping webx-server + webx-browser with inventory secrets configured. No separate microservice.


27. Operational Runbook

Symptom: managed proxy 400 unavailable

  1. Confirm inventory env/file loaded.
  2. Confirm requested geo exists and not all quarantined.
  3. Check healthCheckUrl endpoints.
  4. Review webx_proxy_geo_mismatch_total and connection failures.
  5. Fix inventory; wait quarantine expiry; retry.

Symptom: identity coherence rejection

  1. Read error detail (timezone, locale, mobile+desktop, country mismatch).
  2. Align WEBX_FINGERPRINT_PROFILE_JSON with requested geo.
  3. Or temporarily use permissive only if product accepts weaker guarantees.

Symptom: context reuse continuity failure

  1. Ensure second session requests managed proxy compatible with prior snapshot.
  2. Inspect contexts/<id>/webx-network-identity.json.
  3. If intentional new identity, create a new context id.

Symptom: drift mid-session

  1. Check vendor rotation policy vs per_session expectation.
  2. Inspect quarantine and failover metrics.
  3. Prefer sticky lease hash; avoid multi-country inventory for sticky logins.

Symptom: Chrome major mismatch

  1. Align fingerprint browser_version major with pinned browser image.
  2. Rebuild/redeploy matching image (Dockerfile.fullchrome / process tier pin).

28. Incident Response

SeverityExampleResponse
SEV-1Coherent tenants cannot acquire any leasePage platform; freeze deploy; fix inventory/geo-check
SEV-2Drift spike causing re-login stormsDisable aggressive failover; pin sticky; notify affected tenants
SEV-3Single bad fingerprint configFix env; no full rollback

Preserve evidence: session logs, proxy receipts, identity digests, metrics windows.


29. Backup and Recovery

ArtifactBackupRestore
SQLite / Postgresops/webx-backup.sh / pg_dumpRestore DB then artifacts
Context profiles + network identity filesPart of /data or profiles volumeRestore volume; verify JSON loads
Proxy inventory secretsSecret managerRe-apply secrets (not from session backups)

Network identity without profile cookies is incomplete stickiness; restore both.


30. Security Operations


31. Compliance / Audit posture

NeedHow identity helps
Prove which egress was usedProxy receipt + optional observed country
Prove browser surfaceFingerprint + profile digest
Prove continuity policyidentityPolicy + identityPolicyVersion on provenance
Avoid secret sprawl in auditsDigests and hashes only

Does not by itself satisfy industry compliance certifications; it provides evidence primitives.


32. Known Limitations

  1. Default permissive allows contradictory identities if callers do not opt into coherent/strict.
  2. Timezone/locale plausibility maps are conservative high-value rules, not a complete IANA×ISO database.
  3. In-process quarantine state is not a distributed consensus fabric.
  4. Context stickiness is filesystem-local unless shared volume / future context v2.
  5. Not a bot-bypass product.
  6. per_request / on_failure rotation recorded for vendor adapters; static pool treats as per-session semantics.
  7. Shared-context orchestrator tier does not materialize on-disk context persistence.

33. Evolution Triggers

Revisit architecture when:


34. Open Questions

  1. When should production default move from permissive → coherent?
  2. Should Browserbase session responses expose a public identity provenance object beyond proxy receipt?
  3. What is the supported retention for context profiles in paid tiers?
  4. Which geo-check providers are blessed for high-assurance strict mode?
  5. How should network budgets interact with multi-provider price hints in scheduling?

35. Glossary

TermMeaning
SessionIdentityAuthoritative composed browser+network document
FingerprintProfileVersioned browser surface configuration
Coherent policyFail closed on high-value contradictions
Strict policyCoherent + require verification / fail on DNS leak signals
Lease hashOne-way identifier for a managed proxy allocation
Identity distanceWeighted dissimilarity for failover safety
Context network identitySticky secret-free snapshot beside Chromium profile
Observed countryServer-verified exit country, never fabricated
ODEVObserve → Decide → Execute → Verify agent loop

36. FAQ (handoff completeness)

QuestionAnswer
What is it?Unified browser+network identity composition and enforcement for WebX sessions
Who is it for?Integrators, operators, and logged-in automation workloads on WebX
What problem does it solve?Contradictory UA/geo/proxy/context state and unprovable egress identity
What are the invariants?See §4 INV-01..12
What is in/out of scope?§5
How does a request flow?§6.3
What is the data model?§7
What are the APIs?§8
Critical journeys?§9 J-01..J-04
What are SLOs?Prefer refuse-over-lie; platform durable-terminal SLO in ops rules
How do we know it is healthy?Proxy/identity metrics + UAT-047..054
How do we deploy it?Ship webx-server with env inventory + policy
How do we roll it back?Previous image + permissive policy
How do we recover bad state?Fix inventory; new context; release sessions
Largest security risks?Proxy credential leakage; cookie profile theft; fabricated geo if invariant broken
Largest scaling limit?Chrome + multi-worker sticky storage
What makes it expensive?Browser time + paid egress, not identity CPU
Why this architecture?Honesty + continuity for logged-in automation
Alternatives rejected?Independent knobs; anti-detect farm claims
Assumptions?Process-tier profiles; operator-configured inventory; policy ladder
When revisit?§33
Who owns production?WebX platform team

37. Source Map (debug index)

ConcernFile
Compose / validate / distance / driftcrates/webx-server/src/session_identity.rs
Acquire / quarantine / inventory / pricingcrates/webx-server/src/proxy_manager.rs
Context bind/loadcrates/webx-server/src/contexts.rs
Agent launch integrationcrates/webx-server/src/run_launch.rs
Browserbase pathcrates/webx-server/src/browserbase_compat.rs
Manifest provenancecrates/webx-server/src/run_manifest.rs
Metricscrates/webx-server/src/metrics.rs
Fingerprint + stealthcrates/webx-browser/src/stealth.rs
Managed proxy product docdocs/MANAGED_PROXIES.md
Authority hardeningdocs/PRODUCTION_AUTHORITY_HARDENING_2026-08-09.md
Scalingdocs/SCALING.md
UAT runbookdocs/UAT_RUNBOOK.md
UAT casesuat/manifest/v1/uat-manifest.json
Identity contractsuat/contracts/test_identity_network_contracts.py

38. Change History (implementation)

Commit (branch history)Summary
c4819a8Bind UA client hints to fingerprint profiles
7d4c78fHarden production authority and release evidence
bbf9e1c / c5ee65dPersistent Chrome profile reuse + flush on release
8872a12Build coherent browser and network identities
ea7f04fEnforce persistent network identity continuity
RelatedIdempotent retained continuations; replay; UAT harness expansion

39. Risks Register

RiskLikelihoodImpactMitigation
Tenants stay on permissive foreverHighWeak guaranteesProduct migration plan
Geo-check provider outageMediumStrict admissions failTimeout + runbook; multi-provider later
Shared FS missing multi-replicaMediumSticky break across podsSession affinity / context v2
Over-tight timezone maps false rejectLow–MedFalse admissions denyConservative unknowns pass
Operator mislabels inventory geoMediumMismatch / quarantineobservedCountry evidence

40. Handoff Checklist

A senior engineer can answer:

If any checkbox fails for a reader, update this record.


41. Quick Reference

# Install / build
cargo build -p webx-server

# Development server
cargo run -p webx-server

# Static checks
cargo fmt --all -- --check
git diff --check -- . ':!combined_project.txt'

# Unit tests (identity-focused)
cargo test -p webx-server --lib detect_drift_flags
cargo test -p webx-server --lib preferred_lease_hash
cargo test -p webx-server --lib identity_preserving_failover
cargo test -p webx-server --lib two_contexts_produce_isolated
cargo test -p webx-server --lib network_budget_without_price
cargo test -p webx-server --lib capacity_is_enforced_at_register
cargo test -p webx-browser --lib stealth

# UAT harness contracts
python3 -m unittest discover -s uat/contracts -v

# Deterministic UAT profile
python3 -m uat.runner --profile local-deterministic

# Production build (image)
docker build -f Dockerfile.fullchrome -t webx-server:local .

# Run task (local)
curl -X POST http://localhost:8081/api/tasks \
  -H "x-api-key: $WEBX_API_KEY" -H "Content-Type: application/json" \
  -d '{"task":"Go to https://example.com and report the main heading."}'

# Managed session (Browserbase-shaped)
curl -X POST https://webx.agentslab.host/v1/sessions \
  -H "X-BB-API-Key: $WEBX_API_KEY" -H "Content-Type: application/json" \
  -d '{"timeout":300,"proxies":[{"type":"webx","geolocation":{"country":"US"}}]}'

# Health
curl -s https://webx.agentslab.host/health
curl -s https://webx.agentslab.host/ready

# Deploy / rollback
# (environment-specific) kubectl -n webx rollout undo deploy/<webx-api>

# Recovery
# Fix WEBX_PROXY_* inventory; release stuck sessions; recreate context if identity file corrupt

Recommended production identity settings (high assurance)

WEBX_IDENTITY_POLICY=coherent   # or strict
WEBX_FINGERPRINT_PROFILE_JSON='{"schema_version":"webx.fingerprint.v1", ...}'
WEBX_PROXY_INVENTORY_FILE=/secrets/proxy-inventory.json
WEBX_PROXY_GEO_CHECK_URL=https://ipinfo.io/json

42. Related Artifacts

ArtifactPurpose
README.mdProduct entry point
/docs portalConsumer-facing documentation catalog (served by webx-server)
/docs/session-identityIntegrator guide
This documentSystem record for Session Identity Platform (/docs/session-identity-system-record)
docs/portal/Portal catalog + consumer guides (embedded at build time)
docs/MANAGED_PROXIES.mdProxy product contract
docs/BROWSERBASE_MIGRATION.mdSessions API migration
docs/SCALING.mdMulti-replica topology
docs/UAT_RUNBOOK.mdAcceptance operations
docs/PRODUCTION_AUTHORITY_HARDENING_2026-08-09.mdRelease authority
docs/USER_GUIDE.mdLive API guide
uat/manifest/v1/uat-manifest.jsonBehavioral acceptance IDs
ops/webx-slo-rules.yamlRuntime SLO alerts
ops/webx-backup.shBackup tooling

43. Document Maintenance Contract

Update this record when there is a material change to:

Do not preserve obsolete instructions merely because they once existed.
Use ADRs and implementation journey for history.
Keep operational instructions describing what works today.


44. Final Engineering Principles

  1. Start with the problem — coherent, sticky, provable identity for logged-in automation.
  2. Architecture is boundaries and invariants — not a fingerprint JSON alone.
  3. Explicit tradeoffs — consistency over availability under coherent/strict; compatibility under permissive.
  4. Design failure intentionally — no safe failover is better than a silent country hop.
  5. Operability is part of the feature — metrics, quarantine, UAT IDs.
  6. Tests protect risks and invariants — UAT-047..054 map to INV-*.
  7. Irreversible decisions carefully — schema versions and default policy changes.
  8. One canonical source of truthSessionIdentity composition; UAT IDs in manifest.
  9. Measure outcomes after shipping — validation failure and drift rates, not just deploys.
  10. Document why — ADRs record rejected anti-detect fantasy.
  11. Record mistakes without rewriting history — e.g., never copy prior lease into a fake active lease.
  12. Define when to change — multi-worker sticky storage and default policy promotion are explicit triggers.

45. Final System Statement

Session Identity Platform exists to help automation integrators, operators, and logged-in portal workflows accomplish browser sessions whose fingerprint, geography, egress, and sticky context remain coherent, evidence-backed, and fail-closed when integrity cannot be guaranteed. It is implemented using a unified SessionIdentity composition root in webx-server, integrated with ProxyManager acquisition, process-tier Chrome profiles, and FingerprintProfile stealth application, because independent knobs produced silent trust failures and unprovable receipts. The system guarantees secret-free provenance, non-fabricated observed geography, identity-distance-bounded failover, and continuity enforcement under coherent/strict policies, operates within backward-compatible default permissive mode, existing auth, and operator-supplied proxy inventory, and is considered healthy when acquire/validation metrics are stable, UAT-047..054 pass, and high-assurance tenants do not see silent country or fingerprint major drift. Its most significant current risks are permissive-default underuse, filesystem-local sticky contexts in multi-replica deployments, and operator inventory misconfiguration. The architecture should be reconsidered when portable multi-worker context storage or a production default of coherent becomes mandatory. Production ownership belongs to the WebX platform / browser runtime team.


This is a living engineering record. It should contain enough product context, architectural reasoning, operational knowledge, and implementation history for another senior engineer to safely understand, operate, challenge, extend, migrate, or replace the Session Identity Platform within WebX.