app-security

app-security is a skill for Claude Code, Codex from markdavidgan/apple-dev-skills. It costs 120 tokens per session (1,498 once invoked), scanned A, original, MIT.

A guide to protecting secrets, user sign-ins, private data, and device access in Apple apps. It covers Keychain, Sign in with Apple, Face ID and Touch ID, encryption, device checks, and certificate pinning.

In plain words
What is it for?
Use it when storing login tokens, adding Apple sign-in or biometric gates, encrypting data, checking device integrity, or verifying that an app connects to the expected server.
Why use it?
It helps prevent tokens and keys from being stored as readable files or settings, and reduces common mistakes when adding security features to an app.

Skill for Claude CodeCodex

Part of the apple-dev-skills plugin — 62 skills, 25 commands, 7 agents shipped together

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.

agentmods
npx agentmods add skills/markdavidgan/apple-dev-skills/app-security
Any agent
npx skills add markdavidgan/apple-dev-skills --skill app-security
Clone the repo
git clone --depth 1 https://github.com/markdavidgan/apple-dev-skills

Made for: Claude Code, Codex.

Or install apple-dev-skills, the plugin that ships this one along with the rest of its 62 skills, 25 commands, 7 agents.

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 app-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/markdavidgan/apple-dev-skills/app-security.svg)](https://agentmods.dev/skills/markdavidgan/apple-dev-skills/app-security)
Your own site
<a href="https://agentmods.dev/skills/markdavidgan/apple-dev-skills/app-security"><img src="https://agentmods.dev/badge/skills/markdavidgan/apple-dev-skills/app-security.svg" alt="Measured on agentmods" height="20"></a>
Per session 120 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,498 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00120 $0.01498
Opus 5 $0.00060 $0.00749
Sonnet 5 $0.00024 $0.00300
Haiku 4.5 $0.00012 $0.00150

Measured 4d ago against content hash fcc23ef82d2d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

app-security 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 4d 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.

platforms/claude/skills/app-security/SKILL.md · 141 lines

How it starts

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

App Security

Store secrets, authenticate users, and protect data correctly on Apple platforms. The golden rule: never put secrets, tokens, or keys in UserDefaults, @AppStorage, plist, or source — those are plaintext and back up off-device.


Keychain — the only place for secrets

Use a thin wrapper around the C API (or a vetted micro-library). Store tokens, refresh tokens, encryption keys.

import Security

enum Keychain {
    static func set(_ data: Data, account: String) throws {
        let query: [String: Any] = [
            kSecClass as String: kSecClassGenericPassword,
            kSecAttrAccount as String: account,
            kSecValueData as String: data,
            kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
        ]
        SecItemDelete(query as CFDictionary)               // replace existing
        let status = SecItemAdd(query as CFDictionary, nil)
        guard status == errSecSuccess else { throw KeychainError(status) }
    }
    static func get(account: String) -> Data? {
        let query: [String: Any] = [
            kSecClass as String: kSecClassGenericPassword,
            kSecAttrAccount as String: account,
            kSecReturnData as String: true,
            kSecMatchLimit as String: kSecMatchLimitOne
        ]
        var out: CFTypeRef?
        return SecItemCopyMatching(query as CFDictionary, &out) == errSecSuccess ? out as? Data : nil
    }
}
  • Choose accessibility deliberately: ...WhenUnlockedThisDeviceOnly (most secrets) or ...AfterFirstUnlockThisDeviceOnly (needed in the background). The ThisDeviceOnly variants don't migrate to new devices/backups — correct for tokens.
  • Gate the most sensitive items with SecAccessControl (.biometryCurrentSet, .userPresence) so reading requires Face ID/Touch ID.

Sign in with Apple

Required if you offer other third-party social logins (App Review guideline 4.8). Privacy-friendly: email relay, minimal data.

Read the full file on GitHub · 141 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. 4d ago First seen · 141 lines · 120 tokens per session scan A fcc23ef82d2d

Subscribe to this mod's changes

app-security is a skill published in the GitHub repository markdavidgan/apple-dev-skills (5 stars, last pushed 5d ago), licensed MIT. It adds 120 tokens to every session and 1,498 once invoked, about $0.0006 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

asc-localize-metadata

Automatically translate and sync App Store metadata (description, keywords, what's new, subtitle) to multiple languages using LLM translation and asc CLI. Use when asked to localize an app's App Store listing, translate app descriptions, or add new languages to App Store Connect.

rorkai/app-store-connect-cli-skills · 60 tokens

asc-revenuecat-catalog-sync

Reconcile App Store Connect subscriptions and in-app purchases with RevenueCat products, entitlements, offerings, and packages using asc and RevenueCat MCP. Use when setting up or syncing subscription catalogs across ASC and RevenueCat.

rorkai/app-store-connect-cli-skills · 51 tokens

asc-shots-pipeline

Orchestrate iOS screenshot automation with xcodebuild/simctl for build-run, AXe for UI actions, JSON settings and plan files, Koubou-based framing (asc screenshots frame), and screenshot upload (asc screenshots upload). Use when users ask for automated screenshot capture, AXe-driven simulator flows, frame composition…

rorkai/app-store-connect-cli-skills · 79 tokens

asc-metadata-sync

Sync, validate, and apply App Store metadata with the current asc canonical metadata workflow. Use when updating metadata, localizations, keywords, or migrating legacy fastlane metadata.

rorkai/app-store-connect-cli-skills · 39 tokens

asc-release-flow

Orchestrate App Store releases with asc, including staging a version, uploading or building an artifact, publishing, and submitting for review. Use when the user wants to prepare or execute a release. Keep Game Center item preparation in this skill; route other readiness failures, stuck submissions, cancellation, and…

rorkai/app-store-connect-cli-skills · 71 tokens

asc-submission-health

Diagnose App Store submission blockers and operate review health with asc, including readiness validation, repair routing, status monitoring, cancellation, and retry decisions. Use when validation fails, a version is not in a valid state, review status is unclear or stuck, or a failed submission must be repaired and…

rorkai/app-store-connect-cli-skills · 82 tokens