From swift-security-pro
Guides secure handling of sensitive data on iOS: Keychain storage, Data Protection, ATS/TLS enforcement, secrets management, and biometric authentication (Face ID / Touch ID).
How this skill is triggered — by the user, by Claude, or both
Slash command
/swift-security-pro:swift-security-proThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Protect user data and credentials. Default to the most secure option.
Protect user data and credentials. Default to the most secure option.
Trigger: /swift-security-pro.
UserDefaults or plist.❌ 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.
❌
let apiKey = "sk_live_abc123" // shipped in the binary, easily extracted
✅
.gitignore.NSAllowsArbitraryLoads.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.
Mark sensitive files so they're encrypted at rest while locked:
try data.write(to: url, options: .completeFileProtection)
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.
UserDefaults or a plist.NSAllowsArbitraryLoads / disabled ATS....ThisDeviceOnly for non-syncable secrets.Per issue: file:line, the exposure, before/after fix. Lead with credential leaks and plaintext storage.
Blocks Edit/Write/Bash actions until Claude investigates importers, data schemas, and user instructions. Improves output quality by forcing concrete facts before edits.
npx claudepluginhub laxrajpurohit/swift-skills-pro --plugin swift-security-pro