Documentation/Workspaces/AI workspace Site reachability

AI workspace Site reachability

Give your AI workspace private overlay access to another Site so the agent can SSH and reach app ports. This is Site-to-Site reachability for the AI VM — not person Site access and not Connect Device.

  • AI workspace
  • Overlay SSH
  • Non-root bstrapr-ai
  • About 10 minutes

1What this is for

An AI workspace runs OpenHands on a dedicated cloud VM that joins your organization as its own Site. When the agent needs to work against another environment — for example a production or staging Site already enrolled in Bstrapr — you grant that Site to the AI workspace. Bstrapr opens the overlay ACL and issues an SSH identity the agent uses as a non-root user.

  • Agent can reach the target Site’s VPN address (for example 100.64.x.x) on granted ports, including SSH :22.
  • SSH uses a dedicated user named bstrapr-ai on the target Site — not root.
  • Person Team / Site access for humans stays separate. Granting a person does not grant the AI workspace, and vice versa.

2What this is not

Do not enroll the AI droplet as a person device on the target Site via Connect Device. That flow is for laptops and site servers joining the mesh, not for AI Site-to-Site grants.

  • Wrong: Devices → Connect Device → treat the AI VM as a laptop on the GCP/cloud Site.
  • Wrong: Opening public GCP firewall rules for SSH so the agent can dial the public IP.
  • Right: AI workspace manage page → Site reachability → Grant access, then Install on site once.

3Before you begin

  • An AI workspace that is deployed and running (Workspaces → Manage AI workspace → Deploy OpenHands finished).
  • A target Site already connected and Online on the VPN (Sites / Devices).
  • Operator or admin role so you can open the AI workspace manage page.
  • Root or sudo on the target Site once, to run the bootstrap script.
  • LLM configuration saved if you want the agent to act after SSH works.

4Step 1 — Open Site reachability

In the dashboard, open Workspaces → Manage AI workspace (or /dashboard/workspace/ai?workspace=ID). In the side panels, find Site reachability under LLM configuration and Git integration.

  • Confirm the workspace shows Running.
  • Note the AI Site name in the header (the AI droplet’s own Site).
  • You will grant a different Site — never the AI Site to itself.

5Step 2 — Grant access

Under Site reachability, choose the target Site and click Grant access. Bstrapr records the grant, opens overlay ACL from the AI Site tag to that Site’s ports (including 22 by default), mints or reuses the AI workspace SSH keypair, and tries to sync the private key into the agent container.

  • Ports default from the Site’s allowed ports plus common app ports and SSH 22.
  • If the AI VM is already up, use Sync SSH to agent after granting so ~/.ssh inside OpenHands has the key and Host entries.
  • Revoke removes the grant and rewrites outbound ACL for that AI Site.

6Step 3 — Install on the target Site (once)

On the granted Site row, click Install on site. Copy the bootstrap script and run it as root on that server (sudo -i). The script creates user bstrapr-ai (if missing) and appends the AI workspace public key to /home/bstrapr-ai/.ssh/authorized_keys.

  • Run once per Site (or again if you rotate the AI workspace key).
  • PubkeyAuthentication should be enabled (Ubuntu OpenSSH default if the setting is not listed in sshd_config).
  • Optional: add bstrapr-ai to sudo with NOPASSWD only if the agent must run privileged commands.
  • Confirm with: sudo sshd -T | grep -E '^(pubkeyauthentication|authorizedkeysfile) ' and ls -la /home/bstrapr-ai/.ssh/

7Step 4 — Use SSH from the agent

Open AI workspace (Agent Canvas). From a conversation or bash tool, connect with the Site VPN IP shown on the grant row.

  • ssh bstrapr-ai@<site-vpn-ip>
  • Or a Host alias from the agent SSH config after Sync SSH to agent (site name / VPN IP).
  • App HTTP on ports such as 3000 works over the overlay when those ports are granted — that is not a substitute for shell.
  • If the agent says it only has port 3000 and no shell, confirm openssh-client is present, the private key is synced, and the bootstrap user exists on the Site.

8What Bstrapr configures for you

  • Overlay ACL: AI Site tag → target Site tag on granted ports (tag:site-* only — never bare usernames as Hosts).
  • Ed25519 keypair stored encrypted with the AI workspace secrets; public key shown on Site reachability.
  • Private key and SSH config installed into the OpenHands container (on grant/sync and on new droplet cloud-init).
  • openssh-client installed in the agent container on boot and re-checked by the AI VM watch timer.
  • Docker → Tailscale NAT on the AI droplet so container traffic can reach 100.64.0.0/10.

9Deploy an AI app to a new cloud Site

When an app should run on its own Site — not forever on the builder VM — use AI Operations → Provision a Site (app Overview links Provision Site). Full Apps hub / Tools / Overview / Operations guide: /docs/ai-workspace-apps.

  • App Overview → Provision Site → AI Operations: DigitalOcean config, Site name, Git branch, Git version. Or open AI Operations with the app selected.
  • Bstrapr creates a DO droplet with Docker + Tailscale, registers a Site, bakes user bstrapr-ai and this AI workspace’s public key (no manual Install on site), auto-grants Site reachability, runs the first deploy, and stores a root console password on the app (Reveal on Overview for new Sites).
  • App URL becomes https://app-<id>-<hex>.sites.bstrapr.com/ when Ready (HTTPS gateway → overlay → Site). Build preview stays on *.ide.bstrapr.com/{port}/.
  • Later: AI Operations → Redeploy or Check health. After Fix → Review → Tests → Approve & merge, Redeploy to Site pushes production.
  • Do not use Connect Device for the AI builder VM on that runtime Site.

10Troubleshooting

  • Permission denied (publickey) → bootstrap was not run, wrong user (use bstrapr-ai), or Sync SSH to agent not done after recreate.
  • No matching peer / timeout to 100.64.x.x → Site Offline, grant missing, or control-plane ACL not applied; re-Grant access and confirm both Sites show Online.
  • ssh: not found in the agent → Sync SSH to agent or wait for the watch timer; new deploys install openssh-client automatically.
  • Connects to :3000 but not shell → overlay HTTP works; finish key install on both sides for SSH.
  • Do not paste Tailscale/Headscale ACL JSON into the Site — use Site reachability in the dashboard.

11Security notes

The AI workspace private key can reach every Site you grant. Prefer least privilege: grant only Sites the agent needs, revoke when the engagement ends, and avoid NOPASSWD sudo on bstrapr-ai unless required. Public inbound SSH on the AI droplet stays closed; recovery uses the cloud provider console.

Exact Site names, VPN IPs, and the bootstrap script are always generated in your signed-in dashboard for the AI workspace you selected.

Open AI workspace