A lightweight, gateway-connected Android agent designed for high-security environments such as GrapheneOS. The default backend is gemma-4-E2B-it-qat-UD-Q4_K_XL.gguf, served by llama.cpp through an OpenClaw gateway. The Android app focuses on observation and validated action execution.
The system is defined by three strict boundaries:
- Component:
AgentAccessibilityService - Role: Passive collection of UI state
- Security: No business logic - pure observation
- Component: OpenClaw gateway instance (running on your own infrastructure)
- Role: Hosts inference models and handles reasoning
- Security Layers:
- Connection: TLS with token authentication
- Firewall: Network egress policy restricts connections to configured gateway only
- Privacy: All inference happens on YOUR infrastructure (not third-party cloud)
- Component:
ActionDispatcher - Role: Parses JSON responses from the gateway and executes actions
- Security: Checks actions against safe list, requires physical Volume Up confirmation for destructive actions
app/
├── src/main/
│ ├── java/com/mazzlabs/sentinel/
│ │ ├── core/ # Agent controller
│ │ ├── gateway/ # OpenClaw gateway client
│ │ ├── inference/ # Inference routing (remote only)
│ │ ├── service/ # Accessibility service
│ │ ├── security/ # Action firewall
│ │ ├── tools/ # Tool modules
│ │ ├── input/ # Voice input
│ │ ├── overlay/ # Floating button
│ │ ├── tts/ # Text-to-speech
│ │ └── ui/ # Configuration UI
│ └── res/ # Android resources
└── build.gradle.kts
- Target SDK: 34 (Android 14)
- Min SDK: 34
- Device: ARM64 (arm64-v8a) or any modern Android device
- OS: GrapheneOS recommended, but any Android 14+ works
- Android Studio: Ladybug (2024.2.1) or newer
- JDK: 17+
- OpenClaw Gateway: You need a running OpenClaw gateway instance
- Can be self-hosted (local network or VPS)
- Defaults to the local Gemma 4 GGUF through llama.cpp
- Can be reconfigured for another OpenClaw model provider
- See OpenClaw documentation for setup
Keep gemma-4-E2B-it-qat-UD-Q4_K_XL.gguf in the project root, install a current llama.cpp build, then follow the Quick Start. The model file is intentionally excluded from Git.
./gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk- Open Sentinel Agent on your device
- Tap "Settings" → "Gateway Settings"
- Enter your gateway URL (e.g.,
https://gateway.yourdomain.com) - Enter your gateway authentication token
- Tap "Connect" and verify connection status
- In Sentinel app, tap "Enable Service"
- Grant accessibility permissions in system settings
- Return to app and verify "ACTIVE" status
- Verify Connection: Ensure gateway shows "CONNECTED" in main screen
- Activate: Tap floating overlay button or use voice trigger
- Command: Speak or type your command
- Confirm: For destructive actions, press Volume Up to confirm
- TLS-only connections to gateway
- Token-based authentication
- Network egress firewall restricts connections to configured gateway
- No third-party API calls - all inference via YOUR gateway
- Heuristic analysis of action targets
- Dangerous actions require physical Volume Up confirmation
- Safe list for benign operations
- All reasoning happens on YOUR infrastructure (self-hosted gateway or gateway with your API keys)
- UI observation data only sent to YOUR gateway
- No third-party telemetry or analytics
- Full data sovereignty - you control the model and infrastructure
- Designed for GrapheneOS's strict security model
- Respects network permissions and restrictions
- Compatible with sandboxed Google Play (if needed)
Gemma runs on gateway hardware instead of inside the Android process. This keeps the app pure Kotlin, avoids shipping a multi-gigabyte model in the APK, reduces device memory pressure, and preserves a user-controlled inference boundary.
./gradlew test./gradlew koverXmlReportMIT License - See LICENSE file
- OpenClaw - Gateway and inference platform
- llama.cpp - Local GGUF inference server
- GrapheneOS - Security-focused Android