Skip to content
nav-pilotCopilot at Nav
  • Get started
  • nav-pilot
  • Customisation
  • Practice and rules
  • Insights
Sign in

Bygget med GitHub Copilot

Glossary (Norwegian)NorskPrivacy (Norwegian)Accessibility (Norwegian)GitHub
← cplt

cplt on Windows, through WSL2

cplt has no Windows sandbox. It enforces its rules with Apple Seatbelt on macOS and Landlock on Linux, so on Windows it runs inside WSL2, where it is an ordinary Linux install. The agent, your tools and your project all belong inside the Linux distribution, not on the Windows side.

1. In PowerShell, once

wsl --install    # WSL2 and Ubuntu, then reboot
wsl --update     # a current Microsoft kernel, for the full Landlock ABI

An install still on the 6.6 kernel gets an older Landlock ABI: file rules hold, but port rules do not, and network filtering falls back to cplt's proxy. wsl --updatefixes that. Don't set an lsm= list without landlock in .wslconfig; that turns off the enforcement cplt depends on.

2. Everything else inside the distribution

Open Ubuntu from Windows Terminal, or run wsl, and install the tools there.

Copilot CLI needs Node 22 or newer. On Ubuntu 26.04, apt has it:

sudo apt update && sudo apt install -y nodejs npm

Ubuntu 24.04 ships Node 18, which is too old. Install Node 22 with nvm instead, then go on:

# GitHub CLI, and log in
sudo apt install -y gh
gh auth login

# The agent, installed in the distro
npm install -g @github/copilot

Don't install Copilot CLI on Windows. WSL appends the Windows PATHto the distribution's, so a Windows install shows up as /mnt/c/Users/<you>/AppData/Roaming/npm/copilot, and it cannot run in the Linux sandbox. cplt names that cause when it finds one.

Then cplt, from the apt archive:

curl -fsSL -o /tmp/navikt-archive-keyring.gpg https://navikt.github.io/apt/keyring/navikt-archive-keyring.gpg \
  && test -s /tmp/navikt-archive-keyring.gpg \
  && sudo install -m 644 /tmp/navikt-archive-keyring.gpg /usr/share/keyrings/navikt-archive-keyring.gpg \
  && echo "deb [signed-by=/usr/share/keyrings/navikt-archive-keyring.gpg] https://navikt.github.io/apt stable main" \
    | sudo tee /etc/apt/sources.list.d/navikt.list >/dev/null \
  && sudo apt update && sudo apt install cplt \
  || echo "Could not install from the apt archive. Check that you can reach https://navikt.github.io/apt, or use the install script: curl -fsSL https://raw.githubusercontent.com/navikt/cplt/main/install.sh | bash" >&2

3. Keep the project in the Linux filesystem

mkdir -p ~/src && cd ~/src
git clone https://github.com/<org>/<repo>.git
cd <repo> && cplt

Work in ~/src, not under /mnt/c. Files on the Windows side are much slower from WSL, and nobody has yet confirmed how Landlock enforces its rules there.

4. Check the result

cplt doctor

It prints the kernel version and the Landlock ABI it found, and fails if your agent comes from the Windows side.

Known limit: tools that open their own terminal

Inside cplt, pexpect, pty.spawn(), node-pty, script and tmux fail, with errors such as forkpty(3) failed. The sandbox blocks the numbered terminal devices, because most of them belong to your other windows. Your own session, pagers and colours keep working.

Run such a command outside cplt. If it has to run inside, grant the devices back for that one session:

cplt --allow-write /dev -- -p "run the pexpect suite"

For that session a compromised agent can also write to and read from your other terminal windows, so don't put the grant in config.toml. Details: terminal devices in known impacts.

Getting help

Send the output of cplt doctor --verbose and the exact command that failed. The WSL2 route is not yet verified end to end on a real install, so tell us what happened in navikt/cplt#189, whether it worked or not. The full version of this guide is the WSL2 section of the cplt README.