UI + UX Trust, Safety, And Privacy standard

Sensitive-data reveal

Provide a controlled reveal surface that starts masked, names the sensitive field, gates high-risk access, reveals only the minimum needed scope, gives an immediate hide path, manages copy and timeout behavior, announces state changes, and records auditable access without storing or emitting the raw value in unsafe places.

Decision first

Choose this pattern when the problem matches

Use when

  • Users need to inspect, copy, verify, rotate, transcribe, or compare a sensitive value that should normally stay masked or redacted.
  • The product can enforce reveal policy, provide hide and timeout behavior, and protect logs, clipboard, telemetry, and client data from accidental raw-value leakage.

Avoid when

  • The task is only entering a password into an authentication form; use password input.
  • The task is formatting a non-secret structured value while typing; use input mask.
  • The user is confirming a destructive target phrase; use typed confirmation.
  • The user is granting access to a device resource; use permission request.
  • The current role is not allowed to view even a partial value; use permission denied state or a redaction boundary.

Problem it prevents

Products often need to let users inspect or transfer sensitive values, but uncontrolled reveal exposes secrets to shoulder surfing, screenshots, logs, clipboard leakage, support tools, or accidental persistence.

Pattern anatomy

What a strong implementation has to make clear

User need

The value may be a password, API key, token, recovery code, secret variable, certificate, bank account, card number, tax identifier, health identifier, email, phone number, address, or private record excerpt.

Pattern promise

Provide a controlled reveal surface that starts masked, names the sensitive field, gates high-risk access, reveals only the minimum needed scope, gives an immediate hide path, manages copy and timeout behavior, announces state changes, and records auditable access without storing or emitting the raw value in unsafe places.

Required state

Masked state with the field identity, safe suffix or count, and reveal eligibility.

Recovery path

A secret is visible on page load, print, export, screenshot, or shared-screen mode.

Access contract

Use a labelled button or toggle whose accessible name includes the field, such as Show API key or Hide account number.

Quality bar

The difference between expert and weak execution

Strong implementation

Specific, visible, recoverable

  • An API key row shows sk_live_****9H2Q by default, requires Reauthenticate before Full reveal, logs the reveal event, and automatically hides after 30 seconds.
  • A bank-account review shows only the last 4 digits until the user chooses Reveal full account number, then offers Hide now and warns before copying to clipboard.
  • A developer needs to rotate a webhook secret, reveals it after step-up verification, copies it with a visible clipboard warning, then sees it auto-hide with an audit ID.
  • A support agent can partially reveal a customer's phone number for verification but cannot reveal the full tax ID because policy allows only the last four digits.
Weak implementation

Vague, hidden, hard to recover from

  • A dashboard shows API keys in plain text by default and copies them to clipboard without warning or audit.
  • A password field reveals after focus leaves the field and has no hide action, so the secret stays visible while the user moves through the form.
  • A user opens billing details in a shared office and the full card number appears automatically with no warning.
  • A user taps a copied state and the interface silently places a raw token on the clipboard while the token remains hidden on screen.
UI guidance
  • Render sensitive-data reveal as a masked value with an explicit reveal action, visible hide action, clear field identity, safe default state, reveal duration or hold behavior, and status feedback that explains what is visible now.
  • Use partial reveal, hold-to-reveal, timed reveal, reauthentication, clipboard warnings, and audit events according to the sensitivity and consequence of the value.
UX guidance
  • Use sensitive-data reveal when users need to verify, compare, copy, rotate, recover, or transcribe a sensitive value that is normally masked or redacted.
  • Keep the user in control of when the value appears, make hiding easy, avoid accidental reveal on focus or hover, and never leak the raw value into logs, URLs, analytics, screenshots, or unrelated UI.
Implementation contract

What the implementation must handle

States

  • Masked state with the field identity, safe suffix or count, and reveal eligibility.
  • Reveal action state with an explicit button or toggle that names what will become visible.
  • Hide action state while the value is visible.
  • Hold-to-reveal or peek state for short-lived inspection.

Interaction

  • The value is masked by default unless the user is actively entering it and the platform-specific control intentionally permits display.
  • Reveal requires a deliberate keyboard- and pointer-accessible action that names the target value and does not sit so close to unrelated controls that accidental reveal is likely.
  • Visible values have an equally reachable hide action and may auto-hide after timeout, blur, navigation, screen lock, or policy-triggered expiry.
  • High-risk values require step-up verification, role check, reason capture, approval, or audit recording before full reveal.

