npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

expo-ai-context-shield

v0.1.0

Published

Expo module to protect sensitive content from AI captures and screenshots

Downloads

4

Readme

🛡️ Expo AI Context Shield

The ultimate privacy layer for Expo apps. Protect sensitive UI from AI vision, Screen Captures (iOS), and System Intelligence.

In 2025/2026, OS-level AI (like Google’s Gemini Nano and Samsung’s Galaxy AI) can "read" your app's screen to provide context. While helpful, this poses a massive privacy risk for apps handling bank balances, health data, or private credentials.

expo-ai-context-shield provides a semantic security boundary that makes your content invisible to AI OCR and system intelligence without compromising user experience or causing rendering bugs.

[!WARNING] iOS Support: The iOS implementation is based on native security APIs but has not been tested on physical devices yet. Contributions and feedback are welcome!


🚀 Key Features

  • AI Vision Blocking: Prevents on-device AI (Circle to Search, Gemini Nano, Galaxy AI) from indexing or "reading" your sensitive UI.
  • Hardware-Level Protection: Automatically blocks screenshots and screen recordings on both iOS and Android using native security layers.
  • Zero Rendering Bugs: Optimized for React Native to ensure your content never disappears or "blinks" when security is toggled.
  • Zero Performance Overhead: Pure native implementation with no background listeners or heavy wrappers.

📦 Installation

npx expo install expo-ai-context-shield

💡 Why this module?

The Privacy Risk in the Gen-AI Era

You might think: "If the user triggered the AI, they know what they are doing". In reality, the risk is more subtle:

  • Context Leakage: When a user uses Circle to Search to identify a shoe, the AI captures the entire screen. If a bank balance or CPF is visible next to it, that sensitive data is sent to AI servers as "context".
  • Activity Logs: AI assistant captures are often saved in the user's account history (Google/Samsung/Apple). Without protection, your app's private data ends up stored permanently in third-party logs.
  • Always-on Snapshots: Features like "Recall" or "System Timelines" take periodic screenshots of the screen. This module ensures your app is a "black hole" in those automated captures.

Comparison

| Feature | Standard View | FLAG_SECURE (Full App) | AI Context Shield | | --- | --- | --- | --- | | Protects against AI | ❌ | ✅ | ✅ | | Blocks Screenshots | ❌ | ✅ | ✅ | | UX Friendly | ✅ | ❌ | ✅ | | OCR Resistant | ❌ | ✅ | ✅ |


🛠 Usage

Simply wrap your sensitive components with the AiContextShield.

import { AiContextShield } from 'expo-ai-context-shield';
import { Text, View } from 'react-native';

export default function SensitiveScreen() {
  return (
    <View style={{ flex: 1 }}>
      <Text>Public information (visible to AI)</Text>

      {/* This part will be blacked out in screenshots and invisible to Gemini/Galaxy AI */}
      <AiContextShield isSensitive={true} style={{ padding: 10 }}>
        <Text style={{ fontSize: 24, fontWeight: 'bold' }}>
          Balance: $1,250,000.00
        </Text>
      </AiContextShield>
    </View>
  );
}

🏥 Common Use Cases

| Industry | What to protect? | | --- | --- | | Fintech | Account balances, Credit Card numbers, CVV, QR Codes. | | Healthcare | Patient names, diagnoses, exam results. | | Messaging | Private chat content, self-destructing photos. | | Auth | Recovery keys, 2FA codes, temporary passwords. |


⚙️ API Reference

AiContextShield (Component)

| Prop | Type | Default | Description | | --- | --- | --- | --- | | isSensitive | boolean | false | When true, enables hardware-level protection. | | style | ViewStyle | undefined | Standard React Native styles. | | children | ReactNode | required | The content you want to shield. |


📱 Platform Implementation

  • Android (API 29+): Uses IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS to block data indexing and FLAG_SECURE to block visual pixel capture. Tested on Samsung S23/S24 (Galaxy AI) and Pixel 8/9 (Gemini).
  • iOS (13.4+): Implements a hidden UITextField canvas layer trick. (Note: Not yet tested on physical devices).
  • Web: Transparent fallback. Renders a standard View to maintain layout consistency.

🤝 Contributing

We are looking for help with:

  • Improving the instance counter for FLAG_SECURE on Android.
  • iOS screenshot detection events.
  1. Fork the repo.
  2. Install dependencies: npm install.
  3. Test in the example app: cd example && npx expo run:android.

📄 License

MIT © @mensonones