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

# /operator

> Start an interactive operator session for guided penetration testing

## Overview

The `/operator` command starts an interactive operator session where you work alongside the AI agent in real time. Unlike `/pentest` which runs autonomously, operator mode gives you step-by-step control over the testing process — you can approve actions, steer the agent's focus, and intervene at any point.

## Usage

```bash
/operator
```

With flags:

```bash
/operator --target https://example.com --mode auto
```

**Alias**: `/o`

## How It Works

#### Configure Target

Provide the target URL and optional authentication details.

#### Choose Mode

The agent starts in Default mode with all tools available. Press `Shift+Tab` to toggle Plan mode (read-only tools only). Toggle approval on/off with `Option+Shift+Tab`.

#### Interactive Session

The AI agent proposes actions and you approve, reject, or redirect in real
time.

![Operator session — interactive prompt](/apex/_fern-files/_img/4667e19ba0f763c7ecb4c0d3eaa7e80b6e17113ef0e86f49cfec9a4c655a5c47.webp)

## Operator Modes

| Mode        | Description                                                                                                                                                                               |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Default** | All tools are available; the agent can read, write, and mutate targets                                                                                                                    |
| **Plan**    | Read-only tools only — mutation tools (create_file, update_file, create_poc, document_vulnerability, document_app, document_endpoint) are excluded so the agent can only observe and plan |

You can toggle between Default and Plan mode at any time during a session using `Shift+Tab`. The current mode is shown in the operator dashboard header.

> **Info**
>
> **Plan mode** is useful for reviewing the agent's strategy before allowing any mutations. Start in Plan mode to understand the agent's approach, then switch to Default mode when you're ready for it to take action.

### Approval Control

In addition to operating mode, you can toggle whether tool calls require your approval:

* **Approval on** — the agent pauses before each tool call and waits for you to approve (`Y`) or auto-approve (`A`)
* **Approval off** — tool calls execute automatically

Toggle approval with `Option+Shift+Tab` (or `Alt+Shift+Tab` on Linux/Windows).

## Command Flags

| Flag                     | Description                                                                      |
| ------------------------ | -------------------------------------------------------------------------------- |
| `--target <url>`         | Target URL to test                                                               |
| `--name <name>`          | Session name                                                                     |
| `--mode <mode>`          | Operator mode: plan, manual, or auto                                             |
| `--autopilot`            | Disable approval gates (auto-approve all actions)                                |
| `--model <model>`        | AI model to use                                                                  |
| `--auth-url <url>`       | Login page URL                                                                   |
| `--auth-user <user>`     | Auth username                                                                    |
| `--auth-pass <pass>`     | Auth password                                                                    |
| `--auth-instructions`    | Custom auth instructions                                                         |
| `--hosts <h1,h2,...>`    | Allowed hosts (comma-separated)                                                  |
| `--ports <p1,p2,...>`    | Allowed ports (comma-separated)                                                  |
| `--strict`               | Enable strict scope mode                                                         |
| `--headers <mode>`       | Headers mode: none, default, or custom                                           |
| `--header "Name: Value"` | Custom HTTP header sent on every in-scope request (repeatable)                   |
| `--headers-from <file>`  | Load headers from a JSON object or `Name: Value` file                            |
| `--no-global-headers`    | Skip the snapshot of `pensar config headers` defaults                            |
| `--sandbox`              | Use isolated session directory as working directory instead of current directory |

## Keyboard Shortcuts

| Key                | Action                                |
| ------------------ | ------------------------------------- |
| `Shift+Tab`        | Toggle between Default and Plan mode  |
| `Option+Shift+Tab` | Toggle approval on/off                |
| `Ctrl+V`           | Toggle verbose output                 |
| `Ctrl+L`           | Toggle expanded logs                  |
| `Ctrl+C`           | Abort running agent / clear input     |
| `Y`                | Approve pending tool call             |
| `A`                | Auto-approve all remaining tool calls |
| `Escape`           | Exit operator session (when idle)     |

## When to Use /operator vs /pentest

#### /pentest

**Autonomous mode** — set a target and let the AI agent swarm run
independently. Best for comprehensive, hands-off testing.

#### /operator

**Interactive mode** — guide the AI agent step by step. Best for targeted
investigations, learning, or sensitive environments.

| Scenario                         | Recommended |
| -------------------------------- | ----------- |
| Full security audit              | `/pentest`  |
| Investigating a specific feature | `/operator` |
| First time testing a target      | `/operator` |
| CI/CD automated scanning         | `/pentest`  |
| Sensitive production environment | `/operator` |
| Broad vulnerability discovery    | `/pentest`  |

## Example Workflow

```bash
# Start Apex
pensar

# Launch operator session
/operator

# Or with flags for quick start
/operator --target https://api.example.com --mode manual

# In the session:
# - The agent proposes reconnaissance actions
# - You approve or redirect
# - Review findings as they come in
# - Steer toward specific areas of interest
```

![Operator session — agent action approval](/apex/_fern-files/_img/f1216dc27ad7e51a6a5ab029030242f17503576835a507bbffecf18899a6abcc.webp)

## Session Headers

Inside an operator session you can manage the session's custom HTTP headers
without restarting. These headers are applied to every in-scope `http_request`,
shell tool (curl/nuclei/etc.), and Playwright navigation.

| Slash command              | Description                                 |
| -------------------------- | ------------------------------------------- |
| `/headers list`            | Show headers (sensitive values masked)      |
| `/headers list --show`     | Show headers with values revealed           |
| `/headers add Name: Value` | Add a header (errors if `Name` already set) |
| `/headers set Name: Value` | Add or overwrite a header                   |
| `/headers remove Name`     | Remove a single header                      |
| `/headers clear`           | Remove every header                         |

Mutations take effect on the next tool call. Per-request `headers` passed to
`http_request` still win over session-level headers for one-off overrides.

## Operator Skills

You can extend operator mode with custom skills using `/create-skill`. Skills are reusable instruction sets that teach the agent specialized testing techniques or workflows for your specific environment.

## Best Practices

> **Success**
>
> **Tips for Operator Mode**: 1. **Start in Plan mode** (`Shift+Tab`) to review the agent's
> strategy with read-only tools before allowing mutations 2. **Enable approval**
> (`Option+Shift+Tab`) for sensitive targets where you want to approve each action 3.
> **Switch to Default mode** once you're comfortable with the agent's approach 4.
> **Create skills** for repetitive testing patterns in your environment

> **Warning**
>
> **Security Reminder**: Only test systems you own or have explicit
> authorization to test. Unauthorized testing is illegal.

## After Starting

Once you start an operator session:

* The AI agent begins analysis based on your chosen mode
* You interact in real time, approving or steering actions
* Findings are reported as they're discovered
* The session is automatically saved and can be resumed via `/sessions`

## Related Commands

#### [/pentest](/apex/tui-slash-commands/pentest)

Run an autonomous pentest instead

#### [/sessions](/apex/tui-slash-commands/sessions)

Browse and resume previous sessions

#### [/models](/apex/tui-slash-commands/models)

Select AI model before starting

#### [/providers](/apex/tui-slash-commands/providers)

Configure AI provider API keys