All plugins

android-pilot

Owner-only, one-step-at-a-time control of the visible screen of ONE pinned physical Android device over USB ADB (optionally the same pinned device over private Wi-Fi/Tailscale ADB, opt-in): private screenshot, tap, long press, swipe/scroll, home/back/recents and short validated text. Unarmed and hidden from the model by default; the owner pins and arms it from a local terminal (TTY plus a typed 4-letter code, TTL 1-30 min, hard cap 60), and the commands refuse to run inside agent sessions or their terminal children. Only the local interactive CLI or the owner's private Telegram DM (owner_telegram_id, empty by default = Telegram disabled) may drive it; 1 gesture and 2 screenshots per user message; cron, background, subagents and other platforms refused. Locked screens, sensitive apps (settings, messaging, banking, payment, gallery, password managers) and password fields are refused except home/back; emulators refused. Disclosure — runs the user's own adb binary (allowlisted argv, shell=False; no shell, intents, install, file push/pull, pairing or tcpip), and that adb process inherits the Hermes environment; no other network calls, no credentials, no background processes. Screenshots stay in memory and go into the model context only. Writes HMAC-signed pin/arm records, a signing key and an audit log (no text or images) under $HERMES_HOME/android-pilot/.

SantrionlinecomToolsv0.1.2Updated 1 day ago

About

Owner-only, one-step-at-a-time control of the visible screen of ONE pinned physical Android device over USB ADB (optionally the same pinned device over private Wi-Fi/Tailscale ADB, opt-in): private screenshot, tap, long press, swipe/scroll, home/back/recents and short validated text. Unarmed and hidden from the model by default; the owner pins and arms it from a local terminal (TTY plus a typed 4-letter code, TTL 1-30 min, hard cap 60), and the commands refuse to run inside agent sessions or their terminal children. Only the local interactive CLI or the owner's private Telegram DM (owner_telegram_id, empty by default = Telegram disabled) may drive it; 1 gesture and 2 screenshots per user message; cron, background, subagents and other platforms refused. Locked screens, sensitive apps (settings, messaging, banking, payment, gallery, password managers) and password fields are refused except home/back; emulators refused. Disclosure — runs the user's own adb binary (allowlisted argv, shell=False; no shell, intents, install, file push/pull, pairing or tcpip), and that adb process inherits the Hermes environment; no other network calls, no credentials, no background processes. Screenshots stay in memory and go into the model context only. Writes HMAC-signed pin/arm records, a signing key and an audit log (no text or images) under $HERMES_HOME/android-pilot/.

Android Pilot (android-pilot)

Owner-only, one-step-at-a-time control of the visible screen of one pinned, physical Android
device, for Hermes Agent.

Community plugin. Android Pilot is an independent plugin for Hermes Agent. It is not made,
endorsed or supported by Nous Research.

Android Pilot gives the agent a single tool, android_pilot, that can take a private screenshot,
tap, long-press, swipe/scroll, press home/back/recents and type short plain text on one Android
phone or tablet that you pinned yourself over a USB ADB link. Optionally, the same pinned
device can be reached over wireless ADB on a private Wi-Fi or Tailscale network.

The tool is unarmed by default and invisible to the model until you arm it from a local
terminal with a short time limit. There is no shell, no app launching by intent, no file access and
no background work.

What it can do

android_pilot actionWhat it does
statusArm status (does not touch the device)
screenshotOne screenshot, kept in memory only (downscaled to at most 1280 px). Refused while locked or when a sensitive app is in front
tapTap at (x, y) in device pixels. Apps are opened by tapping their icons
long_pressPress and hold for 500–2000 ms
swipe / scrollFree swipe, or scroll up/down/left/right
keyOnly home, back, recents
textShort plain text (1–64 characters: letters, digits, space, . , -). Refused if it contains 4+ consecutive digits or words such as password/PIN/OTP/code
disarmDisarm immediately (the model may always disarm, never arm)

capture_after: true takes one screenshot after a step, within the per-message screenshot budget.

Safety model

Every rule below fails closed: if the plugin cannot prove a condition, the action is refused.

