> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.pensar.dev/console/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pensar.dev/console/_mcp/server.

# Self-hosted runners

> Run supported recon and web pentests from a Linux VM in your network

Self-hosted runners execute Apex and its security tools on a VM you control.
Use a runner when authorized targets are reachable from your network and you
want testing to originate there. Pensar continues to provide inference,
findings, progress and billing.

> **Note**
>
> Self-hosted runners are in preview. If setup is unavailable in **Settings** →
> **Runners**, contact Pensar support to confirm availability for your workspace.

## How the connection works

You install a signed runner package and register the VM with one workspace.
The runner connects outbound to Pensar to pick up jobs, request inference and
send results. Each runner executes one job at a time.

**No inbound service port is required.** You do not need to expose a shell or
tool server to Pensar. The runner reaches your authorized targets using the
VM's own network routes and DNS. You control which targets that VM can reach.

## What stays local and what leaves your network

The agent, tools, browser and working files run on the VM. Self-hosting does
not keep all assessment data inside your network:

| Data                                         | Where it goes                                        |
| -------------------------------------------- | ---------------------------------------------------- |
| Prompts and tool content used by the model   | Through Pensar to the model provider                 |
| Progress, findings and execution output      | To Pensar for display and storage                    |
| Screenshots and completed pentest recordings | Uploaded to Pensar when produced                     |
| Live desktop preview                         | Through Pensar's relay to authorized Console viewers |

Connected source and cloud integrations can also prepare assessment inputs
through Pensar. Before testing sensitive environments, review which data may
leave your network and your processing and retention requirements with Pensar.
This preview requires connectivity to Pensar; it does not support air-gapped
operation or local-only inference.

You do not need Pensar AWS credentials, database credentials or model-provider
API keys on the VM. Credentials you provide for testing can still be used by
the agent there.

## Before you install

* Use a dedicated **Ubuntu 24.04 or Kali Linux x86_64 VM** for one workspace.
  Start with **4 vCPU, 16 GiB RAM and 40 GiB disk**. ARM and other distributions
  are not supported by the installer.
* Have permission to manage workspace settings and administrator access to
  install packages and a system service on the VM.
* Give the VM network access and DNS resolution for your authorized targets.
* Allow outbound HTTPS to the Console installer, the API and gateway origins
  in your workspace's setup command, and the distribution's package repositories.
  Allow secure WebSocket connections to the gateway for live desktop previews.
  Production uses `api.pensar.dev` for API and signed release/artifact transfers,
  and `gateway.pensar.dev` for inference and live desktop connections. Allow HTTPS
  POST to both origins and GET, PUT and DELETE for release/artifact transfers.
  Test environments may additionally use signed S3 URLs. Use the origins shown
  in your workspace setup when reviewing your allowlist.

The VM persists between jobs. A service account and separate working directories
do not provide isolation against malicious code running on that VM. Keep
unrelated workloads, cloud roles and secrets off the host, limit its network
access, and include it in your OS patching and monitoring process.

## Install and connect

1. Open **Settings** → **Runners** → **Add runner**. Copy the installation
   command from Console and run it on your VM. No source checkout or separate
   Bun or Node installation is needed.
2. Wait for the installer to prepare dependencies. When it prompts for a token,
   choose **Generate registration token** in Console and paste it into the
   terminal's hidden prompt. The token works once and expires after ten minutes.
3. The installer verifies the release, creates the `pensar-runner` service user,
   and checks browser readiness and outbound connectivity before starting the
   service. Refresh Console and confirm the runner is online.
4. Enable **Use self-hosted runners**, then launch supported recon or a web
   pentest as usual.

Automatic updates are off by default. To opt in during installation, append
`--auto-updates` to the installer's `sudo bash` command from Console. This
requires an available runner release that supports automatic updates. You can
also enable them after installation as described below.

To check the VM:

