How iOS 12 Suggests and Autofills Secure Passwords

Apple’s iOS 12 streamlined credential management by introducing integrated tools that automatically create strong, unique passwords for new accounts and seamlessly autofill existing ones. Through deep integration between the operating system, Safari, third-party apps, and iCloud Keychain, the system eliminates the need for users to manually create, memorize, or type complex credentials, relying instead on automated detection and biometric security.

Password Detection and Generation

The process begins with field detection. Safari and native iOS applications use specific HTML attributes and UIKit text-input traits (such as textContentType = .newPassword or username) to signal to the operating system that an account is being created.

When iOS 12 identifies a registration or password-reset field, it automatically overrides the standard keyboard to display a prompt suggesting a strong, randomized password. This password typically consists of a combination of uppercase and lowercase letters, numbers, and hyphens. If the user accepts the suggestion, iOS instantly populates the field and associates the credential with the website’s domain or the app's bundle identifier.

Storage and iCloud Keychain Syncing

Once accepted, the generated password is automatically saved directly to the user’s iCloud Keychain. The credentials are encrypted using 256-bit AES encryption and protected by keys derived from the user's device passcode and hardware-based Secure Enclave.

Because it is tied to iCloud Keychain, the login information syncs across all approved Apple devices linked to the same Apple ID. This ensures that a password created on an iPhone running iOS 12 is immediately available on an iPad or a Mac running macOS Mojave without manual transfer.

The Autofill Process

When returning to an existing login page, iOS 12 detects the input fields using the same metadata analysis. Instead of generating a new secret, the system searches the Keychain for matching credentials based on the exact domain name or associated app domain.

If a match is found, the system presents the username directly above the keyboard in the QuickType bar. To insert the credentials:

  1. The user taps the suggested credential in the QuickType bar.
  2. iOS triggers an authentication challenge using Face ID, Touch ID, or the device passcode.
  3. Upon successful biometric or passcode verification, the operating system injects both the username and password into their respective fields.

If multiple accounts exist for a single service, tapping the key icon allows the user to select from a list of stored options.

Third-Party Password Manager Integration

iOS 12 extended this functionality beyond iCloud Keychain through the Password Autofill API. This framework allows third-party password managers (such as 1Password, LastPass, or Bitwarden) to integrate directly into the QuickType keyboard bar. Users can enable these services in system settings, allowing iOS 12 to query the external vault, authenticate the user biometrically, and autofill credentials using the exact same native workflow as Apple's built-in tools.