Skip to Content
App AttestationOverview

App attestation

App attestation proves to your backend that a request comes from an unmodified build of your app running on a genuine device that meets your policy. It is included in every TrustPin plan, the Free plan too, at no extra charge, because you run the verifier yourself.

This page is for security leads and everyone starting with attestation. It explains what attestation proves, who runs what and what TrustPin sees, and ends with the six stages from an empty project to enforced attestation, each with a check.

It is not runtime protection (RASP): it doesn’t detect hooking, debugging, tampering, root or jailbreak. See What attestation is not.

Who runs what

TrustPin operates no attestation service. Everything in the request path runs in your infrastructure. TrustPin’s only runtime role is serving the signed policy (attest.jws.b64) from its CDN.

The gateway is optional: your API can verify the token itself, with the same JWKS. Apple App Attest and Android Key Attestation evidence is checked inside the verifier, with no outside call.

ComponentRuns atRole
TrustPin console and CLITrustPin, your workstationSet up, edit, sign and publish the attestation policy; generate the deployment bundle
TrustPin CDNTrustPinServes the signed policy to your verifier
Attestation verifierYour infrastructure (container image)Verifies Apple App Attest, Android Key Attestation and Play Integrity evidence against the policy; issues short-lived tokens
SDK attestation moduleYour appProduces evidence, obtains and renews tokens, adds the TrustPin-Attestation header to requests
Your API or gatewayYour infrastructureVerifies tokens against the verifier’s JWKS and decides what unattested requests may do

TrustPin stores identifiers only: Team IDs, bundle IDs, package names, signing-certificate digests, the Google Cloud project number. It never holds your verifier’s signing keys, challenge secrets or Google credentials; those are environment variables of your verifier.

What TrustPin sees

TrustPin sees no attestation traffic. From your verifiers’ policy fetches it records:

  • request counts, split into full fetches and “not modified” answers;
  • verifier versions and the operating system and architecture they run on;
  • the CDN location that served the fetch;
  • counts of distinct verifier server IP addresses.

None of this is device or end-user data. You see it on the project’s Analytics page (“Attestation verifiers”), the Usage pages (“Attestation policy fetches”) and the Status tab of the project’s Attestation page (“Verifier fleet”).

The flow

Platform evidence is expensive (an Apple or Google round trip, subject to quotas), so it is produced once per device key. Tokens are then renewed cheaply by signing a fresh challenge with that key.

The device key is the App Attest key on Apple platforms (Secure Enclave) and an Android Keystore key on Android. A key is attested exactly once; when its key certificate expires or is rejected, the SDK generates a new key and attests again. The Key certificate lifetime in the policy (default 30 days) therefore controls how often a device attests again.

For an operation your API must not accept on a reused token alone, SDK 7.1.x can add an assertion bound to that operation. See Assertions for sensitive operations.

Token binding

A token can be bound to your user’s session, so a token copied out of one session is useless in another. Only a SHA-256 of the value leaves the device, and your API compares it with the session the request authenticates with.

The app chooses one of two modes: header binding, where each request’s token is bound to a header such as Authorization, or fixed binding, to a value you set. With Require token binding on, tokens exist only once the app has a binding.

Modes

ModeVerifier behaviourUse
MonitorIssues a token even when policy checks fail, recording tp.result fail and tp.reasons. An app the policy doesn’t list gets 403 app_not_allowed in both modesRoll-out: your API logs tp.result and allows every request
EnforceIssues tokens only when the policy passes. Tokens issued before a switch to enforce keep fail until they expire; see Rolling outProduction: your API rejects requests without a valid token

Cryptographic failures (forged evidence, invalid signatures) never yield a token in either mode.

Platforms

Attestation ships in SDK 7.1.x: Swift 7.1.0 (TrustPinAttestKit), and Kotlin, Flutter and React Native 7.1.1. Flutter covers iOS, macOS and Android; React Native covers iOS and Android. Both wrap the native modules, so the evidence and minimums below apply to them too. Every 7.1.x SDK needs verifier 1.0.0 or later.

PlatformEvidenceMinimum OS
iOS, iPadOSApp Attest15
Mac CatalystApp Attest15
macOSApp Attest13
tvOSApp Attest15
watchOSApp Attest9
visionOSApp Attest2
Android with Google Play servicesKey Attestation, Play Integrity, or both, as the policy requiresAPI 25
Android without Google PlayKey AttestationAPI 25
Simulators and emulatorsDebug token (development only)Not applicable

Where a device cannot produce the evidence the policy requires, or the operating system reports App Attest as unsupported (some Macs and older hardware), the SDK reports it and sends requests without the header. Your API decides how to treat them.

Setting it up

Six stages, in this order. Each page ends by pointing to the next one. Don’t start a stage until the check of the previous one passes: a mistake then shows up where it was made, not three stages later. Run stages 1 to 5 against a staging verifier first, then add production as described in Staging and production before stage 6.

StageWhat you doPageCheck before moving on
1Register your apps with Apple and Google, write a monitor-mode policy, and Sign and publish itSetting up apps and the policyThe Policy tab shows the status Active and “published version 1”
2Deploy the verifier from the console’s deployment bundleDeploying the verifierattest-verifier check passes, and curl https://<verifier host>/v1/challenge returns JSON whose policyVersion is the published version
3Register the verifier’s domain in the TrustPin project and pin it, because the SDKs pin their calls to the verifierRegistering the verifier’s domainOn the Status tab, Verifier checks, Check now reports the verifier as pinned
4Add the attestation module to your app, configure it, set it up and bind tokensiOS and macOS, Android, Flutter or React NativeThe SDK’s attestation state reaches ready. On a simulator or emulator this needs a debug token
5Verify the TrustPin-Attestation header in your API, or at your gatewayVerifying tokens in your API or Checking tokens at the gatewayYour API logs a verified token with tp.result pass, the expected tp.app, and a bind that matches the session
6Measure in monitor mode, then enforceRolling out: monitor to enforceRequests without the header and fail results are explained; the policy is in Enforce and your API refuses unattested requests on the endpoints you chose

The most likely failure at each stage: at 2, exit code 3 means the policy isn’t published; at 4, verifierUnavailable means the verifier’s domain isn’t registered, and app_not_allowed means the app’s IDs or signing certificate don’t match the policy; at 5, a binding mismatch means your API hashes a different header value than the app bound.

Projects signed with FIDO can’t use app attestation in this release.

Next steps