swift-security-expert

Audit and implement Keychain, biometrics, and CryptoKit security patterns on Apple platforms.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/jperezdelreal/GymBro --skill swift-security-expert-jperezdelreal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-security-expert
Source: https://github.com/jperezdelreal/GymBro/tree/main/.squad/skills/ios/swift-security-expert
Command: npx skills add https://github.com/jperezdelreal/GymBro --skill swift-security-expert-jperezdelreal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill provides a comprehensive, authoritative guide to implementing and auditing client-side security on Apple platforms, focusing on Keychain, biometrics, CryptoKit, Secure Enclave, credential lifecycle, and certificate trust to protect secrets.

Core Features & Use Cases

  • Keychain fundamentals & best practices: correct SecItem usage, error handling, and accessibility attributes.
  • Biometric authentication integration: binding biometrics to Keychain items for secure access.
  • CryptoKit guidance: symmetric encryption, signing, key agreement, and post-quantum readiness considerations.
  • Migration & compliance: moving secrets from insecure stores and mapping to OWASP MASVS/MASTG requirements.
  • Certificate trust & pinning: evaluation, SPKI/CA pinning, and trust policy best practices for mobile apps.
  • Use cases: secure credential storage for OAuth tokens, API keys, and value-based app secrets with cross-app sharing where appropriate.

Quick Start

Ask for a security review of your Apple platform app’s Keychain usage and implement the recommended best practices.

Frequently Asked Questions about swift-security-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I securely store OAuth tokens and API keys in the iOS Keychain?

To securely store OAuth tokens in the iOS Keychain, you must use explicit kSecAttrAccessible attributes, handle SecItem OSStatus errors correctly, and apply access control restrictions to protect credentials. This enforces proper item class usage and secure lifecycle management for app secrets.

How does CryptoKit integrate with the Secure Enclave for cryptographic keys?

CryptoKit integrates with the Secure Enclave by generating and managing cryptographic keys directly within the hardware enclave. This approach secures key agreement and signing operations, ensuring private keys never leave the secure hardware boundary on iOS and macOS devices.

What is the best way to bind biometric authentication to Keychain items?

Binding biometrics to Keychain items requires setting appropriate access control objects during SecItem calls. This ensures the secure enclave validates Touch ID or Face ID before decrypting or returning the protected credentials, adding a local authentication layer to stored secrets.

How do I implement certificate pinning and evaluate trust policies for mobile apps?

Implementing certificate pinning involves evaluating SPKI or CA pins against standard trust policies for mobile apps. This verifies server certificate integrity during network requests, preventing man-in-the-middle attacks by strictly defining trusted certificate authorities.

How do I migrate insecure app secrets to comply with OWASP MASVS requirements?

Migrating insecure app secrets to comply with OWASP MASVS involves moving values from standard storage into the Keychain with proper accessibility attributes. This maps directly to mobile application security verification standards for robust credential protection.

Why do my SecItem calls return OSStatus errors when saving to Keychain?

SecItem calls return OSStatus errors when Keychain access control attributes or item classes are configured incorrectly. Proper error handling and explicit kSecAttrAccessible definitions are required to resolve status codes and successfully store secure credentials.