Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Keychain accessibility
Cyber Security

Keychain accessibility

← Back to Glossary
By NHI Mgmt Group Updated November 23, 2026 Domain: Cyber Security

Keychain accessibility controls determine when stored secrets can be read on a device and whether they survive backup or migration. The choice of accessibility class is a security decision, not a convenience setting, because it directly affects how long credentials remain exposed after compromise.

What keychain accessibility means

Keychain accessibility is the policy layer that decides when a stored secret is readable on a device, such as only after first unlock, only while unlocked, or even after a reboot. For mobile apps, that choice is part of the security design because it determines how resistant the secret is to device theft, local compromise, and backup exposure.

Although the setting can look like a simple storage option, it actually defines a trust boundary around the secret’s usable lifetime. A more permissive accessibility class can make login tokens, refresh tokens, or API credentials available sooner and for longer than the app intended.

How accessibility classes change secret exposure

Different classes control both availability and persistence. Some keep data unreadable until the user unlocks the device, while others allow access after unlock state changes, across restarts, or during migration. The more durable the class, the more likely the secret survives ordinary device lifecycle events, which may be desirable for usability but increases exposure if the device is later compromised.

This matters most for secrets that can be reused outside the device, because a token copied from the keychain can often outlive the handset session that protected it. That is why iOS App Security Guide treats keychain classes as part of the broader data-protection design, not as a storage detail.

Why keychain accessibility is security-sensitive

The main security question is not whether the secret is encrypted at rest, but when it becomes decryptable to the app or to a process that has gained device-level access. If a compromised phone can still expose a long-lived credential after reboot, unlock, or backup restoration, the attacker may inherit more persistence than the original compromise should have allowed.

That is especially important for apps that store session material, refresh tokens, or other secrets that can be replayed remotely. A keychain policy that is too permissive can turn a local device event into broader account exposure, which is why Mobile T1634 Credentials from Password Store is a useful model for understanding the threat path from device access to credential theft.

How engineers should think about selection and trade-offs

The correct class depends on the secret’s business value, how often the app needs it, and whether the secret should survive restore or migration. A payment app, enterprise app, or authenticator should normally prefer the least permissive class that still supports the user journey, especially when the secret can be exchanged for server-side access.

It also helps to distinguish convenience from necessity. If a secret only needs to exist during an active session, there is little reason to let it survive conditions that increase offline recovery risk. For mobile cryptography and secret-handling decisions, the OWASP Mobile Top 10 M10 Insufficient Cryptography Guide is relevant because accessibility choices are part of the same defensive design space as key handling, storage, and platform crypto primitives.

Risk and Threat Considerations

Keychain accessibility creates a real exposure window because the secret may remain recoverable after theft, malware execution, backup extraction, or an authenticated but compromised user session. The danger is greatest when the stored value is a bearer token or reusable credential that can be replayed outside the device.

Failure mechanism: An attacker or spyware on a compromised device waits for the accessibility condition to be met, then extracts secrets that remain readable longer than the app intended, or restores them from a backup or migrated device state.

Impact: The result can be account takeover, remote session replay, unauthorized API use, and delayed detection because the compromise may look like ordinary authenticated activity until the secret is rotated or revoked.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV9 — Self-contained TokensKeychain-held bearer tokens need strong storage and replay resistance.
Recommendation — Store bearer tokens with the least persistent accessibility that still supports the user session.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementKeychain accessibility affects the lifecycle and protection of authenticators and secrets.
Recommendation — Apply IA-5 to limit secret exposure windows and manage credential lifecycle tightly.
CIS Controls v8CIS-6 — Access Control ManagementAccessibility classes govern when stored secrets can be accessed on a device.
Recommendation — Restrict stored secret access to the minimum device state needed for business use.

Practitioner Guidance

Governance implication: Treat keychain accessibility as an explicit security requirement in mobile design review, not as an implementation default. The right class should be chosen by the secret’s replay value, expected lifetime, and whether restoration on a new device is acceptable.

What to watch for: Pay close attention to long-lived refresh tokens, device-wide credentials, and secrets that survive backup or migration, because those are the cases where an overly permissive accessibility setting most often turns a device compromise into a wider account compromise.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 23, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org