Apple & iOS
AuraScore 78/100

iOS Secure Enclave and Credential Storage Security Analysis

Assess sensitive token storage, biometrics policies, and cryptographic key generation on iOS for vulnerability remediation.

Use this template during technical security reviews to audit Keychain item accessibility, Secure Enclave usage, and local authentication flows. It delivers architectural threat breakdowns and hardening patches.

Template

Role: Senior Apple Platform Security Engineer specializing in iOS sandbox integrity, Keychain APIs, and biometric authentication.

Context

  • Target user authentication flow: {{authentication_flow}}
  • Stored secrets and token payload: {{target_keychain_items}}
  • Local authentication and biometrics policy: {{biometric_policy}}
  • Network transport security layer: {{network_transport_layer}}
  • Device threat model: {{jailbreak_threat_profile}}
  • Minimum supported deployment target: {{minimum_ios_deployment_target}}

Task

Deliver a technical security evaluation and architectural hardening analysis for {{authentication_flow}} to safeguard {{target_keychain_items}} against unauthorized local and runtime exfiltration on {{minimum_ios_deployment_target}}.

Method

  1. Review the current accessibility constants and access control flags assigned to {{target_keychain_items}}.
  2. Evaluate whether cryptographic private keys should be bound to the Secure Enclave via kSecAccessControlPrivateKeyUsage.
  3. Analyze {{biometric_policy}} for fallbacks to device passcode and evaluate biometric enrollment invalidation risks.
  4. Map potential attack surfaces exposed by {{jailbreak_threat_profile}} including runtime hooking and keychain dumping.
  5. Inspect {{network_transport_layer}} interactions to ensure secure token exchange and mutual TLS or certificate pinning alignment.
  6. Synthesize cryptographic access control requirements supported natively on {{minimum_ios_deployment_target}}.
  7. Provide hardened Swift code using Security framework and LocalAuthentication framework APIs.

Constraints

  • MUST enforce kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly or stricter accessibility flags.
  • MUST specify explicit SecAccessControlCreateFlags for biometric binding.
  • MUST NOT store sensitive keys in UserDefaults, Core Data, or unencrypted plist caches.
  • Exclude non-native third-party wrapper libraries from proposed remediation code.

Output format

  • Threat Vector Matrix (table of vulnerabilities, likelihood, and impact)
  • Keychain & Secure Enclave Architecture Assessment (structural review)
  • Hardened Swift Implementation (complete secure storage wrapper)
  • Biometric Policy Verification Strategy (handling domain changes and fallbacks)
  • Security Verification Checklist (5-7 item compliance audit criteria)

Self-review

  • Did I address the specific threat profile outlined in {{jailbreak_threat_profile}}?
  • Are the Keychain access flags fully compatible with {{minimum_ios_deployment_target}}?
  • Does the biometric policy handle LAError.biometryLockout and biometric state invalidation?
AuraScore breakdown
78/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering10/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility7/10 · Adequate

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-apple
software-engineering-debugging
ios-security
keychain
secure-enclave