<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/kSecAttrAccess",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@kSecAttrAccess"
  },
  "title" : "kSecAttrAccess"
}
-->

# kSecAttrAccess

A key with a value that indicates access control list settings for the item.

```
let kSecAttrAccess: CFString
```

## Discussion

The corresponding value is a [`SecAccess`](/documentation/Security/SecAccess) instance that describes the access control settings for this item. Create an access instance by calling the [`SecAccessCreate(_:_:_:)`](/documentation/Security/SecAccessCreate(_:_:_:)) method. For more information, see [Access Control Lists](/documentation/Security/access-control-lists).

Use this attribute to set an access instance when you:

- Create a keychain item, by adding the `kSecAttrAccess` key to the dictionary you pass to [`SecItemAdd(_:_:)`](/documentation/Security/SecItemAdd(_:_:)).
- Modify a keychain item, by adding the `kSecAttrAccess` key to the dictionary you pass as the second parameter to [`SecItemUpdate(_:_:)`](/documentation/Security/SecItemUpdate(_:_:)).

You can’t use this attribute to:

- Search for an item by its access instance; for example, by adding `kSecAttrAccess` to the dictionary you pass as the first parameter to [`SecItemUpdate(_:_:)`](/documentation/Security/SecItemUpdate(_:_:)). [`SecItemUpdate(_:_:)`](/documentation/Security/SecItemUpdate(_:_:)) and [`SecItemCopyMatching(_:_:)`](/documentation/Security/SecItemCopyMatching(_:_:)) ignore this key when searching for keychain items.
- Get an item’s access instance with [`SecItemCopyMatching(_:_:)`](/documentation/Security/SecItemCopyMatching(_:_:)). To get an item’s access instance, call [`SecKeychainItemCopyAccess(_:_:)`](/documentation/Security/SecKeychainItemCopyAccess(_:_:)).

> Important:
> This attribute is mutually exclusive with the ``doc://com.apple.security/documentation/Security/kSecAttrAccessControl`` attribute. Also, it only applies to keychain items stored in macOS that don’t have one or both of the ``doc://com.apple.security/documentation/Security/kSecAttrSynchronizable`` or ``doc://com.apple.security/documentation/Security/kSecUseDataProtectionKeychain`` keys set to `true`. For information on access control for other keychain items, see <doc://com.apple.security/documentation/Security/sharing-access-to-keychain-items-among-a-collection-of-apps>.

---

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)