<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/kSecAttrAccessible",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@kSecAttrAccessible"
  },
  "title" : "kSecAttrAccessible"
}
-->

# kSecAttrAccessible

A key with a value that indicates when the keychain item is accessible.

```
let kSecAttrAccessible: CFString
```

## Discussion

The corresponding value, one of those found in [Accessibility Values](/documentation/Security/item-attribute-keys-and-values#Accessibility-Values), indicates when your app needs access to the data in a keychain item. Choose the most restrictive option that meets your app’s needs so that the system can protect that item to the greatest extent possible. For more information, see [Restricting keychain item accessibility](/documentation/Security/restricting-keychain-item-accessibility).

> Important:
> You can use this attribute for macOS keychain items only if you also set a value of `true` for the ``doc://com.apple.security/documentation/Security/kSecUseDataProtectionKeychain`` key, the ``doc://com.apple.security/documentation/Security/kSecAttrSynchronizable`` key, or both. For any item marked as synchronizable, the value for the ``doc://com.apple.security/documentation/Security/kSecAttrAccessible`` key may only be one whose name does not end with `ThisDeviceOnly`, as those cannot sync to another device.

> Note:
> The app *must* provide the contents of the keychain item (``doc://com.apple.security/documentation/Security/kSecValueData``) when changing this attribute in iOS 4 and earlier.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)