App Attest is an Apple service in the DeviceCheck framework that lets your server confirm a request came from an unmodified copy of your app on a genuine Apple device. It works on iOS 14 and later, and Apple announced it on August 3, 2020.
Why App Attest exists
A modified copy of an app can be passed around outside the App Store with cheats added, ads removed or premium content unlocked. An app can't vouch for itself, because a tampered copy will tamper with the check too. App Attest moves the decision to your server.
- The key. The app creates a key pair in the Secure Enclave. No process can ever read or modify the private key there.
- Attestation. Apple certifies that the key was created by your unmodified app on a real device, and your server verifies that statement.
- Assertions. From then on the app signs important requests with that key, say a premium download, and the server checks the signature.
This matters most when your app's AI features go through your own server. The AI provider's key lives there, and without a check anyone who finds the address can burn through your quota from another program. App Attest isn't airtight, since it may miss a compromised operating system, so Apple suggests feeding it into a wider risk assessment.
Where App Attest lives in Xcode and on your server
In Xcode, open your app target, the Signing & Capabilities tab, press + Capability and add App Attest. Xcode writes the com.apple.developer.devicecheck.appattest-environment key to your entitlements file with the value development. The app needs an App ID registered in your developer account, see the Bundle ID page.
On the device, the DCAppAttestService class from the DeviceCheck framework does the work. Your server verifies attestations and assertions itself and asks Apple's server for the risk metric, data-development.appattest.apple.com during development and data.appattest.apple.com after release.
Apple's numbers
| What | What Apple says |
|---|---|
| Announced | August 3, 2020, for iOS 14 and later |
| Other platforms | tvOS 15, watchOS 9, visionOS 1.0, Mac from macOS 27 |
| One-time server challenge | at least 16 bytes, its SHA256 hash goes into the attestation |
| Signature counter | 4 bytes, 0 in the attestation, higher than last time in every assertion |
| Receipt freshness | created no more than 5 minutes before you check it |
| Risk metric | number of attested keys on a device over 30 days |
| Rollout pace | no more than 10 million users per day per app, under 100 attestations per second |
| DeviceCheck alongside | 2 bits of data per device, since iOS 11 |
Per Apple's DeviceCheck documentation, the articles on preparing and assessing fraud risk, news of August 3, 2020 and the WWDC26 video, checked October 16, 2026.
How to adopt App Attest
- Add the App Attest capability in Xcode and make sure the app has an App ID.
- Read isSupported before anything else. If the device doesn't support the service, skip the check, and your server shouldn't demand assertions from such devices either.
- For each user on each device, create a key with generateKey and store its identifier. Without the identifier the key is unusable, and there's no way to get it back later.
- Fetch a one-time challenge of at least 16 bytes from your server, pass its hash to attestKey and send the attestation plus the key identifier to the server.
- On the server, verify the certificate chain up to Apple's root, the App ID hash (a 10-character Team ID, a period and the bundle ID), a zero counter and the environment. Store the public key and the receipt.
- Sign important requests with generateAssertion. The server checks the signature and that the counter went up since last time.
Common mistakes
- Deciding inside the app. A modified copy will fake any answer, so only the server makes the call.
- One key for everyone on a device. It hides the attack where a single compromised device serves many tampered copies of your app.
- Turning it on for everyone in one update. If millions of copies request attestation at once, Apple may throttle them. Roll out in stages, no more than 10 million users a day.
- Throwing the key away on any error. On serverUnavailable, retry the attestation later with the same key. Other errors call for a new key.
- Debugging against production. Device metrics can't be reset, so development runs in the sandbox. After release through TestFlight or the App Store the app always uses production, and keys and receipts don't carry over between the two.
The risk metric and what changed in 2026
The risk metric is an approximate count of your app's attested keys on one device over the past 30 days. A high count can mean one compromised device is handing out attestations to many copies. It also creeps up for innocent reasons, such as a reinstall, a restore from backup or a device passed to someone else, so tune your threshold on your own numbers.
At WWDC26 in 2026 Apple brought App Attest to the Mac starting with macOS 27. From iOS 27 the attestation carries a launch validation category, showing whether the copy came from the App Store, from TestFlight or a development signature, plus the bundle version.
Appto sets up an AI server on your Cloudflare account, where the provider key stays and never goes into the app. More on the Cloudflare server page.
Questions
App Attest vs DeviceCheck, what's the difference?
DeviceCheck, since iOS 11, lets your server keep 2 bits per device, for example a flag that a free gift was already claimed. App Attest, since iOS 14, checks the app itself, that the copy is unmodified and the request is signed with its key.
Does App Attest work on the Mac?
From macOS 27, as Apple said at WWDC26. As of October 16, 2026 the isSupported reference still says the value is false on a Mac, including iPhone apps running on Apple silicon.
How long does an App Attest key last?
As long as that installation of the app. A reinstall, a restore from backup or a device handed to someone else means a new key, and the risk metric goes up a little.
Where do I find the risk metric?
In the receipt your server gets from data.appattest.apple.com, field 17. You can refresh the receipt only after the date in field 19 and must do it before the date in field 21.
Does App Attest protect my app's AI server?
It closes a common abuse, another program sending requests to your address and spending your provider quota. Devices without App Attest support still need their own limits on the server.
Build your own app in Appto
Appto checks the niche on fresh App Store data, designs the screens, writes the code, builds the App Store page and submits to Apple from your account or shows you what to press in App Store Connect. Runs on your own Claude Code or Codex.
Download for Mac