Module 9 · RemoteVerified 2 Nov 2026
Dev Tunnels & GitHub Environments
Keep an agent working on your machine and steer it from anywhere, or give the cloud coding agent the setup it needs.
Connection chooser
Pick your goal
Pick the situation closest to yours.
| GitHub Environments (VS Code) | Repository environment “copilot” | |
|---|---|---|
| What | Remote connection to a registered machine | Secrets and variables for the coding agent |
| Where | Remote Connections in VS Code | Repo → Settings → Environments |
| Status | Preview | Part of the coding agent |
Security first
Never combine an unauthenticated tunnel with auto-approved tools. Connected clients get trusted access to your machine, and traffic is not end-to-end encrypted.
Install the CLI and sign in
bashcode tunnel --accept-server-license-termsSign in with the same GitHub account when prompted. Leave it running.
Name the tunnel
bashcode tunnel --name my-dev-boxPick a name you will recognise from the remote client.
Keep it as a service
bashcode tunnel service installStarts at login so the tunnel survives a reboot.
Confirm access control
bashcode tunnel statusTunnels should require authentication. Never expose an anonymous tunnel together with Allow all.
.github/workflows/copilot-setup-steps.yml
name: "Copilot Setup Steps"
on: workflow_dispatch
jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci| Symptom | Check |
|---|---|
| Tunnel does not appear in the client | Is it running, and is it the same GitHub account on both sides? |
| Connection drops overnight | The host must stay awake. Check sleep settings or use a cloud session. |
| Agent cannot reach a private service | Network rules on the host apply. Check sandbox network settings. |
| Coding agent cannot install dependencies | Check the copilot-setup-steps job runs on its own, and that required secrets live in the copilot environment. |