Skip to content

Document managed auth attempt outcomes - #778

Draft
akxue wants to merge 8 commits into
mainfrom
hypeship/managed-auth-attempt-outcomes
Draft

akxue wants to merge 8 commits into
mainfrom
hypeship/managed-auth-attempt-outcomes

Conversation

@akxue

@akxue akxue commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

merge only after the managed auth api changes that add last_attempt and outcome are deployed. this page documents fields the public api doesn't return yet.

context

managed auth reports a failed login as error_code and error_message only. neither says which part of the login stopped, error_code falls back to flow_failed for many distinct causes, failed health checks aren't recorded, health checks carry no reason, and replay links open at the start of the video. the api is adding one outcome object, shared by the connection (last_attempt), timeline events (outcome) and managed_auth_state sse events (outcome), plus a typed code set (ManagedAuthOutcomeCode, 30 values). this pr documents that phase 1 surface as implemented in the api pull requests, not only as drafted. login instructions are a later phase and aren't mentioned.

changes

  • new page auth/attempt-outcomes.mdx (sidebar: managed auth > outcomes, after lifecycle):
    • where the outcome appears, which surfaces carry type and at, and that last_attempt and outcome can be absent or null while fields inside an outcome are always present
    • every field with when it's null: phase is null on attempts recorded before it existed; health_check_evidence is set on SUCCEEDED, SIGNED_OUT and INCONCLUSIVE checks and null on FAILED checks
    • debug_message format: fixed text per code, then Phase: <phase>., left out when the phase is unknown
    • replay.offset_ms, counted from the recording's real start as the browser's recorder reports it; null on success and whenever that start is unknown, including every attempt recorded before this ships
    • codes for health checks that end with an error: the browser couldn't start (browser_create_failed), the browser failed while checking (browser_error), a provider outage (provider_unavailable), no result or any other error (internal_error). a check whose verification reports an error is FAILED, never SIGNED_OUT
    • last_attempt and outcome are absent, not null, when there's nothing to report
    • when last_attempt is replaced: a login or reauth when it ends or pauses, and it stays last_attempt from its pause until it ends; a canceled attempt counts only if it paused. a health check when it changes the connection's status, whatever its result, or when it is INCONCLUSIVE on an AUTHENTICATED connection; checks recorded before results existed count as SIGNED_OUT or SUCCEEDED when they changed the status. the page lists the causes and codes of checks that can't run. a key for the hosted login page sees only its own session's attempt
    • unhandled_page: start a new login, and report the connection id if it repeats, matching the shipped debug_message
    • pauses, and an unsolved hitl CAPTCHA ending FAILED / captcha_blocked
    • the timeline now lists FAILED and INCONCLUSIVE health checks whose status is the status before the check; readers are told to use outcome.result to tell a pass
    • sse: outcome is set on every state event for a flow that has ended or is paused, including the first event after connecting; null while running and on canceled flows
    • all 30 outcome codes, grouped by result, with meaning and action
    • how code relates to the unchanged error_code: new codes and newly mapped failures under flow_failed, expired attempts with no error_code, and the older codes that map (mfa_required and unsatisfiable_challenge to customer_input_required, region_not_enabled to insufficient_plan, network_error to website_error, bot_detected to captcha_blocked)
    • typescript and python examples
  • auth/connection-lifecycle.mdx: short pointers from the health check step, the failure section and the debugging section to the new page. the existing error_code table is unchanged.
  • docs.json: nav entry.

testing and validation

  • mint validate: strict build passed.
  • mint broken-links (whole site): no broken links.
  • mint broken-links --check-anchors on the two changed pages: no broken links.
  • mint dev: /auth/attempt-outcomes and /auth/connection-lifecycle return 200, and the new sections are in the rendered html.
  • names compared with the api spec of the api pull request (openapi.yaml enums): all 30 outcome codes, 5 results, 3 phases, 6 evidence values and 3 types are on the page, and every backticked name on the page is in the spec, the legacy mapping or the existing status values.
  • the last_attempt rule, the sse outcome description, the last_attempt schema description and the debug_message templates were checked against the api pull request at its latest head.
  • the error code mapping was read from lib/managedauth/outcome.go, the read-time rules and the sse rule from the api handler, the expired-session codes from the workflow cleanup, and the fail-closed behavior from the health check activity.
  • not run: the code samples aren't type-checked, because the sdks don't have these fields yet. go samples are left out until the go sdk field names exist.

open questions

  • casing: body prose is lowercase with KERNEL in caps and headings follow the repo's title case and sentence case rules, the same mix as auth/programmatic.mdx. the rest of the auth section uses sentence-case prose. which convention should this page follow?
  • three overnight decisions in the api need your confirmation; the docs follow them: (1) a health check replaces last_attempt when it changes the status, whatever its result; (2) a paused login or reauth stays last_attempt until it ends, and a canceled one counts only if it paused; (3) a hosted login page key sees only its own session's attempt. i'd confirm all three.
  • should an errored legacy-verifier check keep the status? today an older verifier that reports an error records FAILED with status NEEDS_AUTH (existing, versioned workflow behavior), so it replaces last_attempt. the docs state this as is. i'd keep it for phase 1: the check still ends FAILED with its code, and changing the versioned status write is out of scope.
  • the contract's actions for SIGNED_OUT, INCONCLUSIVE, login_form_not_found, account_choice_required and unhandled_page mention login instructions. this page leaves those out until the login instructions docs land.
  • the contract says to check "the check page (auth_check_url)", but that field isn't public. the page says "the page that health checks open" and points to a recorded health check's replay.

@mintlify

mintlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Kernel 🟢 Ready View Preview Nov 23, 2026, 12:32 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

This branch was successfully deployed

1 active deployment
staging — 0523f460 Deployed Nov 23, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant