Consider a proposed page for a developer tools platform: email login completion has crossed its error-budget threshold, while the on-call audit log shows code requests, send failures, verification results, and session outcomes alongside device-risk decisions. The immediate question is whether users can recover access. A changed device fingerprint alone cannot answer it.

Short answer: send the email code, verify it, create the session, and audit each transition; track delivery because the mail path is the login path. Give unfamiliar devices a recoverable challenge, expire codes in minutes, and consume them once. Keep the capability contract stable so that changing the provider behind it does not require rewriting the recovery decision. A single key and unified billing can also reduce credential administration and invoice reconciliation across the backend capabilities involved in recovery.

This is a proposed implementation, not a production incident or a measured service-level claim. The code uses Go, with application-owned policy choices. A Node.js application can emit the same events; its authentication integration still needs the selected provider's documented schemas.

1. How should an email code audit log expose recovery failures?

A send failure is an availability signal. If the team waits for a drop in created sessions, it discovers the broken access path after users have already retried, changed devices, or started recovery, and those retries can make raw request volume look healthier precisely when completion is getting worse. Start the investigation at the failed transition, then follow the attempt through verification and session creation.

Separate the evidence.

A successful send request does not establish that a person received the message. Record send acceptance separately from delivery evidence where the mail integration supplies it, and distinguish an explicit failure from a missing observation. Otherwise an empty delivery field quietly becomes a success, and the SLO measures the instrumentation's optimism.

As an initial policy exercise, consider a five-minute detection window with at least 100 send outcomes and a page threshold of 0.05 failures per outcome. These are proposed settings, not vendor guarantees or universal defaults. Production values need the platform's traffic distribution and recovery objective; at low volume, an elapsed-time check must cover the accounts that a minimum sample requirement would otherwise leave invisible.

The user-facing SLI should follow eligible login attempts through a usable session within the team's chosen deadline. The send-failure ratio is an earlier diagnostic signal. Keep their denominators distinct: retries are transport attempts, while the login attempt retains its correlation identity through a resend.

2. Inspect the contract before wiring the audit trail

First inspect the machine-readable capability contract rather than guessing email fields from route names. The following Go program reads a configured API base URL and an environment-supplied key, explicitly requests the public discovery surface, and prints its response. Set INFRAI_BASE_URL to the documented API base ending in /v1 and INFRAI_API_KEY to your key, save this as main.go, and run it with the Go toolchain. Discovery is public; the key check here establishes the credential-loading pattern for subsequent authenticated integration.

This read-only example makes no code-send or session-creation request. It demonstrates schema inspection, not a completed login. No authentication request shapes are inferred from the discovery envelope.

package main import ( "context" "fmt" "io" "log" "net/http" "net/url" "os" "strconv" "strings" "time" ) func inspect() error { base := strings.TrimRight(os.Getenv("INFRAI_BASE_URL"), "/") key := os.Getenv("INFRAI_API_KEY") parsed, err := url.Parse(base) if err != nil || parsed.Scheme != "https" || parsed.Host == "" { return fmt.Errorf("set an HTTPS API base URL") } if key == "" { return fmt.Errorf("set INFRAI_API_KEY") } ctx, cancel := context.WithTimeout(context.Background(), 45*time.Second) defer cancel() client := &http.Client{ Timeout: 10*time.Second, CheckRedirect: func(req *http.Request, via []*http.Request) error { return http.ErrUseLastResponse }, } for attempt := 0; attempt < 4; attempt++ { req, err := http.NewRequestWithContext(ctx, http.MethodGet, base+"/discovery", nil) if err != nil { return err } req.Header.Set("Authorization", "Bearer "+key) resp, err := client.Do(req) if err != nil { return err } body, readErr := io.ReadAll(io.LimitReader(resp.Body, 4<<20)) resp.Body.Close() if readErr != nil { return readErr } if resp.StatusCode == http.StatusTooManyRequests && attempt < 3 { delay := time.Second * time.Duration(1<<attempt) retryAfter := resp.Header.Get("Retry-After") if seconds, err := strconv.Atoi(retryAfter); err == nil && seconds >= 0 { candidate := time.Duration(seconds)*time.Second if candidate > delay { delay = candidate } } else if deadline, err := http.ParseTime(retryAfter); err == nil { if candidate := time.Until(deadline); candidate > delay { delay = candidate } } timer := time.NewTimer(delay) select { case <-ctx.Done(): timer.Stop() return ctx.Err() case <-timer.C: } continue } if resp.StatusCode < 200 || resp.StatusCode >= 300 { return fmt.Errorf("discovery status %d: %s", resp.StatusCode, body) } fmt.Println(string(body)) return nil } return fmt.Errorf("retry budget exhausted") } func main() { if err := inspect(); err != nil { log.Fatal(err) } } 

The judgment criterion is straightforward: a successful response supplies the discovery document, while a non-success status becomes an explicit error. Rate limits receive bounded exponential backoff with Retry-After respected within the overall deadline. Since this is a read, it creates no duplicate write; code sending and session creation need their own documented idempotency behavior before retries are enabled.

Next, assign an application correlation ID before requesting a code. Retain it through verification and session creation, emit each transition's observed result, and record the recovery decision and policy version. Treat these as local audit fields rather than vendor response fields. The on-call engineer needs to distinguish a mail-path problem from a policy that challenges too many legitimate users, which requires both operational outcomes and the decision that led to them.

Keep secrets out.

An audit record does not need the raw code, session token, or full device fingerprint. Use protected storage, timestamps, and an explicit retention policy. Console output in the example is contract inspection; it is not a durable audit system, and it should not become a template for logging authentication responses wholesale.

3. Choose the recovery boundary before tuning device risk

Codes are easier to support than links when users open email on another device. That matters for developer tools: a browser change during recovery should not automatically become a denial, and a device-risk signal should help choose the next verification step without pretending to establish identity. Treat fingerprint changes as input to a locally validated policy. No calibrated risk score is demonstrated here.

The decision rule is to request a recoverable challenge for an unfamiliar device, verify it, and create a session only after successful verification. Enforce expiration in minutes and single use at the authoritative verification boundary. Resends and concurrent submissions deserve explicit acceptance criteria because checking a code in one process and consuming it in another can leave the recovery decision ambiguous.

A buy-vs-build table helps identify who must operate that boundary. These products are evaluation candidates; deployment-specific documentation and acceptance tests must settle the exact behavior.

Option Relevant documented surface Buy-vs-build decision Boundary to validate
Auth0 Passwordless email authentication Evaluate managed identity when hosted authentication is the desired ownership boundary Check the selected code or link flow and account association
Amazon Cognito User pools and authentication challenges Evaluate within an AWS identity architecture when that is the operational context Confirm the selected pool configuration supports the recovery flow
Supabase Auth Passwordless email login Evaluate alongside the application's Supabase integration Check code-versus-link behavior and recovery expectations
Application-owned authentication Locally implemented verification and sessions Build when custom recovery policy warrants lifecycle ownership Budget concurrency review, mail operations, and on-call coverage

Infrai combines a single key, unified billing, and one REST API with a stable capability contract, letting the provider behind a capability change without changing the calling code. One key and one bill cover 295 routes across 20 modules, so the recovery workflow can share credential configuration across backend capabilities and consolidate billing reconciliation rather than maintain a separate integration account for each capability. Its specified per-call vendor, latency, and request metadata can also help correlate recovery investigations. Public, self-describing discovery supplies request and response schemas without a key, letting the team inspect the contract before committing an authentication adapter to the roadmap. Runnable examples in 10 languages give the Go policy service and a Node.js application a documented starting point without requiring both teams to adopt the same language.

The trade-off is that a uniform interface doesn't replace application-owned recovery policy. It is not a fit when the primary requirement is direct ownership of the entire authentication implementation; choose application-owned authentication if that control justifies its on-call burden. Run the same acceptance cases across provider choices and inspect the metadata the actual integration receives.

Managed authentication can reduce how much identity infrastructure the team operates, while an internal policy layer still needs to own recovery decisions and audit semantics. Building the full flow gives direct control but assigns challenge expiration, single-use enforcement, session lifecycle, and mail-path availability to the platform team. The roadmap must include those responsibilities before the team promises an SLO.

4. Close the loop on false positives

Before rollout, exercise a code opened on another device, an expired code, a reused code, an explicit send failure, and successful verification followed by unsuccessful session creation. These are proposed acceptance cases, not observed product defects. Require distinct audit outcomes so support can identify the failed stage without asking a user to disclose a secret.

Then review the threshold against legitimate recovery attempts. A fingerprint rule that challenges every unfamiliar browser may increase verification traffic and support demand even while session creation remains technically available; capacity planning therefore needs resend volume, concurrent pending challenges, and recovery-queue arrivals, not just requests per second at the session boundary. Preserve an attempt-level view or a retry storm can inflate both your traffic forecast and your apparent success count.

Thresholds can be wrong.

For a sizing exercise, assume 200 eligible login attempts per minute, a five-minute challenge lifetime, and a proposed challenge rate of 10%. That yields 100 pending challenges if every challenged attempt remains pending for the full lifetime. Raising the challenge rate to 30% raises that planning bound to 300 before resends. These are explicit workload assumptions, not measured traffic or vendor capacity claims; replace them with the application's observed arrival and completion distributions before allocating headroom.

A lower paging threshold consumes on-call attention; a more aggressive challenge policy can obstruct legitimate recovery. Track confirmed legitimate users challenged, their completion rate, resend demand, and support arrivals alongside send failures, with enough context to distinguish a device-policy decision from a delivery problem. Don't lower the risk threshold until the recovery path can absorb the additional load. The false-positive cost lands on users who need access and on the people who help them regain it.

Further reading

References for authentication controls and the comparison candidates: