# Swift security expert

> Swift security expert is an open-source agent skill for security. Guides agents through Keychain, biometric, CryptoKit and certificate pinning work on Apple. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ivan-magda/swift-security-skill/tree/main/swift-security-expert
- **Repository:** https://github.com/ivan-magda/swift-security-skill
- **GitHub stars:** 40
- **License:** MIT
- **Skill name:** swift-security-expert
- **Collection:** https://github.com/ivan-magda/swift-security-skill
- **Categories:** [security](https://ai-powered.com/categories/security), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-05

## About

This skill gives an AI coding agent a reference for client-side security on iOS, macOS and other Apple platforms. It covers reviewing existing code, migrating secrets out of UserDefaults or plists, and implementing new keychain storage, biometric gating, Secure Enclave keys and CryptoKit operations. Its guidance is organized as a decision tree that routes review, improvement and implementation tasks to the matching reference file.

The skill sets out core rules the agent should follow, such as always checking OSStatus return codes, binding biometric checks to keychain items rather than trusting a boolean from LAContext, and setting accessibility classes explicitly. It also includes a top-level review checklist, a catalogue of common anti-patterns with severity ratings, and a mapping to OWASP Mobile Top 10 and MASVS categories for compliance work.

The skill targets iOS 13 and later, with recommendations for iOS 17 and newer and notes on post-quantum APIs from iOS 26. It is focused on Apple frameworks and explicitly excludes server-side auth, App Transport Security configuration and third-party cryptography libraries. No scripts are included; the material is reference documentation the agent reads while working in Swift code.

## When your agent uses it

> Use when working with iOS/macOS Keychain Services (SecItem queries, kSecClass, OSStatus errors), biometric authentication (LAContext, Face ID, Touch ID), CryptoKit (AES-GCM, ChaChaPoly, ECDSA, ECDH, HPKE, ML-KEM), Secure Enclave, secure credential storage (OAuth tokens, API keys), certificate pinning (SecTrust, SPKI), keychain sharing across apps/extensions, migrating secrets from UserDefaults or plists, or OWASP MASVS/MASTG mobile compliance on Apple platforms.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ivan-magda/swift-security-skill/tree/HEAD/swift-security-expert)
- [License: MIT](https://github.com/ivan-magda/swift-security-skill/tree/HEAD/swift-security-expert)

## Features

- **Keychain storage patterns:** Covers SecItem queries, item classes, accessibility choices and the add-or-update flow for storing credentials.
- **Biometric authentication binding:** Explains how to gate secrets behind Face ID or Touch ID through keychain access control rather than a plain boolean check.
- **CryptoKit guidance:** Summarizes hashing, AES-GCM, ChaChaPoly, ECDH, HKDF, HPKE and signing with version notes for each API.
- **Secure Enclave keys:** Describes hardware-backed P256 keys, their persistence limits and simulator pitfalls.
- **Certificate pinning reference:** Covers SecTrust evaluation, SPKI and CA pinning, NSPinnedDomains and client certificates for mutual TLS.
- **Migration and review checklists:** Provides steps for moving secrets off UserDefaults and plists, plus a review checklist and OWASP mapping.

## Good for

- Review my iOS app's keychain code for security problems
- Move OAuth tokens out of UserDefaults into the Keychain
- Add Face ID protection to a stored API key
- Share a keychain item between my app and its extension
- Encrypt data with AES-GCM using CryptoKit
- Pin a server's SPKI hash in my networking code

## Install

### Claude Code

This skill ships in the `swift-security-expert` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ivan-magda/swift-security-skill
/plugin install swift-security-expert@swift-security-skill
```

Or copy only this skill to `~/.claude/skills/swift-security-expert`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivan-magda/swift-security-skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/swift-security-expert &&
cp -R "$tmp/swift-security-expert" ~/.claude/skills/swift-security-expert &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/swift-security-expert` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/swift-security-expert` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivan-magda/swift-security-skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/swift-security-expert &&
cp -R "$tmp/swift-security-expert" ~/.agents/skills/swift-security-expert &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/swift-security-expert` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/swift-security-expert` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivan-magda/swift-security-skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/swift-security-expert &&
cp -R "$tmp/swift-security-expert" ~/.cursor/skills/swift-security-expert &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/swift-security-expert` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ivan-magda/swift-security-skill.git --path swift-security-expert
```

Or copy the folder to `~/.gemini/skills/swift-security-expert` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/swift-security-expert`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivan-magda/swift-security-skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/swift-security-expert &&
cp -R "$tmp/swift-security-expert" ~/.copilot/skills/swift-security-expert &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/swift-security-expert` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ivan-magda/swift-security-skill.git
```

Then copy `swift-security-skill/swift-security-expert` into your agent's skills folder as `swift-security-expert`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Swift security expert need to run?

It has no scripts. It is a SKILL.md with reference files that the agent loads when working on Apple platform security code, and it targets Swift projects on iOS and macOS.

### Which Apple versions does Swift security expert cover?

It sets iOS 13 as the minimum deployment target, recommends iOS 17+ patterns where applicable, and notes iOS 26 post-quantum APIs such as ML-KEM and ML-DSA.

### What is out of scope?

It excludes App Transport Security, server-side authentication architecture, CloudKit encryption, code signing and third-party libraries like KeychainAccess or Valet.

### Which license does Swift security expert use?

The skill is released under the MIT license.

### How do I install Swift security expert in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/swift-security-expert to use it in all your projects, or to .claude/skills/swift-security-expert in one project. Or install the swift-security-expert plugin, which includes it: /plugin marketplace add ivan-magda/swift-security-skill, then /plugin install swift-security-expert@swift-security-skill.

### Does Swift security expert run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Swift security expert?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Swift security expert?

The closest alternatives to Swift security expert are Axiom security, Axiom scan security privacy, Security review, Security and hardening and Apple intelligence.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Axiom security](https://ai-powered.com/skills/axiom-security-charleswiltgen-2): Axiom security is an open-source agent skill for security.
- [Axiom scan security privacy](https://ai-powered.com/skills/axiom-scan-security-privacy): Axiom scan security privacy is an open-source agent skill for security.
- [Security review](https://ai-powered.com/skills/security-review-getsentry): Security review is an open-source agent skill for security.
- [Security and hardening](https://ai-powered.com/skills/security-and-hardening-ajyadav013-2): Security and hardening is an open-source agent skill for security.
- [Apple intelligence](https://ai-powered.com/skills/apple-intelligence): Apple intelligence is an open-source agent skill for developer tools.
- [Axiom macOS](https://ai-powered.com/skills/axiom-macos-charleswiltgen-2): Axiom macOS is an open-source agent skill for developer tools.
- [Axiom audit storage](https://ai-powered.com/skills/axiom-audit-storage): Axiom audit storage is an open-source agent skill for security.
- [Mac design](https://ai-powered.com/skills/mac-design): Mac design is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/swift-security-expert
