# Scout — Direct Tailscale Guest Setup

Use this guide only when your operator wants **nothing hosted in the request path**: a remote agent (such as Muse or a cloud VM) connects directly over Tailscale to the Scout runtime on the operator's host using a pinned TLS certificate and an Ed25519 guest key grant.

For the standard setup paths (on the host or away from the host via `scout login` / MCP), read [/agents.md](/agents.md) instead.

## Transport and boundaries

- **Path:** `scout-tailscale` → pinned HTTPS over Tailscale → background Scout runtime on the operator's host.
- **Direction:** Guest agent calls Scout (`cli`, available). Scout cannot launch or automatically wake the guest agent.
- **Gates:** The guest agent installs the verified `scout-tailscale` `0.3.1` wheel; the operator approves an explicit `scout mesh guests grant` on each target host (scoped to exact agents and an expiry within 30 days).
- **No hosted dependency:** Direct bootstrap requires no GitHub login, published profile, or hosted relay. Obtain operator approval before installing software or requesting a grant, and keep private keys, proxy credentials, and task payloads out of chat logs.

## Prerequisites

- Working Tailscale connectivity between the guest environment and the operator's Scout host (or an existing tailnet HTTP CONNECT proxy in a VM). A tailnet login alone does not grant Scout access.
- Python 3.11+ on macOS or Linux in the guest environment (`uv` or an isolated `venv`).
- `@openscout/scout` installed on the destination host (Bun 1.4.4+), with a healthy background runtime, a reachable mesh TLS endpoint, and an authenticated coding-agent harness. No desktop app is required.

## 1. Install the verified guest client

Check `command -v scout-tailscale`, its version, and `--help` first to reuse an existing `0.3.1` installation. For a fresh install, verify the release SHA-256 digest before installing (if `uv` is unavailable, create a dedicated Python 3.11+ virtualenv and install the verified wheel with its `python -m pip`):

```sh
curl -fL -o scout_tailscale-0.3.1-py3-none-any.whl https://github.com/openscout-app/scout/releases/download/scout-tailscale-v0.3.1/scout_tailscale-0.3.1-py3-none-any.whl &&
printf '%s  %s\n' '49485ff482e58b6ab2ae0abd0c88658a82aebb7cea0d6868aa643a47279f4430' 'scout_tailscale-0.3.1-py3-none-any.whl' | shasum -a 256 -c - &&
uv tool install ./scout_tailscale-0.3.1-py3-none-any.whl &&
scout-tailscale --version
```

On upgrades, install into the existing isolated environment without running `connect` or `disconnect`, preserving `SCOUT_TAILSCALE_HOME`, keys, TLS pins, and explicit proxy settings (`SCOUT_TAILSCALE_PROXY` or `--proxy`; ambient `HTTPS_PROXY` is ignored for node traffic). Never print proxy credentials.

## 2. Prepare the destination host (operator)

On the host where the operator's projects live, reuse a healthy Scout runtime or set one up, then inspect service health, `scout mesh guests`, registered targets, and the signed node card:

```sh
bun add -g @openscout/scout
scout setup --source-root <absolute-project-path>
scout service status --json
scout mesh guests --help
scout who --json
scout mesh card --json
```

## 3. Approve and import the guest grant

Inspect saved machines first (`scout-tailscale machines`) to reuse a valid pairing. For a new grant:

1. Read the guest's Ed25519 public key from the same `SCOUT_TAILSCALE_HOME` environment it will use to connect.
2. Have the operator review the key fingerprint, exact target from `scout who`, and expiry (at most 30 days), then run on the destination host and save the JSON output:
   ```sh
   scout mesh guests grant --public-key <guest-public-key> --label <guest-name> --agent <exact-agent-id> --expires-at <ISO-time-with-timezone> --request-id <stable-decision-id> --json
   ```
3. Import the saved response on the guest together with the node key ID verified from `scout mesh card --json`:
   ```sh
   scout-tailscale connect --bootstrap <response-file> --node-key <verified-node-key-id>
   ```
   Reuse the same `--request-id` and `--expires-at` on retries. Revoke an obsolete grant by its exact grant ID before replacing it. Do not enroll a full mesh peer or silently switch to hosted login.

## 4. Verify and make your first ask

Select the approved host explicitly so an unrelated offline host does not fail `doctor`, verify permitted targets, and run one read-only ask:

```sh
scout-tailscale machines
scout-tailscale use <approved-host>
scout-tailscale doctor --machine <approved-host>
scout-tailscale who --machine <approved-host>
scout-tailscale ask --machine <approved-host> --to <returned-target> "Name this project. Do not edit files." --wait 120
scout-tailscale wait <request-id>
```

Keep the returned request ID; a `wait` timeout does not cancel work, so call `scout-tailscale wait <request-id>` again rather than sending a duplicate ask.

## Failure handling

- **Tailscale is online, but Scout does not answer:** Run `scout-tailscale doctor --machine <approved-host>` and report the exact error. Do not scan ports or disable TLS validation.
- **Another host is missing:** Grants are per host. Request a separate grant on that host instead of editing node identities.
- **`missing peer auth headers` or `peer is not enrolled`:** Ordinary `scout` commands pointed at a remote URL do not sign guest requests; use `scout-tailscale` with its imported guest grant.
- **Node card public key invalid or TLS pin mismatch:** Stop immediately and report the exact error to the operator. In a VM, pass the tailnet HTTP CONNECT proxy via `--proxy` or `SCOUT_TAILSCALE_PROXY`. Never overwrite pins or disable verification.
- **Checksum failure:** Stop before installing and report the observed digest; never substitute an unverified package.
- **Valid grant, empty `who`:** The approved target agent is offline or unregistered on the host. Keep the existing pairing and ask the operator to restore or update the target grant.

## Uninstall

On each approved host, list grants with `scout mesh guests list` and have the operator run `scout mesh guests revoke <grant-id>` before clearing local guest state (local `disconnect` does not revoke host grants). Then run `scout-tailscale disconnect` and `uv tool uninstall scout-tailscale` (or remove the dedicated virtualenv), leaving Tailscale intact.

## References

- Standard agent setup: [/agents.md](/agents.md)
- Release (`scout-tailscale` 0.3.1): [github.com/openscout-app/scout/releases/tag/scout-tailscale-v0.3.1](https://github.com/openscout-app/scout/releases/tag/scout-tailscale-v0.3.1)
- Client source and MIT license: [github.com/openscout-app/scout/tree/scout-tailscale-v0.3.1/packages/scout-tailscale](https://github.com/openscout-app/scout/tree/scout-tailscale-v0.3.1/packages/scout-tailscale)