```bash
sudo -u pensar-runner pensar-runner doctor
sudo -u pensar-runner pensar-runner check-connectivity
pensar-runner status
pensar-runner logs
```

The connectivity check tests the API, inference gateway access, desktop
connection readiness and a small artifact upload/delete. It does not run model
inference or verify that your targets are reachable. Check target routes and
DNS separately.

If installation registers the VM but fails a connectivity check, the service
stays stopped. Fix outbound access, download the current installer from Console,
and run it with `--upgrade` to preserve the registration.

## Supported work and routing

The preview supports domain-based recon, System recon, and web Blackbox
pentests. Repository/commit-backed CI pentests, mobile/device pentests and other
unsupported jobs continue to use Pensar-hosted execution. Standalone source
recon is not included. Enabling runners does not move all workspace processing
into your network.

Self-hosted execution supports Pensar-managed and IMAP inboxes. If your
workspace uses a Gmail or Outlook OAuth inbox, switch its inbox provider before
enabling self-hosted runners.

Supported jobs wait for an available runner in the workspace. **They do not
fall back to Pensar-hosted execution.** If a runner loses its connection during
a job, the run can fail; this preview does not automatically resume interrupted
agent execution. Review partial test activity before launching another run.

Changing **Use self-hosted runners** affects new jobs. Jobs already queued or
assigned keep their selected execution environment.

## Updates

### Automatic updates (opt-in)

Enable automatic updates if you want the runner to install future signed
releases while idle. Leave them off if your team needs to approve each release
before installation.

> **Note**
>
> VMs installed before automatic update support was added need one
> [manual upgrade](#manual-upgrade) using a fresh installer from Console. A release
> with automatic update support must be available; a saved older installer does
> not provision it. If your VM already has this support, enable updates directly
> with the settings command below.

On a VM provisioned for automatic updates, enable them with:

```bash
sudo pensar-runner settings auto-updates on
```

To opt in and start the runner service in one command:

```bash
sudo pensar-runner run --auto-updates
```

If the service is already running, that command leaves it running. To check
your saved preference or turn automatic updates off:

```bash
pensar-runner settings auto-updates
sudo pensar-runner settings auto-updates off
```

Opted-in runners check roughly five minutes after boot and hourly afterward;
system scheduling can delay checks. Updates activate only while the runner is
idle; busy or stopped runners defer them. An unchanged release does not restart
the service.

The updater verifies the signed release before activation, preserves your
registration, and runs browser readiness and connectivity checks. If activation
fails, it restores the previous release and attempts to restart it. Successful
automatic updates keep the current and previous releases and remove older
release directories.

Automatic updates do not install OS packages. Use a manual upgrade when a
release needs new system dependencies, and continue managing OS patches yourself.
Turning updates off stops future checks; an activation already in progress may
finish. To inspect update logs:

```bash
sudo journalctl -u pensar-runner-update.service
```

### Manual upgrade

Wait until the runner's current job finishes, then stop it:

```bash
sudo systemctl stop pensar-runner
```

Download a fresh copy of the installer using the download command in
**Settings** → **Runners**. Upgrade using that copy:

```bash
sudo bash install-pensar-runner.sh --upgrade
```

The upgrade preserves the runner's registration and uses its saved credential;
you do not need a new registration token. Readiness and connectivity checks
run before the service starts. It also preserves your automatic-update preference
when neither update flag is supplied. Add `--auto-updates` to opt in during the
upgrade, or `--no-auto-updates` to opt out:

```bash
sudo bash install-pensar-runner.sh --upgrade --auto-updates
```

## Remove a runner

To retire a stopped runner, use the fresh installer:

```bash
sudo bash install-pensar-runner.sh --uninstall
```

Uninstall revokes the runner and removes its service, release and credential.
The service user and job-data directory remain for you to clean up deliberately.
You can also revoke a runner in **Settings** → **Runners**. If the VM is
compromised, revoke it and isolate or destroy it through your own infrastructure
controls; revocation cannot erase data already copied from the host.