Anti-AIClone

Log date · Tue

Can Android App Check hide AI prompts?

App Check helps prevent API abuse, but does not hide client prompts. We compare an embedded template with a template identifier.

Can App Check hide a prompt?

No. App Check helps limit unauthorized clients from calling a protected service; it does not hide a prompt shipped in the client. In our two compiled Java samples, the complete template was readable in the first class file, while the second, which carried only a template identifier, did not contain that complete text.

The boundary at a glance
QuestionFinding
What does App Check do?Helps a service recognize attested app or device requests.
Template in the client?The complete text is readable in our class file.
Only an identifier in the client?The complete template is absent from that class file.
Does it replace user authentication?No; the two address different questions.

On 21 July 2026, the Android team described Jetpacker’s cloud and hybrid inference with Firebase AI Logic, cloud Gemini and Gemini Nano, and used App Check to address API abuse. [1] Its companion article shows processing prompts and data on-device. [2]

A small comparison

We compiled two Java classes we wrote with javac 17.0.19. ClientPrompt embeds a clearly labelled demonstration template; ClientReference holds only the identifier itinerary-v1. We ran both, then inspected their class files with javap and an exact string search. This Java comparison illustrates placement of data; it is not a test of Firebase, App Check, an Android APK or model inference.

The field in each sample; these are demonstration placeholders.
private static final String TEMPLATE = "DEMO-PRIVATE-TEMPLATE: summarize the itinerary";
private static final String TEMPLATE_ID = "itinerary-v1";

The programs printed the template and identifier respectively. javap also listed both constants; below is the exact-match search for the complete template. An absent match establishes only that this byte sequence was absent from that file. It does not establish that other resources, variants or network responses omit it.

Exact search results from our run.
ClientPrompt.class | template | present
ClientReference.class | template | absent

Attestation, enforcement and confidentiality

App Check obtains app or device attestation through a provider and supplies a token to the protected service. Firebase describes it as complementary to user authentication and says it does not stop every form of abuse. [3] A service still needs to identify users, authorize operations, and set suitable quotas and monitoring. A valid app attestation is not business authorization for every prompt or call.

The article describes Play Integrity for production and the Debug provider for local development; the initialization snippet shown installs the Debug provider. [1] Current Firebase documentation says App Check enforcement is required for AI Logic from 2 November 2026 and warns against shipping debug tokens or debug builds. [4] Check the actual project’s console status and release variant configuration, then verify rejection of invalid requests in a test environment.

If a template must not be distributed with the app, a controlled service can select it by identifier and execute the cloud request, with the client sending only necessary parameters. The service still needs to validate parameters, user permissions and call rates so a client cannot select arbitrary internal templates. Avoid returning the complete template or putting it into client logs.

What to check in hybrid routing

The article lists four modes: PREFER_ON_DEVICE prefers the device and falls back to cloud when unavailable; PREFER_IN_CLOUD prefers cloud and falls back on-device when offline; ONLY_ON_DEVICE and ONLY_IN_CLOUD restrict where execution occurs. [1] A preference is not an exclusive route. Include the fallback path in the data flow and privacy design.

On-device inference requires the device to receive the inputs and instructions needed to run. A prompt required offline therefore cannot also be assumed confidential from the device holder. A server-side template suits the cloud path; if offline capability is also required, design device-side instructions that can be disclosed and evaluate quality, failure behavior and data transfer separately.

Recommendations by situation

These are design recommendations, not protection effects measured by our experiment. Inventory the assets and acceptable data flows before choosing routing and controls.

Situations and recommendations
QuestionFinding
Cloud call costsConfigure App Check, user authorization, quotas and anomaly alerts.
Confidential templateKeep and execute it on a controlled server; send only needed parameters.
Offline requiredUse disclosable device-side instructions and test unavailable-device behavior.
Development and productionSeparate the Debug provider and tokens; check release configuration.

When reviewing cost, cover normal use and failure paths: model unavailability, network loss, exhausted quota and retries can all change call volume. Record the selected route for cloud and device paths separately rather than treating a UI label as proof of execution location. Avoid logging sensitive inputs.

Check your own app

We compiled and ran the two Java samples, then inspected their constants with the commands below. For your Android app, first produce a release package using your project’s normal build process, then review prompt sources, resources and actual network data flows. Searching for a known fake placeholder is only a starting point: strings may be split, transformed or stored in other resources.

Compile, run and inspect the two Java samples.
javac ClientPrompt.java ClientReference.java
java ClientPrompt
java ClientReference
javap -constants -private ClientPrompt ClientReference

For each path, list inputs, template location, execution location and fallback conditions. With test accounts, verify identity and permissions, App Check enforcement, debug token separation and quota alerts; then repeat with network loss and an unavailable device model. Retain the build version and results, and repeat when configuration changes.

Your checklist

  • Check AI Logic App Check enforcement and the release provider.
  • Keep debug tokens out of production builds.
  • Inventory client prompts and keep confidential templates on a controlled server.
  • Review hybrid routing fallback and data transfer.
  • Verify user authorization, quotas, alerts and failure paths.

Primary sources

All sources and reproduction status ↗