It's hard to exempt the official Wikimedia apps from anti-abuse mitigations since the server has no way of telling whether it's talking with the app of some other software spoofing the request patterns of the app. For logged-in requests this is not really a problem since the user's identity is usually a stronger anti-abuse signal. For anonymous requests and for login itself (or in the future, for obtaining an OAuth access tokens), it can be more problematic.
Both mobile platforms offer a solution for this problem:
- the Play Integrity API for Android apps
- App Attest for iOS apps
The details differ, but at a high level these both let the app use a platform API to obtain a token attesting the app's identity that's signed by some platform vendor key stored in a secure hardware module. The token can be sent to the server, which can validate it and know it's really talking to the app.
We could expose a MediaWiki API endpoint which does this handshake with the app, and then returns a sessionJwt cookie or access token which includes in its claims the fact that the app has been attested. Since the cookie / access token is included in every request, this information would be easily availble to the traffic stack (Varnish, the API gateway etc) without having to know anything about how attestations work.