Arming is a human act at a local terminal.

  • hermes android-pilot trust (pin a device) and hermes android-pilot arm (allow control for
    1–30 minutes, hard cap 60) need an interactive TTY on stdin and stdout and a random 4-letter
    code typed back by the person at the keyboard.
  • Both commands refuse to run when any Hermes agent marker is present in the environment
    (HERMES_SESSION_PLATFORM, HERMES_SESSION_ID, HERMES_SESSION_KEY, HERMES_SESSION_CHAT_ID,
    HERMES_INTERACTIVE, HERMES_EXEC_ASK, HERMES_GATEWAY_SESSION, HERMES_SINGLE_QUERY_SESSION,
    HERMES_CRON_SESSION, HERMES_KANBAN_TASK). Hermes's chat CLI, TUI and gateway export these and
    their terminal/PTY children inherit them, so the agent cannot arm or pin by running the command
    through its own terminal tool.
  • The model-facing tool has no arm/trust action. While unarmed, the tool is hidden from the
    model (check_fn). Arm and trust records are HMAC-signed; a tampered or expired record disarms.
  • An arm window also ends after max_actions_per_arm actions (default 120), on disarm/revoke,
    or as soon as the pinned device no longer matches.

Only the owner can drive it, one step per message.

  • Local CLI: only the classic interactive hermes chat on a TTY, in a process that is not a
    gateway (allow_local_cli, default true).
  • Telegram: only when owner_telegram_id is set and the sender (actor and user id) is
    that id and the chat is the private DM with that id. Groups, channels and other users are
    refused before any ADB call. Empty by default, which means Telegram can never drive the
    device.
  • Every other platform (Discord, WhatsApp, Slack, API server, Desktop/TUI, …) is refused because the
    plugin cannot prove who the sender is. Cron jobs, kanban/background workers, subagents (sessions
    with a parent) and plugin session forks are refused.
  • A pre_llm_call hook opens a fresh budget per user message: 1 gesture and up to 2 screenshots
    per message
    by default (hard caps 3/3), with at least 0.4 s between gestures. A tool call that no
    user message opened (subagent, background) gets no budget.

Only the visible, non-sensitive screen of the pinned device.

  • Locked or dark screen: refused. The plugin never unlocks or wakes the device.
  • Sensitive foreground apps: Settings, permission/installer screens, SystemUI (notification shade),
    Play Store, messaging and email (WhatsApp, Telegram, SMS, Gmail, phone/contacts), banking, payment
    and wallets, password managers, gallery/files/camera, app lockers. Only home/back are allowed
    there, so the agent can leave. An unreadable window focus counts as sensitive.
  • An active password/PIN input field blocks everything except home/back.
  • A screenshot is discarded if the screen changed app or became sensitive while it was taken.
    Screenshots are never written to disk by the plugin.

Narrow ADB surface.

  • Every ADB argv is checked against an allowlist (validate_argv) and run with shell=False. No
    free-form shell, no am start/intents, no install/uninstall, no push/pull, no settings or
    permission changes, no power key, no adb tcpip, no adb pair.
  • adb itself must be a trusted binary: inside a platform-tools folder or a root-owned system
    bin directory, not group/world-writable.
  • Device checks run on every call: physical USB serial (emulators such as emulator-5554,
    ro.kernel.qemu=1, ip:port and mDNS names are refused unless wireless mode is enabled for the
    pinned device), plus a fingerprint (brand, manufacturer, model, device, ro.serialno,
    ro.build.fingerprint) that must match the pin. Optional denied_brands/allowed_brands filters.

Threat model

Defends against: a model that wanders, is confused, or is prompt-injected by on-screen
content or a message, in a session where Android Pilot is the only way it can reach the phone; other
Telegram users and group members; unattended runs (cron, background, subagents); switching or
spoofing the attached device; acting on lock screens, payment or messaging apps and password fields.

Does not defend against:

  • An agent with an unrestricted terminal tool on the same OS user. It could run adb directly
    or edit the plugin's state files. That path is governed by Hermes's own command approvals, not by
    this plugin. Keep Hermes approvals on, and unplug the cable or turn off USB debugging when you are
    not using Android Pilot. This plugin is not a sandbox.
  • Anyone who already controls your laptop account or the paired ADB keys.
  • Sensitive apps the package-name list does not recognise. Use allowed_packages for a strict
    allowlist.
  • Screenshots entering the model context. The plugin does not store them, but Hermes session history
    may keep tool results. Avoid screenshots of screens with private data.

