Skip to main content
Tunnel 1 is how your own machines and API agents talk to the phone: directly, over your tailnet, with nothing exposed to the public internet.

One address only

The bridge listens on one address only — the phone’s Tailscale address, port 8765. It does not listen on your Wi-Fi LAN address, and it does not listen on any public interface. If the Tailscale VPN is down, the bridge is not reachable at all; that is a security property, not a bug. Tailscale’s WireGuard encryption protects the traffic, and a named token is the second factor on top of it. Anything that can make an HTTP request can use Tunnel 1: a tool-calling agent, an MCP client, a script, or you with curl from another machine on the tailnet.

Step 1 — Be on the tailnet

The calling machine must be signed into the same Tailscale account (the same tailnet) as the phone, with Tailscale running. That is the whole network requirement: no port forwarding, no router changes, no public address for the phone. From the calling machine you should be able to reach the phone’s Tailscale address — the app’s Status screen shows it in the bridge status table, in the Tunnel 1 row. The address looks like 100.x.y.z (Tailscale’s address range). You can also use the phone’s MagicDNS name if your tailnet has MagicDNS enabled. The examples on this page use <phone-tailnet-ip> as a placeholder — substitute the address from your app.

Step 2 — Create a token

Every caller gets its own named token — one for your laptop script, one for each agent. That way the Activity screen can show who did what, and revoking one caller never locks out the others.
  1. Open Tokens in the app.
  2. On the Tunnel 1 — Private card, name the token and create it. Names are 3–64 characters: lowercase letters, numbers, dashes, and underscores (for example my-laptop or agent-1).
  3. The app shows the token’s connect block — once. Copy or share it now; the value is never displayed again. If you lose it, create a new token (or rotate) and revoke the lost one.
The first token is special: on a fresh install the app generates one automatically during Get Connected, and holds it for you until you tap “Done — I’ve shared it.” After that, the same shown-once rule applies. Tokens are stored on the phone encrypted (AES-256-GCM, with the key in the Android Keystore), are compared in constant time, and never appear in the app’s logs. On a purchased copy, tokens persist across restarts; on a free copy they are session-only — see the pricing summary. You can rename a token or move it between tunnels later from the same screen, without changing its value; see Security for the full token lifecycle, including rotation grace and the revoke undo window.

Step 3 — The connect block, field by field

The connect block is the entire integration in one paste. It looks like this (placeholder values):
Give the block to your agent as-is, or use the fields yourself from a script. On purchased copies, the reveal sheet and Get Connected offer a Share button that sends the whole block through the Android share sheet — email it to the computer where your AI runs. Sharing exists only where the block is already visible: a stored token’s value can never be re-displayed, so it can never be re-shared later.

Step 4 — A worked example

1. Liveness — no token needed

An empty reply or a refused connection means nothing is listening — the bridge is stopped or Tailscale is down. That is deliberately different from an authentication failure, which always answers.

2. Full health — with your token

With a valid token, /health returns the full self-diagnosis: the same three lists the Status screen shows (permissions_missing, software_missing, state_missing), a ready flag, and a summary of Tunnel 2’s state. Each item says whether the agent can resolve it or only you can, with the instruction for you when it’s yours. Check this before your first real command, and whenever something fails.

3. Status

Status shows names only — token names and host names, never values or keys.

4. Run a command

The command runs on the phone, inside the app’s sandbox. The response carries the output, the exit code, a run id, how long it took, and whether the output was truncated. Up to 4 commands may run at once on Tunnel 1; there is no per-minute call cap on this tunnel. An optional timeout (seconds) bounds a single command. The host field will run the command on a configured SSH host instead — that capability arrives with the jump-host phase (see the note below).

5. The event log

GET /log returns the app’s event log as plain text — app starts, diagnosis runs, permission answers, token operations (names only), updater events, errors with stack traces. ?tail=N fetches the last N entries; ?session=current fetches everything since the user last tapped “Start test session” in the Log screen — the slice to ask for first when something misbehaved. The log exists on Tunnel 1 only: there is no log endpoint on the public tunnel, by design. (Roadmap) SSH jump hosts. A later phase adds the Hosts screen (name, address, user, key — keys generated in-app or imported) and lets /run execute on those machines through the phone, with /status listing host names. Until then, /health reports “no hosts configured” as an informational state item, and a command sent with a host completes with a clear refusal rather than running anywhere.

Errors on Tunnel 1

The full endpoint-by-endpoint reference — request and response shapes, every error — is in the API Reference. If you are handing this tunnel to an AI, the For Agents page is the etiquette that goes with it.
Source: Leverine/Leverine-BunnyBridge@902c77c — docs/site/BunnyBridge/door1.html.