Accessibility

  • Use a labelled button or toggle whose accessible name includes the field, such as Show API key or Hide account number.
  • Expose pressed or expanded state for persistent reveal toggles and status text for temporary peek or timed reveal states.
  • Announce shown, hidden, copied, expired, denied, and redacted outcomes through status text without placing the raw secret in the announcement unless the user explicitly requested reading it.
  • Keep reveal, hide, copy, reauthenticate, and cancel controls reachable by keyboard and separated from adjacent destructive controls.

Review

  • What exact sensitive value is masked, and why does this user need to reveal it?
  • Is partial reveal enough for this task?
  • What policy, role, reauthentication, reason, or audit event is required before full reveal?
  • How does the user hide the value immediately, and when does it auto-hide?
Interactive lab

Inspect the states before you copy the pattern

Reveal sensitive values only under user control

Move a sensitive-data reveal surface through masked state, reveal action, hide action, hold-to-reveal, timed reveal, reauthentication, partial reveal, full reveal, copy while hidden, clipboard warning, audit event, redaction boundary, shoulder-surfing warning, expired reveal, screen reader announcement, and mobile compact states; compare with auto-revealed secret, permanent visible, copied silently, wrong field revealed, no hide action, reveals after blur, and logs raw secret failures.

Sensitive-data reveal
Interactive demo is ready

Launch the live UI/UX lab when you want to inspect states, keyboard behavior, and common failure modes.

State To Inspect

Masked state with the field identity, safe suffix or count, and reveal eligibility.

Keyboard / Access

Tab reaches the masked value label, reveal control, copy control, policy detail, and hide control in a logical order.

Avoid Generating

Showing sensitive values in plain text by default.

Evidence trail

Source-backed claims behind this guidance

NIST SP 800-63B Passwords

National Institute of Standards and Technology - checked

Supports offering a display option for entered passwords, paste support, password-manager compatibility, and user control based on observation risk.

HashiCorp Helios Design System: Masked Input

HashiCorp - checked

Supports masked input for non-password sensitive values, show and hide controls, copy button behavior, secret-key and token examples, and visual-obfuscation limits.

Full agent/debug reference

Problem Context

  • The value may be a password, API key, token, recovery code, secret variable, certificate, bank account, card number, tax identifier, health identifier, email, phone number, address, or private record excerpt.
  • The user may need to check a typed value, compare a stored value, copy a generated secret, verify identity, transcribe a code, rotate a credential, or confirm a financial identifier.
  • The surface may need different policies for partial reveal, full reveal, one-character peek, hold-to-reveal, timed reveal, reauthentication, admin approval, audit logging, copy restrictions, and permanent redaction.
  • The design must balance entry accuracy and accessibility with the risk of nearby observers, shared screens, screenshots, clipboard history, browser autofill, and telemetry leaks.

Selection Rules

  • Choose sensitive-data reveal when a normally masked or redacted value needs a deliberate temporary reveal, hide, peek, copy, partial reveal, reauthentication, or audited access path.
  • Use password input when the main task is entering a memorized secret into an authentication form rather than revealing a stored or generated sensitive value.
  • Use input mask when the goal is entry formatting for a stable structured value, not privacy masking or secure reveal control.
  • Use typed confirmation when users type a visible target phrase to confirm a destructive action; do not mask that phrase as if it were a secret.
  • Use permission request when the user grants OS or browser access to a device resource rather than showing an already-held sensitive value.
  • Use warning text when the main need is consequence warning before an action, not controlled exposure of a sensitive field.
  • Use permission denied state when policy prevents reveal or only allows partial reveal; explain the boundary without leaking the restricted value.
  • Use partial reveal for verification tasks where the last four characters, domain, issuer, or masked suffix is enough.
  • Use reauthentication, step-up verification, or admin review before full reveal of high-risk secrets such as API keys, recovery codes, financial identifiers, or customer data.
  • Do not reveal on page load, hover, focus, validation, copied state, print view, export, analytics event, URL, or console log.

Required States

  • Masked state with the field identity, safe suffix or count, and reveal eligibility.
  • Reveal action state with an explicit button or toggle that names what will become visible.
  • Hide action state while the value is visible.
  • Hold-to-reveal or peek state for short-lived inspection.
  • Timed reveal state with countdown and automatic re-mask.
  • Reauthentication or step-up required state before high-risk full reveal.
  • Partial reveal state for last four, prefix plus suffix, or policy-limited values.
  • Full reveal state when policy permits complete value display.
  • Copy while hidden state with a clear clipboard warning and copied status.
  • Clipboard warning state for values that may remain in clipboard history.
  • Audit event state showing reveal actor, time, reason, and access ID without raw value.
  • Redaction boundary state when the user can never reveal the full value.
  • Shoulder-surfing warning or shared-screen state before high-risk reveal.
  • Expired reveal state after timeout, blur, navigation, or focus loss.
  • Screen reader announcement state for shown, hidden, copied, expired, and denied reveal outcomes.
  • Mobile compact state where masked value, reveal, hide, copy, timeout, and policy status remain readable.

