RASP explained: what runtime self-protection can and can't see
Runtime application self-protection runs inside your app, on a device you do not control. What it can observe from there, what it structurally cannot, and how to decide what a detection should actually do.
Runtime application self-protection (RASP) is code that runs inside your app and checks the conditions the app is running under: the device, the process, and the app's own code. On mobile, it is the main tool for noticing that a release build is being run somewhere hostile. It is also easy to over-sell. This post is about where its view starts and ends.
Where RASP sits
A RASP check is ordinary code in your process. It has the same permissions as the rest of your app, it runs on a device the user (or an attacker) controls, and it is distributed in the same package that an attacker can unpack, read and modify. Everything below follows from that position.
What it can see
The device environment
From inside the app, code can look for evidence that the operating system's guarantees have been weakened: signs of a rooted device, such as su binaries, known root-management packages, writable system partitions or unexpected system properties; signs of an emulator; developer options and USB debugging; and a debugger attached to the process. Each of these is a heuristic. A separate post covers why root detection in particular is a contest rather than a fact.
The integrity of the app itself
The app can check that it is still the app you shipped. On Android, the most useful single check is the signing certificate: a repackaged app has to be re-signed with someone else's key, and the app can compare the certificate it is running under with the one you expect. It can also hash its own code or resources, and check the installer that put it on the device.
Its own process
Instrumentation frameworks leave traces in the process they attach to: unexpected libraries in the memory map, extra threads, modified function prologues. What a Frida session sees inside your app goes into those signals.
What it can't see
- Your servers. RASP sees the device, not your API. A script that calls your API directly with a stolen token never runs your app at all, so no client-side check is involved. Server-side authentication, rate limiting and authorization cover that path.
- Its own removal. An attacker who unpacks the app can find a check and patch it out, or hook it at runtime so it always reports a clean device. Hardening (obfuscation, many independent checks, integrity checks that cover each other) makes that slower. It does not make it impossible, and a detection that has been removed reports nothing.
- Intent. A rooted phone may belong to an attacker, or to a developer or an enthusiast with no interest in your app. A signal describes the environment, not the person.
- Things outside the process. Malware that reads the screen through an accessibility service, or a compromised network, may leave no trace inside your app at all.
Detect, report, or react
Once a check fires, there are three things an app can do with the result, and they have very different costs.
- Detect only: record the result locally. Cheap and safe, but nobody learns anything unless the result is collected.
- Report: send the result to your backend, ideally tied to a session. This lets the server decide, with context, whether to require step-up authentication, limit an action or just watch. It also tells you how often each condition occurs in your real user base before you act on it.
- React on the device: refuse to run, wipe local data, or disable a feature. Strong, but also the most likely to hit legitimate users, and the reaction itself shows the attacker exactly which check to bypass.
Most teams should start with detect and report, measure, and only then decide which conditions justify a reaction, on the server where the decision can be changed without a new release. The OWASP MASVS resilience controls and the MASTG testing guide describe the individual techniques and how to test them.
Next step: write the reaction table before writing any checks
- List the conditions you care about: rooted device, repackaged app, debugger attached, emulator, instrumentation.
- For each one, write what the server should do when it is reported: nothing, log only, step-up authentication, or limit a specific action.
- Mark which actions in your app are worth protecting at all: login, payments, account changes, high-value content.
- Only the cells where the answer is not "nothing" need a check that reports. Everything else is cost without benefit.
Where Tamandua App Guard is today
Current App Guard evidence is limited to detect-only Android lab results on one tested device: root and re-signing were detected and logged on-device. No hosted completion, console telemetry, public enrollment, purchase, blocking, or verified effect is offered. An assisted Android pilot is under consideration, not available. iOS is source/preview only, with no enrollment or availability offer. A request records interest and does not grant access or guarantee delivery.