Requirements

  • Hermes Agent >= 0.21.5, Python >= 3.10. Pillow is used to downscale screenshots when available
    (it ships with Hermes); otherwise the PNG is passed through.
  • Android SDK Platform-Tools (adb) on the machine running Hermes. The plugin does not bundle it.
    • Official download: https://developer.android.com/tools/releases/platform-tools
    • Debian/Ubuntu sudo apt install adb, macOS brew install android-platform-tools,
      Windows winget install Google.PlatformTools
    • WSL: either use the Windows adb.exe (auto-detected at
      /mnt/c/Users/*/AppData/Local/Android/Sdk/platform-tools/adb.exe; USB works through the Windows
      driver), or Linux adb with the device forwarded via usbipd-win. Do not run two ADB servers
      for the same device.
  • A physical Android device with Developer options → USB debugging on, connected by USB
    and with this computer's RSA key accepted (adb devices -l shows device, not unauthorized).
    Emulators are refused by design.

Install

hermes plugins install Santrionlinecom/hermes-android-pilot
hermes plugins enable android-pilot

Or clone it yourself:

git clone https://github.com/Santrionlinecom/hermes-android-pilot ~/.hermes/plugins/android-pilot
hermes plugins enable android-pilot

A gateway that is already running picks the plugin up on its next restart (or when Hermes reloads
plugins).

First use

Run these yourself in a normal terminal on the computer the phone is plugged into (not through the
agent, not from the Hermes chat):

hermes android-pilot discover                 # read-only: which adb, which devices are attached
hermes android-pilot trust --serial <SERIAL>  # verify the USB device and pin it (type the 4-letter code)
hermes android-pilot arm --minutes 10         # allow control for 1-30 minutes (type the code)
hermes android-pilot status                   # pin/arm state, no device access
hermes android-pilot disarm                   # stop now
hermes android-pilot revoke                   # disarm and forget the pinned device

<SERIAL> is the first column of adb devices -l. Only one device can be pinned; a new trust
replaces the old pin and disarms. Unlock the phone yourself, then ask the agent for one step at a
time, for example: "Take a screenshot of my phone", then "Tap the Chrome icon".

To drive it from Telegram as well, set your numeric Telegram user id and talk to your bot in its
private chat:

plugins:
  entries:
    android-pilot:
      settings:
        owner_telegram_id: "123456789"

The tool appears to the model only while armed; after arming you may need to send a new message (or
start a new session) before the model sees it.

Wireless ADB (Wi-Fi / Tailscale, opt-in)

Off by default. It needs both allow_wireless: true and a device that was pinned over USB
with --wireless. The pin stores (HMAC-signed) ro.serialno, model, ro.build.fingerprint,
brand, manufacturer and device; a wireless connection is accepted only if all of them match when
read back over that connection.

  1. With USB plugged in: hermes android-pilot trust --serial <SERIAL> --wireless.
  2. Set plugins.entries.android-pilot.settings.allow_wireless: true.
  3. On the phone: Developer options → Wireless debugging, and pair the computer yourself
    (adb pair IP:PORT plus the pairing code shown on the phone). The plugin never pairs and never
    types pairing codes.
  4. hermes android-pilot connect reads adb mdns services, keeps only the
    _adb-tls-connect._tcp service whose name contains the pinned ro.serialno and whose address is
    private, and runs adb connect IP:PORT. mDNS does not cross Tailscale, so there use
    hermes android-pilot connect --address 100.x.y.z:PORT (the port shown under Wireless debugging).
    A connected device that does not match the pin is disconnected at once.
  5. hermes android-pilot arm --minutes 10 as usual; the result shows "transport": "wireless".

Transport rules: only IPv4:PORT in 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 or Tailscale
100.64.0.0/10. Public, loopback (emulator), link-local, IPv6 and mDNS names are refused before any
command is sent. -s <serial> is resolved again on every call; with several devices only the one
matching the pin is used, USB is preferred over wireless, and two wireless addresses claiming the
same identity are both refused.

Never expose an ADB port to the internet (router port forwarding, public IPs, adb tcpip on
public Wi-Fi). Anyone who can reach a paired ADB port fully controls the device. Use a trusted
home network or Tailscale only, and turn Wireless debugging off when you are done. It also turns
itself off after a reboot; re-enable it and run connect again (the port changes).

Configuration

Settings live under plugins.entries.android-pilot.settings in config.yaml.

KeyDefaultMeaning
owner_telegram_id""Numeric Telegram user id allowed to drive the armed device from its private DM. Empty = Telegram disabled
allow_local_clitrueAllow the interactive local hermes chat (TTY, not a gateway)
max_ttl_minutes30Upper bound for arm --minutes (hard cap 60)
max_actions_per_arm120Gestures + screenshots per arm window (1–1000)
gestures_per_turn1Gestures per user message (1–3)
captures_per_turn2Screenshots per user message (0–3)
adb_path""Absolute path to a trusted adb/adb.exe. Empty = adb on PATH, then the Windows SDK path under /mnt/c
extra_denied_packages""Comma-separated extra package names (or substrings) treated as sensitive
allowed_packages""Optional strict allowlist; when set, only these packages and the launcher are usable
denied_brands""Comma-separated brands/manufacturers that can never be pinned or armed, e.g. samsung
allowed_brands""Optional brand allowlist (prefix match). Empty = any physical device
allow_wirelessfalseAllow the pinned device over private Wi-Fi/Tailscale ADB (see above)

State files

$HERMES_HOME/android-pilot/ (directory 0700, files 0600):

  • trusted.json: the pinned device (USB serial, fingerprint, wireless opt-in), HMAC-signed.
  • arm.json: arm expiry and action count, HMAC-signed; deleted on expiry, disarm, revoke or device
    mismatch.
  • audit.jsonl: action type and outcome. Typed text and images are never logged, only text length.
  • .hmac_key: the signing key.

No network calls other than ADB to the pinned device, no telemetry, no credentials stored.

Known limitations

  • Limited real-device testing. The test suite drives the real register() and handler with a
    fake ADB runner. Parsing of dumpsys window/power/input_method output was tested against sample
    text; some vendor ROMs may format it differently, which errs on the strict side (actions refused
    as "sensitive"). Wireless mode has only been tested with simulated ADB output.
  • Sensitive apps are matched by package name; an unexpected package name can slip through. Use
    allowed_packages for a strict mode.
  • On Windows adb.exe devices -l does not print usb:; USB is inferred from the serial format
    (network and emulator transports always use ip:port, mDNS or emulator-*, which are refused).
  • If Windows ADB lists only an mDNS name instead of IP:PORT, the device is refused; run
    hermes android-pilot connect to attach it as IP:PORT.
  • Gateway process detection uses the public gateway.status.get_running_pid(cleanup_stale=False)
    API without cleaning up status files. If the API cannot be imported or called, the local-CLI path
    is denied, not opened; a gateway without a bound sender is also denied.
  • Platforms: developed and tested on Linux (WSL2 with Windows adb.exe). macOS should work with
    Homebrew adb; native Windows is untested.

Development and tests

git clone https://github.com/Santrionlinecom/hermes-android-pilot
cd hermes-android-pilot
PYTHONPATH=/path/to/hermes-agent /path/to/hermes-agent/venv/bin/pytest -q -p no:cacheprovider
T=$(mktemp -d)   # throwaway HERMES_HOME
HERMES_HOME=$T hermes plugins validate .

The tests need a Hermes Agent checkout on PYTHONPATH (for gateway.session_context) and Pillow.
No phone is needed.

Ringkasan (Bahasa Indonesia)

Android Pilot mengendalikan layar satu HP Android fisik yang sudah Anda pin lewat USB (opsional lewat
Wi-Fi/Tailscale privat), satu langkah per pesan. Bawaannya tidak aktif: Anda sendiri yang
trust dan arm dari terminal laptop (perlu TTY dan kode 4 huruf), dengan batas waktu pendek.
Agen tidak bisa meng-arm dirinya sendiri. Telegram mati sampai owner_telegram_id diisi, dan hanya
DM pemilik yang diterima. Layar terkunci, aplikasi bank/pesan/pengaturan dan kolom password ditolak.
Tidak ada shell, intent, atau akses file.

License

MIT © 2026 Yogik Pratama Aprilian. See LICENSE.

README from the reviewed commit f30a3d8; it updates when the author re-pins.

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section