Interaction Contract

  • The value is masked by default unless the user is actively entering it and the platform-specific control intentionally permits display.
  • Reveal requires a deliberate keyboard- and pointer-accessible action that names the target value and does not sit so close to unrelated controls that accidental reveal is likely.
  • Visible values have an equally reachable hide action and may auto-hide after timeout, blur, navigation, screen lock, or policy-triggered expiry.
  • High-risk values require step-up verification, role check, reason capture, approval, or audit recording before full reveal.
  • Copy actions work from masked or revealed state only when allowed, warn about clipboard exposure, and confirm copy without showing the raw value in status text.
  • Partial reveal and redaction boundaries are enforced by the data returned to the client, not only by CSS or text decoration.
  • Logs, analytics, DOM labels, URLs, screenshots, exports, error messages, and support metadata do not contain the raw value unless explicitly designed as a protected evidence export.
  • Assistive technology receives accurate state announcements without reading a secret aloud unexpectedly.

Implementation Checklist

  • Classify sensitive fields by value type, reveal scope, allowed roles, reauthentication needs, copy policy, audit requirements, timeout, and redaction boundary.
  • Fetch only the minimum value needed for the current reveal state; avoid sending full raw values to the browser when policy allows only partial reveal.
  • Implement masked, partial, full, hold, timed, copied, expired, denied, policy-limited, and audit-recorded states with explicit state transitions.
  • Keep reveal and hide controls keyboard accessible, labelled by the specific field, and separated from adjacent destructive or navigation controls.
  • Disable automatic reveal on focus, hover, validation, print, export, preview, screen share, or copied state unless the user explicitly requested it.
  • Scrub raw values from telemetry, console logs, error messages, URLs, browser history, client storage, and test snapshots.
  • Test shoulder surfing, mobile tap targets, screen readers, copy clipboard behavior, reauthentication failure, audit recording, timeout, focus loss, print/export, and restricted-role redaction.

Common Generated-UI Mistakes

  • Showing sensitive values in plain text by default.
  • Revealing values on hover, focus, validation error, print preview, copied status, or after blur.
  • Providing a reveal action without a hide action.
  • Copying a hidden secret to the clipboard without warning or status.
  • Logging raw secrets in analytics, console output, support tickets, screenshots, or audit records.
  • Masking with CSS while the full value remains exposed in DOM text to unauthorized users.
  • Using one broad Show all control for unrelated secrets with different policies.

Critique Questions

  • What exact sensitive value is masked, and why does this user need to reveal it?
  • Is partial reveal enough for this task?
  • What policy, role, reauthentication, reason, or audit event is required before full reveal?
  • How does the user hide the value immediately, and when does it auto-hide?
  • What happens if the user copies while hidden or while visible?
  • Can screen readers announce the state without unexpectedly reading the secret?
  • Where could the raw value leak through DOM text, logs, URLs, analytics, screenshots, exports, or clipboard history?
Accessibility
  • Use a labelled button or toggle whose accessible name includes the field, such as Show API key or Hide account number.
  • Expose pressed or expanded state for persistent reveal toggles and status text for temporary peek or timed reveal states.
  • Announce shown, hidden, copied, expired, denied, and redacted outcomes through status text without placing the raw secret in the announcement unless the user explicitly requested reading it.
  • Keep reveal, hide, copy, reauthenticate, and cancel controls reachable by keyboard and separated from adjacent destructive controls.
  • Do not rely on icons, bullets, blur, color, or letter spacing alone to communicate masked, visible, copied, expired, or denied states.
  • On mobile, preserve tap target size, wrapping, and state text so long secret labels do not collide with reveal controls.
Keyboard Behavior
  • Tab reaches the masked value label, reveal control, copy control, policy detail, and hide control in a logical order.
  • Enter or Space activates reveal, hide, copy, reauthenticate, cancel, and reason-submit controls according to native button or toggle semantics.
  • Escape hides a currently visible value or closes a reveal confirmation without clearing the underlying value.
  • Hold-to-reveal alternatives exist for keyboard and assistive technology users, such as press-and-hold plus a persistent timed reveal option.
  • After auto-hide or expired reveal, focus remains stable and the status region announces that the value is hidden again.
Variants
  • Password show and hide
  • API key reveal
  • Token reveal
  • Recovery code reveal
  • Masked bank detail reveal
  • Card number partial reveal
  • Tax ID last-four reveal
  • Hold-to-reveal secret
  • Timed reveal with countdown
  • Step-up reveal
  • Copy secret while hidden
  • Policy redacted value

Verification

Last verified: