I have been unable to find an explicit answer to this in the official documentation.
Does the kSecAttrAccessible affect the behavior of how a keychain item of class kSecClassGenericPassword is backed up or not?
Only kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly explicitly states that the item is not backed up.
AFAICS, the only reason why kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly makes it explicit is because it's by design.
Does this mean that whether a kSecClassGenericPassword is backed up or not is an implementation detail and as such subject to change?
References
iPhone Keychain Backups
In iOS, an application always has access to its own keychain items and does not have access to any other application’s items. The system generates its own password for the keychain, and stores the key on the device in such a way that it is not accessible to any application. When a user backs up iPhone data, the keychain data is backed up but the secrets in the keychain remain encrypted in the backup. The keychain password is not included in the backup. Therefore, passwords and other secrets stored in the keychain on the iPhone cannot be used by someone who gains access to an iPhone backup. For this reason, it is important to use the keychain on iPhone to store passwords and other data (such as cookies) that can be used to log into secure web sites.
About encrypted backups in iTunes
To protect backups of your iPhone, iPad, or iPod touch in iTunes, you can use password protection and encryption.
The Encrypt Backup feature in iTunes locks and encodes your data. An encrypted iTunes backup includes certain information that other backups don't:
- Your saved passwords
- Wi-Fi settings
- Website history
- Health data
https://support.apple.com/en-gb/HT205220
Edit
How to back up your devices using iCloud or iTunes
Make a backup using iTunes
If you want to save Health and Activity data from your iOS device or Apple Watch, you’ll need to encrypt your backup: Select the box called Encrypt [device] backup and make a memorable password.
https://support.apple.com/en-us/HT203977
About backups in iCloud and iTunes
iTunes backups
An iTunes backup includes nearly all of your device's data and settings. An iTunes backup doesn't include:
Activity, Health, and Keychain data (To back up this content, you'll need to use Encrypted Backup in iTunes.)
https://support.apple.com/en-gb/HT204136
iOS Security
iOS 9.0 or later
September 2015
iCloud Backup
While the user’s keychain database is backed up to iCloud, it remains protected by a UID-tangled key. This allows the keychain to be restored only to the same device from which it originated, and it means no one else, including Apple, can read the user’s keychain items.
Keychain Data Protection
Other keychain classes have a “This device only” counterpart, which is always protected with the UID when being copied from the device during a backup, rendering it useless if restored to a di erent device.