---
updatedAt: 2026-11-08T14:17:53.000Z
agentTools:
  projectIndex: https://docs.superwise.ai/llms.txt
---

# Install on macOS and Linux (CLI)

How to install the Sentinel CLI with pip, route your AI traffic through a gateway, and test a prompt

The **Sentinel CLI** installs SUPERWISE® Sentinel, the AI gateway, from the terminal on macOS and Linux: `pip install superwise-sentinel-cli`, then `sentinel quickstart` to deploy a local gateway or connect to your team's. The CLI then points your AI tools at that gateway, so each prompt is checked before it reaches the model provider. It also runs on Windows, though most Windows users want the [Sentinel for Windows](https://docs.superwise.ai/docs/sentinel-for-windows) app.

## What do I need?

* A **SUPERWISE account**. [Sign up](https://authentication.superwise.ai/oauth/account/sign-up) if you don't have one yet.
* **Python 3.11 or later** and `pip`.
* **Docker Desktop**, only if you deploy a local Sentinel (Option A below).

<Callout icon="💡" theme="info">
  Don't have pip? Bootstrap it with `python -m ensurepip --upgrade`. Where `python` and `pip` aren't found, use `python3` and `pip3`, for example `python3 -m ensurepip --upgrade` and `pip3 install superwise-sentinel-cli`.
</Callout>

## Install the CLI

Install the latest release from PyPI:

```bash
pip install superwise-sentinel-cli
```

Check the installed version:

```bash
sentinel --version
```

## Route your AI traffic through a gateway

Your apps reach the model through a **Sentinel gateway**. There are two ways to get one:

* **Option A: deploy a local Sentinel** (needs Docker). Run your own Sentinel on this machine. Best for experimentation, a dedicated personal Sentinel, or an admin bootstrapping a new Sentinel for the organization.
* **Option B: connect to an existing Sentinel** (no Docker). Point this machine at a Sentinel your team already deployed. **This is what most users want.**

<HTMLBlock>{`
<div style="display:flex; flex-direction:column; gap:16px; margin:12px 0; font-size:13px; color:#1c1e26;">

  <div style="border:1px solid rgba(0,0,0,.1); border-radius:10px; padding:14px 16px; background:#f9fafb;">
    <div style="font-weight:600; margin-bottom:12px;">Option A: deploy a local Sentinel <span style="font-weight:400; color:#6b7280;">· needs Docker</span></div>
    <div style="display:flex; align-items:center; gap:10px; flex-wrap:wrap;">
      <div style="border:1.5px dashed #296CEF; border-radius:10px; padding:10px 12px; background:#f5f8ff;">
        <div style="font-size:11px; font-weight:700; color:#296CEF; text-transform:uppercase; letter-spacing:.04em; white-space:nowrap; margin-bottom:8px;">Your machine</div>
        <div style="display:flex; align-items:center; gap:10px;">
          <span style="border:1px solid #d1d5db; border-radius:6px; padding:6px 10px; background:#fff;">Your app</span>
          <span style="color:#9ca3af;">&rarr;</span>
          <span style="border:1px solid #296CEF; border-radius:6px; padding:6px 10px; background:#fff; color:#296CEF; font-weight:600;">Sentinel</span>
        </div>
      </div>
      <span style="color:#9ca3af;">&rarr;</span>
      <span style="border:1px solid #d1d5db; border-radius:6px; padding:6px 10px; background:#fff;">LLM provider</span>
    </div>
  </div>

  <div style="border:1px solid rgba(0,0,0,.1); border-radius:10px; padding:14px 16px; background:#f9fafb;">
    <div style="font-weight:600; margin-bottom:12px;">Option B: connect to an existing Sentinel <span style="font-weight:400; color:#6b7280;">· no Docker</span></div>
    <div style="display:flex; align-items:center; gap:10px; flex-wrap:wrap;">
      <div style="border:1.5px dashed #9aa4b2; border-radius:10px; padding:10px 12px; background:#ffffff;">
        <div style="font-size:11px; font-weight:700; color:#6b7280; text-transform:uppercase; letter-spacing:.04em; white-space:nowrap; margin-bottom:8px;">Your machine</div>
        <span style="border:1px solid #d1d5db; border-radius:6px; padding:6px 10px; background:#fff;">Your app</span>
      </div>
      <span style="color:#9ca3af;">&rarr;</span>
      <div style="border:1.5px dashed #7c3aed; border-radius:10px; padding:10px 12px; background:#faf7ff;">
        <div style="font-size:11px; font-weight:700; color:#7c3aed; text-transform:uppercase; letter-spacing:.04em; white-space:nowrap; margin-bottom:8px;">Your company network</div>
        <span style="border:1px solid #7c3aed; border-radius:6px; padding:6px 10px; background:#fff; color:#7c3aed; font-weight:600;">Sentinel</span>
      </div>
      <span style="color:#9ca3af;">&rarr;</span>
      <span style="border:1px solid #d1d5db; border-radius:6px; padding:6px 10px; background:#fff;">LLM provider</span>
    </div>
  </div>

</div>
`}</HTMLBlock>

### Option A: deploy a local Sentinel

This is the only path that needs Docker.

<Callout icon="📘" theme="info">
  Install **Docker Desktop** first if you don't have it. [Download it from docker.com](https://www.docker.com/products/docker-desktop).
</Callout>

```bash
sentinel quickstart
```

The CLI walks you through setup:

1. At **How would you like to set up Sentinel?**, choose **Local Gateway** — it's the default, so you can press Enter.

2. If you're not signed in yet, the CLI opens your browser to authenticate with SUPERWISE; approve the login to continue. For machine credentials, run `sentinel auth --client-credentials` first and paste a **Client ID** and **Client Secret** (see [Generate tokens](https://docs.superwise.ai/docs/generate-tokens)). Creating a new Sentinel requires an [Admin](https://docs.superwise.ai/docs/manage-users) role.

3. The CLI launches the local Docker container and, once it's up, shows the gateway's details: the port, how to test it, and a link to your new Sentinel in the SUPERWISE app. That page shows its status, heartbeat, and guardrails. In the example below, the Sentinel is **Active** and runs Secrets, PII, and Rudeness, each set to **Remediate** on input.

   ![SUPERWISE app: a Sentinel named Demo shown as Active, with its Secrets, PII and Rudeness guardrails set to Remediate on input](https://files.readme.io/85c237280023b4847eb5aa6a67441a25cd1d8a4a881b9e8f1a8ef3d8583de762-image.png)

4. Choose which **providers** to intercept — press Enter for all of them.

5. Choose which local **apps** to auto-configure, such as Codex or Claude Desktop, or skip to manage them yourself.

6. The CLI enables the proxy and applies the settings to your machine. New sessions route traffic through this gateway by default.

### Option B: connect to an existing Sentinel

Use this when your team or IT has already deployed a Sentinel, for example in your company's shared network or VPC. No Docker required.

```bash
sentinel quickstart
```

The CLI walks you through setup:

1. At **How would you like to set up Sentinel?**, choose **Connect to Existing Gateway**.
2. Enter the Sentinel gateway's full URL.
3. Choose which **providers** to intercept — press Enter for all of them.
4. Choose which local **apps** to auto-configure, such as Codex or Claude Desktop, or skip to manage them yourself.
5. The CLI enables the proxy and applies the settings to your machine. New sessions route traffic through this gateway by default.

<Callout icon="🛟" theme="info">
  **Stuck, or seeing unexpected behavior?** Run `sentinel proxy off` at any time to turn interception off and restore direct routing to the provider. Fix the issue, then run `sentinel proxy on` to re-enable it.
</Callout>

## Try it

See what your gateway does to a prompt. No provider key is required, and nothing is recorded in telemetry:

```bash
sentinel test --text "My email is john.doe@example.com and my key is sk-proj-abc123"
```

Sentinel runs the prompt through your guardrails and prints whether it passed, was redacted, or was blocked, along with the redacted text. It never calls the model.

<Callout icon="⚠️" theme="warn">
  `sentinel proxy on` (the final step of `quickstart`) applies to **new** shell sessions. Open a fresh terminal so your apps route through Sentinel.
</Callout>

Then open the SUPERWISE app to see your interaction log graphs, validation metrics, and guardrail latency tables update live.

## Manage the local gateway

With Option A, the CLI runs the gateway as a local Docker container. Start, stop, and update it with:

```bash
sentinel gateway start
sentinel gateway stop
sentinel gateway update
```

* **Upgrade to a new version:** `sentinel gateway update` pulls the latest gateway image, then `sentinel gateway start --force` restarts the gateway on it. Check the running version anytime with `sentinel gateway status`. New guardrails and optimizations ship in the image, so upgrade when a release adds features — see [Keep your Sentinel up to date](https://docs.superwise.ai/docs/deploy-a-gateway#keep-your-sentinel-up-to-date).
* **Use a specific Sentinel:** pass `--sentinel-id` to `sentinel gateway start` (or to a clean `quickstart`) to run the gateway as an existing Sentinel and fetch its configuration. If the ID doesn't exist, the CLI tells you before starting the container.
* **See the full policy:** run `sentinel gateway status --details` to print the Sentinel's guardrails and token-optimization config alongside its health and version.
* **You need an Admin role:** creating or connecting a gateway edits your SUPERWISE account, so it requires an [Admin](https://docs.superwise.ai/docs/manage-users) user. A read-only user is told an Admin role is required instead of failing with an unclear error.
* **Resume a previous setup:** the CLI reads its local state file. If it finds a previously configured gateway, it offers to resume that container configuration instead of creating a new Sentinel.
* **Allow long requests:** pass `--timeout <seconds>` to change how long the gateway waits for the upstream model. The default is `1800`, enough for long-running or agentic requests.
* **Where state lives:** the CLI keeps its state, provider settings, and gateway parameters in `~/.config/sentinel/config.json` (`%APPDATA%\sentinel\config.json` on Windows).

`sentinel gateway stop` stops and removes the local container; the Sentinel's configuration stays in the SUPERWISE app. To stop routing your tools through the gateway without stopping it, run `sentinel proxy off`. For every command, see the [Gateway reference](https://docs.superwise.ai/docs/gateway-reference#cli-commands).

## FAQ

### Do I need Docker to use the Sentinel CLI?

Only to deploy a local Sentinel (Option A). Connecting to a Sentinel your team already runs (Option B) needs no Docker.

### Which Python version does the CLI need?

Python 3.11 or later, with `pip`. Where `python` and `pip` aren't found, use `python3` and `pip3`.

### Does `sentinel test` send my prompt to the model?

No. It runs the text through your guardrails and prints the result without calling the model, and nothing is recorded in telemetry.

### How do I stop routing traffic through Sentinel?

Run `sentinel proxy off`. It restores direct routing to the provider until you run `sentinel proxy on` again.

### Can I use the CLI on Windows?

Yes. The CLI runs on Windows, macOS, and Linux. On Windows, the [Sentinel for Windows](https://docs.superwise.ai/docs/sentinel-for-windows) app is the simpler path.

## See also

* [Sentinel CLI proxy](https://docs.superwise.ai/docs/sentinel-cli-proxy): turn routing on and off, and auto-configure apps like the Codex CLI.
* [Environment variables](https://docs.superwise.ai/docs/environment-variables): route a single app or terminal by hand.
* [Deploy a gateway](https://docs.superwise.ai/docs/deploy-a-gateway): Docker, Helm, and team gateways on AWS, Google Cloud, and Azure.
* [Gateway reference](https://docs.superwise.ai/docs/gateway-reference): providers, routes, and CLI commands.