inflearn logo

When AI Agents Operate My App: Android App Security in Practice

In an era when AI agents tap apps on users’ behalf, we’ll get hands-on practice in an emulator to prevent transfers and verification codes in your Android app from being abused.

1 learners are taking this course

Level Basic

Course period Unlimited

Android
Android
Kotlin
Kotlin
Docker
Docker
prompt engineering
prompt engineering
security training
security training
Android
Android
Kotlin
Kotlin
Docker
Docker
prompt engineering
prompt engineering
security training
security training

What you will gain after the course

  • How to audit my app’s sensitive screens, buttons, intents, deep links, and notifications from the perspective of agents and malicious apps

  • accessibilityDataSensitive · Notification public version · App code that protects verification codes with SMS Retriever

  • How to build a filterTouchesWhenObscured/setHideOverlayWindows and “what, where, and how much” confirmation screen

  • Caller Verification, Verified App Links, How to Restrict Calls Between Apps with FLAG_IMMUTABLE, and a Checklist for Auditing My App’s Components

  • Designing agents that know where data visibility breaks down and ensure code stays within the task scope defined in the user’s own words

  • Criteria for deciding what to expose to AppFunctions and in-app agents

  • A structure in which transfer requests are signed using server-side holds and limits, a requestHash, and a device key authenticated via biometrics.

  • Agent action logs and alerts, and the sequence for stopping and rolling back during an incident

A single text message can reach the transfer button in my payment app.

Through hands-on emulator exercises, learn how AI agents that read your screen and control apps on your behalf can exploit your app—and what Android app developers can prevent with code. There are also dedicated paths for developers who want to add agent features to their apps and backend developers who operate payment and authentication servers.

  • Each lesson follows the sequence explanation (animation) → reenactment (research and attack patterns in a hands-on lab) → demo (actual emulator screens). All attacks take place only in the emulator on your PC and in fake apps.

  • See for yourself how a single fake text message, one review, or a box drawn over another can pass through an agent and lead to a money transfer, leaked conversation, or order—and use make check to determine in one line whether it’s “breached → blocked”.

  • 9 sections, 27 lessons, 4 hours and 19 minutes total. Choose the path that best fits your work from three learning tracks: app developers (25 lessons), agent developers (21 lessons), and backend and security (11 lessons).

Why did we create this course?

Since the start of 2026, mobile agents have proliferated rapidly. Operating system agents open apps on a virtual screen inside the device, view screenshots, and tap; open-source agents control phones through accessibility services or adb on a PC. Research published that same year showed that a single hidden sentence on the screen can make these agents do things the user never asked them to do, and banking malware that exploits accessibility permissions in the same way is already causing real harm. Yet courses that addressed this problemfrom the perspective of developers building apps were hard to find. This course takes another look at your app’s screens, buttons, intents, deep links, notifications, and authentication codes through the lens of agents and malicious apps, then adds layers of protectionin three places: the app code, the agent code, and the server.

There’s something I need to be honest about.

We reproduce the breach in the lab using an educational fake modeldesigned to follow hidden instructions exactly. When we ran the same scenario on the latest commercial models, they generally weren’t fooled by hidden instructions this simple. However, more sophisticated wording or other models may work, and results vary by model and date. That’s why this course teaches you how to block attacks in code outside the model, rather than expecting the model to refuse on its own.

What you'll learn in this section


Section (1) Introduction · The Phone Got an Agent

We begin with a scene where a hidden instruction in a text message travels through accessibility permissions all the way to a payment app’s verification code and transfer button. We outline three ways an agent sees the screen (the accessibility tree, virtual screens and screenshots, and functions exposed by the app) and the different defenses for each, then launch an emulator, lab server, and fake app to watch the first task through to completion.

Section (2) The Screen Is the Input · Text Messages, Notifications, Reviews, and Hidden Accessibility Text

