# device-integrity

Helps integrate Apple DeviceCheck and App Attest into iOS apps, verifying device authenticity and protecting server APIs from fraud.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3700 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/device-integrity/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/device-integrity

## What it does

The skill outlines code patterns for Apple device verification APIs. It shows how to generate ephemeral single-use tokens via `DCDevice` on iOS 11+ and manage two persistent server-side bits that survive app reinstalls.

It also details the three-stage `DCAppAttestService` flow on iOS 14+. The instructions cover generating hardware-backed key pairs in Secure Enclave, persisting the account-scoped `keyId` in Keychain, and issuing signed assertions for API calls.

App Attest fails on simulators and ignores most app extensions outside of Action or SSO. Because of this limitation, your client must prepare fallback risk checks for unsupported testing environments.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill device-integrity -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/device-integrity/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/device-integrity/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill device-integrity -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/device-integrity/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill device-integrity -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/device-integrity/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills device-integrity
```

2. **Manually: put the files in place**
- File: `.github/skills/device-integrity/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill device-integrity -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/device-integrity
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/device-integrity/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill device-integrity -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/device-integrity/SKILL.md

## When to use it
- verify legitimate iOS app instances and hardware on the server
- persist fraud flags across application reinstalls using two device bits
- generate and store App Attest hardware keys in Secure Enclave
- sign sensitive server endpoints using cryptographic assertions

## Example prompts
- Show how to generate an ephemeral DCDevice token in Swift
- Create an App Attest key manager that stores keyId in Keychain
- Implement client-side assertion generation for sensitive API requests

## Similar
- [agent-device](https://affpapa.org/en/nevibecode/skills/agent-device.md) — skill · 18800 installs
- [argent-ios-device-setup](https://affpapa.org/en/nevibecode/skills/argent-ios-device-setup.md) — skill · 11000 installs
- [argent-ios-device-interact](https://affpapa.org/en/nevibecode/skills/argent-ios-device-interact.md) — skill · 11000 installs
- [ios-device-automation](https://affpapa.org/en/nevibecode/skills/ios-device-automation.md) — skill · 3300 installs
- [device-interaction](https://affpapa.org/en/nevibecode/skills/device-interaction.md) — skill · 740 installs
- [release-review](https://affpapa.org/en/nevibecode/skills/release-review.md) — skill · 514 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
