swift-security-pro

swift-security-pro is a skill for Claude Code from laxrajpurohit/swift-skills-pro. It costs 38 tokens per session (782 once invoked), scanned A, original, MIT.

A guide to protecting sensitive information in iOS apps, including passwords, tokens, network connections, secrets, and Face ID or Touch ID access.

In plain words
What is it for?
Use it when storing secrets in the Keychain, configuring data protection or TLS, managing API keys, reviewing authentication, or adding biometric checks.
Why use it?
It helps keep credentials out of ordinary app storage and source code while reducing unsafe network and authentication choices.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the swift-security-pro plugin — 1 skill shipped together

Good fit Use it when storing secrets in the Keychain, configuring data protection or TLS, managing API keys, reviewing authentication, or adding biometric checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/laxrajpurohit/swift-skills-pro/swift-security-pro
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add laxrajpurohit/swift-skills-pro --skill swift-security-pro
Clone the repo
git clone --depth 1 https://github.com/laxrajpurohit/swift-skills-pro

Made for: Claude Code.

Or install swift-security-pro, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for swift-security-pro

README.md
[![agentmods](https://agentmods.dev/badge/skills/laxrajpurohit/swift-skills-pro/swift-security-pro/github.svg)](https://agentmods.dev/skills/laxrajpurohit/swift-skills-pro/swift-security-pro)
Your own site
<a href="https://agentmods.dev/skills/laxrajpurohit/swift-skills-pro/swift-security-pro"><img src="https://agentmods.dev/badge/skills/laxrajpurohit/swift-skills-pro/swift-security-pro/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for swift-security-pro

Your own site · 80×15
<a href="https://agentmods.dev/skills/laxrajpurohit/swift-skills-pro/swift-security-pro"><img src="https://agentmods.dev/badge/skills/laxrajpurohit/swift-skills-pro/swift-security-pro.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 782 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.00782
Opus 5 $0.00019 $0.00391
Sonnet 5 $0.00008 $0.00156
Haiku 4.5 $0.00004 $0.00078

Measured 11d ago against content hash d558bfd5ba71, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

swift-security-pro scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

swift-security-pro/skills/swift-security-pro/SKILL.md · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Swift Security Pro

Protect user data and credentials. Default to the most secure option.

When to use

  • Storing tokens, passwords, or sensitive data.
  • Reviewing networking, secrets handling, or auth.
  • Adding biometric authentication.

Trigger: /swift-security-pro.

Core principles

  • Secrets go in the Keychain, never UserDefaults or plist.
  • Never hard-code API keys/secrets in source.
  • Keep App Transport Security on; require TLS.
  • Use biometrics for gating access, not for storing the secret itself.

Storing secrets

❌ UserDefaults — plaintext, backed up, readable

UserDefaults.standard.set(token, forKey: "authToken")

✅ Keychain

let query: [String: Any] = [
    kSecClass as String: kSecClassGenericPassword,
    kSecAttrAccount as String: "authToken",
    kSecValueData as String: Data(token.utf8),
    kSecAttrAccessible as String: kSecAttrAccessibleWhenUnlockedThisDeviceOnly
]
SecItemDelete(query as CFDictionary)
SecItemAdd(query as CFDictionary, nil)

Use ...ThisDeviceOnly accessibility so secrets don't migrate via backup.

No hard-coded secrets

let apiKey = "sk_live_abc123"   // shipped in the binary, easily extracted

  • Inject at build time (xcconfig / CI secret) or fetch from your backend.
  • Never commit keys; add config files to .gitignore.
  • Treat anything in the app bundle as public.

Transport security

  • Keep ATS enabled. Don't add NSAllowsArbitraryLoads.
  • Use HTTPS everywhere; consider certificate pinning for high-value APIs via URLSessionDelegate urlSession(_:didReceive:completionHandler:).

❌ Info.plist

<key>NSAppTransportSecurity</key><dict>
  <key>NSAllowsArbitraryLoads</key><true/>
</dict>

✅ Leave ATS on; scope rare exceptions to a specific domain only.

Data Protection

Mark sensitive files so they're encrypted at rest while locked:

try data.write(to: url, options: .completeFileProtection)

Biometric auth

import LocalAuthentication
let ctx = LAContext()
var error: NSError?
if ctx.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
    let ok = try await ctx.evaluatePolicy(
        .deviceOwnerAuthenticationWithBiometrics,
        localizedReason: "Unlock your vault")
}

Biometrics gate access; the actual secret still lives in the Keychain (optionally with SecAccessControl requiring biometry). Always provide a passcode fallback.

Read the full file on GitHub · 108 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 108 lines · 38 tokens per session scan A d558bfd5ba71

Subscribe to this mod's changes

swift-security-pro is a skill published in the GitHub repository laxrajpurohit/swift-skills-pro (5 stars, last pushed 3mo ago), licensed MIT. It adds 38 tokens to every session and 782 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

implementation-guide

Generates detailed implementation guide with pseudo-code and step-by-step development instructions. Creates IMPLEMENTATIONGUIDE.md from PRD, Architecture, and UX specs. Use when creating development roadmap.

rshankras/claude-code-apple-skills · 40 tokens

architecture-spec

Generates technical architecture specification from PRD. Covers architecture pattern, tech stack, data models, and app structure. Use when creating ARCHITECTURE.md or designing system architecture.

rshankras/claude-code-apple-skills · 39 tokens

foundation-models

On-device LLM integration using Apple's Foundation Models framework. Use when implementing AI text generation, structured output, or tool calling.

rshankras/claude-code-apple-skills · 29 tokens

liquid-glass

Implement Liquid Glass design using .glassEffect() API for iOS/macOS 26+. Covers SwiftUI, AppKit, UIKit, and WidgetKit. Use when creating modern glass-based UI effects.

rshankras/claude-code-apple-skills · 45 tokens

visual-intelligence

Integrate your app with iOS Visual Intelligence for camera-based search and object recognition. Use when adding visual search capabilities.

rshankras/claude-code-apple-skills · 28 tokens

onboarding-generator

Generates value-moment-first onboarding flows for iOS/macOS apps — the default architecture races a new user to the first felt experience of the app's promised outcome, branching on whether they can experience it right now or need to plan for later. The classic paged welcome-carousel tour is an explicit fallback for…

rshankras/claude-code-apple-skills · 93 tokens