Text messages and push notifications anyone can send, as well as group chats and reviews anyone can use, become commands to the agent. We also recreate instructions that don't appear onscreen and are embedded only in accessibility description labels and very small text. We see how far data-display protections go and where they fail, and make the code enforce the scope of work set solely by the user's words.

Section (3) Verification Codes and Money · accessibilityDataSensitive, Protecting Verification Codes

We trace how a verification code for an attacker-initiated transfer can be handed over with just “Reply for me.” We enable defenses on both sides to block it: app developer defenses (accessibilityDataSensitive, not including codes in notifications, SMS Retriever, and FLAG_SECURE) and agent defenses (stopping in sensitive apps, app allowlists, and hiding verification codes). We also examine what the verification-code protections added in each Android version prevent—and what they leave exposed.

Section (4) Can You Trust Confirmation Dialogs? · Overlays, Fake Logins, and Tapjacking

Overlaid windows deceive people and agents in different ways. We recreate a “Security check complete” box over a confirmation screen and a login screen that mimics the payment app’s name, then block them with filterTouchesWhenObscured, setHideOverlayWindows, and a confirmation screen that shows “what, where, and how much”.

Section (5) Calls Between Apps · Intents, Deep Links, PendingIntents

See how another app can call an agent’s external entry point or use a single deep link to skip straight to the transfer confirmation screen. We’ll organize caller verification, verified app links, “fill it in, then confirm again,” FLAG_IMMUTABLE, and exported-component checks into a checklist for inspecting your app’s components.


Section (6) Giving Agents Access to Your App · AppFunctions and In-App Agents

When exposing functionality through AppFunctions instead of screen automation, we’ll cover what to expose and what not to, how to define tool scope, confirmation, and model output validation when adding a support agent to your app, and where to store contacts, conversation history, and model keys.

Section (7): What Does the Server Trust? · Holds and Limits, Play Integrity, Transaction Signing

Even if the app is compromised, the server is the last line of defense. We’ll cover holds and limits for first-time senders, Play Integrity’s requestHash and risk assessment of screen-control apps, hardware key attestation, and transaction signing, where transfer requests are signed with a device key after biometric authentication.

Section (8) When Someone Else’s Agent Uses My App · ADB Agents, Operating System Agents

We verify with an actual screen-structure dump that accessibility-sensitive flags do not work against open-source agents that control phones from a PC via ADB. We outline what app developers can do to protect their apps from operating system and manufacturer agents that interact with them through screenshots on a virtual screen.

Section (9) Release and Operations · Action Logs, Incident Response, and Pre-Release Checklists

We’ll look at what to record in agent behavior logs and how to monitor them, review the steps for stopping and rolling back when an incident occurs, and wrap up with pre-release checklists for app developers and agent developers (12 items each).

Recommended for
these people

Who is this course right for?

  • A developer building agent features that run on mobile phones.

  • An Android developer looking to add AI counseling or AppFunctions to my app

  • A developer building Android apps with sensitive screens such as payments, authentication, and messaging

  • Backend and security teams operating payment and authentication servers, considering how to handle requests sent by agents.

  • For those who have only seen prompt injection on the web or servers and want to see firsthand how it differs on a mobile phone.

Need to know before starting?

  • You just need to be able to read Kotlin code and have heard of activities and intents. No knowledge of LLMs or security is required.

  • You just need to be able to run commands in the terminal and read the output.

Hello
This is brunoleebi8302

Career Verified

I took my first steps as a server developer during the Y2K era, a time of upheaval in the IT industry. Since then, I have moved between developer and infrastructure engineer roles across a wide range of industries, gaining hands-on experience with everything from the fundamentals of technology to complex infrastructure ecosystems. Building on my experience constructing and refining countless systems, I have recently been creating new value in the fields of IT security and convergent technologies.
More

Curriculum

All

28 lectures ∙ (4hr 18min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

brunoleebi8302's other courses

Check out other courses by the instructor!

Similar courses

Explore other courses in the same field!

Limited time deal

$7,186.00

35%

$68.20