Play Integrity API

Also known as: SafetyNet

On this page 7

The Play Integrity API is a Google Play service that lets an Android app and its backend verify whether a request comes from a genuine, unmodified app binary, installed through Google Play, running on a genuine Android device with a legitimate account. In mobile security, it is the standard remote attestation mechanism for Android and the successor to the deprecated SafetyNet Attestation API.

The API does not block anything on its own. It returns a signed and encrypted integrity verdict that the app forwards to its server, where the developer decides how to respond: allow the action, ask for extra verification, limit features or refuse the request.

How the Play Integrity API produces a verdict

The Play Integrity API works as a challenge and response protocol between the app, Google Play services and the developer’s backend. The app asks Google Play for an integrity token bound to a specific request, Google evaluates the app and device, and the backend decrypts and checks the token before trusting the action.

  1. The backend issues a unique nonce or the app computes a request hash over the sensitive action, such as a payment or a login.
  2. The app calls the Play Integrity library, which contacts Google Play services on the device.
  3. Google Play gathers signals: the app signing certificate, the installed version, device attestation data and account licensing state.
  4. Google returns an encrypted, signed token, which the app sends unchanged to its own server.
  5. The server decrypts the token, either through Google’s decode endpoint or locally with downloaded keys, and validates the nonce, package name and timestamp.

The decisive design principle is that trust decisions belong on the server. If the app itself interprets the verdict, an attacker who controls the device can patch out the check, which is exactly the threat the API exists to address.

Verdict fields and what they mean

Each decrypted token contains several independent verdict groups, and a robust backend evaluates them separately rather than treating the result as a single pass or fail. The table below summarizes the main fields.

Field groupTypical valuesWhat it tells the backend
Request detailsPackage name, nonce or request hash, timestampWhether the token belongs to this request and is fresh
App integrityPLAY_RECOGNIZED, UNRECOGNIZED_VERSION, UNEVALUATEDWhether the binary matches a version distributed by Google Play
Device integrityMEETS_BASIC_INTEGRITY, MEETS_DEVICE_INTEGRITY, MEETS_STRONG_INTEGRITYHow strongly the device appears genuine and unmodified
Account detailsLICENSED, UNLICENSED, UNEVALUATEDWhether the user acquired the app through Google Play
Environment detailsApp access risk, Play Protect statusWhether risky apps are running or Play Protect is disabled
Main fields of a decrypted integrity token

The device integrity labels form a ladder of assurance. Basic integrity tolerates devices that may lack certification, device integrity requires a certified Android device with a locked bootloader, and strong integrity adds hardware-backed attestation and, on recent Android versions, a reasonably current security patch level.

LevelMain requirementTypical use
Basic integrityDevice passes basic system integrity checksLow-risk features, broad reach
Device integrityCertified device, verified boot, locked bootloaderDefault bar for most protected actions
Strong integrityHardware-backed key attestation and recent patchesBanking, payments, high-value transactions
Virtual integrityRecognized emulator such as Google Play Games for PCGames that permit sanctioned emulators
Device integrity levels compared

Standard and classic requests

The Play Integrity API offers two request types that trade latency against per-request uniqueness. Standard requests are recommended for frequent checks, while classic requests suit rare, high-value operations.

AspectStandard requestClassic request
PreparationWarm-up call prepares a token provider in advanceNo warm-up; each call starts from scratch
LatencyA few hundred milliseconds after warm-upOften several seconds
Replay protectionRequest hash plus Google-side protectionServer-generated nonce checked by the backend
Best fitLogins, API calls, in-game actionsAccount recovery, large transfers, rare events
Standard and classic integrity requests

Both types share a daily request quota per app, with a default that suits most apps and an increase available on request. Exceeding the quota or calling the API on every screen wastes budget, so teams usually attest at meaningful trust boundaries and cache the server-side decision for a short session.

Relationship to SafetyNet and neighboring controls

The Play Integrity API replaced the SafetyNet Attestation API, which Google deprecated and then shut down after a migration period. SafetyNet returned two simple booleans, basicIntegrity and ctsProfileMatch, whereas Play Integrity adds app recognition, licensing and environment signals and supports remediation dialogs.

Play Integrity is often confused with other Android protections in the same mobile security toolbox. Google Play Protect scans for harmful apps on the device, Android Verified Boot ensures the operating system has not been modified, and rooting is one of the conditions that typically causes integrity verdicts to fail. Play Integrity consumes the outcome of these mechanisms and reports it to the developer.

MechanismWho consumes the resultPrimary question answered
Play Integrity APIApp developer’s backendCan this request be trusted
SafetyNet AttestationApp developer’s backend (retired)Is the device compatible and unmodified
Google Play ProtectUser and GoogleAre harmful apps installed
Android Verified BootDevice bootloaderIs the system image authentic
Key attestationAny relying partyIs this key stored in secure hardware
Play Integrity API and related mechanisms

Limitations and common implementation mistakes

The Play Integrity API raises the cost of abuse but is not a guarantee of safety. Determined attackers use leaked device keys, modified frameworks and hardware farms to obtain passing verdicts, and Google responds by revoking keys and tightening the strong level, so the verdict is best treated as one risk signal among several.

  • Checking the verdict on the client lets attackers patch the check away; always evaluate on the server.
  • Skipping nonce or hash validation enables replay of an old passing token.
  • Requiring strong integrity everywhere locks out legitimate users on older or uncertified devices, including many custom ROM users.
  • Ignoring UNEVALUATED results hides outages or quota exhaustion; define a fallback policy in advance.
  • Relying on it outside Google Play fails for devices without Google Play services, such as many devices sold in China or de-Googled phones.

Privacy and fairness also matter. The verdict reveals coarse device state, and blanket denial policies can exclude users who chose alternative operating systems, so proportionate responses such as step-up authentication usually work better than hard blocks.

Stripped to the essentials

The Play Integrity API is like a trusted doorman who checks identification before letting a visitor into a building. When an app wants to do something important, such as move money, it asks Google to look at the phone and the app and write a sealed note about what it saw.

The app passes that sealed note to its own company server, which opens it and reads the verdict. If the note says the app is genuine and the phone has not been tampered with, the server says yes. If not, it can ask for more proof or say no. The key point is that the server, not the phone, makes the decision.

Where it is applied

A regional bank runs a mobile banking app used by about 400,000 customers. Fraud analysts notice that automated scripts on modified phones are creating accounts and testing stolen card numbers. The team adds standard integrity requests at login and before every transfer, binding each request hash to the transfer amount and recipient.

The backend allows routine actions when the device meets device integrity and the app is Play recognized. Transfers above a set limit require strong integrity; when it is missing, the server asks for an additional one-time code instead of blocking. Within the first months, scripted account creation falls sharply, while legitimate customers on older phones keep access through step-up verification. The bank gains a fraud signal without turning away honest users.