How to Keep OS AI Agents Out of Your App's Sensitive Screens A developer-written guide explains how app builders can shield sensitive screens from OS-level AI agents, following Signal's November 20 announcement that it will block screenshots by default in its iOS 27 app and enable Android's Screen security when an AI assistant attempts to read the screen. The piece splits the exposure into three paths — pixel capture, view-hierarchy access via Android's Assist and accessibility APIs, and data that never reaches the screen — and details Android controls such as FLAG_SECURE, which the Assist API documentation says prevents automatically collected screen content from being passed to an assistant unless the window is flagged secure. End-to-end encryption protects a message on the wire and on disk. It does not protect the message while it sits on the screen. At that point the operating system can see it, and so can any AI agent the operating system lets in. On November 20, Signal said it would block screenshots in its iOS 27 app by default, and turn on its "Screen security" setting on Android when it detects an AI assistant trying to read the screen. Signal's announcement https://signal.org/blog/protecting-your-privacy/ names Gemini on Android and Siri AI's Onscreen Awareness on iOS, and calls OS-level AI agents "an existential threat" to its mission. TechCrunch covered it https://techcrunch.com/2026/11/21/signal-restricts-mobile-screenshots-as-it-confronts-existential-threat-of-ai-surveillance/ the next day, and the Hacker News thread https://news.ycombinator.com/item?id=50572348 passed 570 points. Most of the coverage is about Signal. This article is about your app. If you build a banking app, a health app, a password manager, or a chat feature inside a bigger product, the same question applies to you: what can you actually stop, on which platform, and with which API? The answers below come from the official Android, Apple, Microsoft and Electron documentation, and from Signal's own posts. It helps to split the problem into three paths, because each one needs a different control. Pixels. The agent takes a screenshot or reads a screen recording, then runs it through a model. Microsoft Recall works this way on Windows: Signal's footnote describes it as capturing the screen every few seconds and pulling text out with OCR optical character recognition, turning an image of text into real text . Signal says screenshots are "how most agentic systems access data from applications like Signal." Structure. The agent asks the OS for the view hierarchy the tree of buttons, labels and text fields instead of the image. On Android, the Assist API hands the active assistant an AssistStructure with the text and view tree of the current screen. The accessibility API gives a similar tree to any accessibility service the user has turned on. Signal's post names Meta's Muse as an example of a third-party agent that gets in through the deep permissions users grant during setup. In many cases, Signal says, those are accessibility settings, used as "a skeleton key." Data that never reaches the screen. Notifications, files on disk, and other OS frameworks and APIs. Signal says plainly that screenshot blocking "does not address other more sneaky ways AI agents could potentially access application data, such as retrieving content already present on a user's device via the filesystem." Screen protection only covers the first path fully, and the second path partly. Keep that in mind as you read the platform sections. Android gives you the most controls, and they are documented. Here they are in the order you will probably need them. FLAG SECURE is a window flag. The Android fraud-prevention guide https://developer.android.com/security/fraud-prevention/activities says it "tells Android not to allow screenshots or to display the window view on a non-secure display such as Casting the screen ." A screenshot of a secure window comes out blank. It also matters for assistants. The Assist API guide https://developer.android.com/training/articles/assistant says the system passes automatically collected screen content to the assistant "unless the current window is flagged as secure." class ChatActivity : AppCompatActivity { override fun onCreate savedInstanceState: Bundle? { super.onCreate savedInstanceState window.setFlags WindowManager.LayoutParams.FLAG SECURE, WindowManager.LayoutParams.FLAG SECURE setContentView R.layout.activity chat } } Three details from the docs are easy to miss: FLAG SECURE explicitly for every window created by the activity, including dialogs," and that "there is no global app-level mechanism to exclude all views from the assistant." For a SurfaceView , use setSecure . onProvideAssistContent or onProvideAssistData , it can still hand data to the assistant itself. On a sensitive screen, do not put message text or account numbers into those callbacks. The Android 14 screenshot guide https://developer.android.com/about/versions/14/features/screenshot-detection also recommends a setting that lets users switch the flag. Signal does exactly that. To turn it off at runtime, call window.clearFlags WindowManager.LayoutParams.FLAG SECURE . Blocking every screenshot of every screen is heavy. Android 15 API 35 added View.setContentSensitivity . The View reference https://developer.android.com/reference/android/view/View says the system will "hide content drawn by a sensitive view from screen sharing and recording," and that "the window hosting a sensitive view will be marked as secure during an active media projection session." if Build.VERSION.SDK INT = Build.VERSION CODES.VANILLA ICE CREAM { otpField.setContentSensitivity View.CONTENT SENSITIVITY SENSITIVE } Note the scope: this kicks in during media projection, which means screen sharing and screen recording. It is a lighter option for login and payment forms. It is not a full replacement for FLAG SECURE when your threat is a screenshot-based assistant. This is the closest thing Android has to an answer for the "skeleton key" problem. Android 14 API 34 added View.setAccessibilityDataSensitive . Per the View reference, it "specifies whether this view should only allow interactions from AccessibilityServices with the AccessibilityServiceInfo.isAccessibilityTool property set to true." if Build.VERSION.SDK INT = Build.VERSION CODES.UPSIDE DOWN CAKE { messageList.setAccessibilityDataSensitive View.ACCESSIBILITY DATA SENSITIVE YES } Who gets to set isAccessibilityTool ? Google Play's accessibility API policy https://support.google.com/googleplay/android-developer/answer/10964491 says: "Only services that are designed to help people with disabilities access their device or otherwise overcome challenges stemming from their disabilities are eligible to declare that they are accessibility tools." So a screen reader built for people with disabilities can keep working, while a general-purpose service that is not a declared accessibility tool is shut out of that view. Two limits: it only protects the views you mark, and the flag is self-declared. Play's policy says it is set "using the isAccessibilityTool attribute in the service's metadata file," and the check on that claim is Google Play's review, not the API. Sometimes you want to know when capture happens rather than block it. Android has two callbacks. Screenshot detection arrived in Android 14. You declare the install-time permission android.permission.DETECT SCREEN CAPTURE , then register a callback per activity: private val screenCaptureCallback = Activity.ScreenCaptureCallback { // Warn the user, or tell the other side of the chat. } override fun onStart { super.onStart registerScreenCaptureCallback mainExecutor, screenCaptureCallback } override fun onStop { super.onStop unregisterScreenCaptureCallback screenCaptureCallback } Read the limits on the screenshot detection page https://developer.android.com/about/versions/14/features/screenshot-detection before you rely on it. The callback fires only for screenshots taken with "a specific combination of hardware button presses." It does not fire for ADB or instrumentation test captures. It also does not give you the image. So it tells you about a person pressing buttons, not about an agent grabbing pixels in the background. Screen recording detection arrived in Android 15 https://developer.android.com/about/versions/15/features . It needs the DETECT SCREEN RECORDING permission, and the callback runs whenever your app becomes visible or invisible in a recording: php private val recordingCallback = Consumer