If you're asked to create a new iCloud security code
If you use iCloud Keychain in iOS 8.4 or earlier, or OS X 10.10.4 or earlier, you might see the message "A new security code must be created because of a change to iCloud Keychain servers."
This does not apply to accounts with two-factor authentication enabled. On your iPhone, iPad, or iPod touch, tap Settings, tap [your name], and then tap Password & Security to see if you turned on two-factor authentication. On your Mac, choose Apple menu > System Preferences, click Apple ID, and select Password & Security.
When you see the message, you can update your device's operating system and continue without updating your iCloud Security Code. Your iCloud Security Code is used to verify your identity when you set up iCloud Keychain on a new device and when you recover your iCloud Keychain.
On your iPhone, iPad, or iPod touch
Tap Not Now on the message menu, and update your device to the latest version of iOS.
If you don't update, you'll see the message again in 24 hours.
If you select Not Now three times without updating your device, your iCloud Keychain will turn off, and you won't see the security code message again. After iCloud Keychain is turned off, your local keychain won't be affected but your username, passwords, and other keychain items won't update across your devices. And, you can't recover your iCloud Keychain from iCloud.
On your Mac
Click Create New Code on the message menu, minimize the window that opens, and update your Mac to the latest version of macOS.
If you click Reset and Turn off, your iCloud Keychain will be deleted from iCloud and turned off on your device. Your local keychain won't be affected, but your username, passwords, and other keychain items won't update across your devices.
Create a new iCloud Security Code
When you see the message, you can also create a new code and keep using iCloud Keychain on your device.
To update your iCloud Security Code, select Create New Code and follow the steps to create a new one.
Pick a code you can remember. The iCloud Security Code is used to verify your identity when you set up iCloud Keychain on a new device and when you recover your iCloud Keychain.
Learn more
If iCloud Keychain is turned off, update to the latest iOS or macOS before you set up iCloud Keychain again.
You can learn more about iCloud Security Codes in our iOS Security Guide.