Skip to content

Operator TUI

The operator TUI (latchgate tui) is the primary interface for setting up, monitoring, and managing a LatchGate instance. It provides a full-screen terminal with six screens covering the complete operator workflow: project initialization, configuration, approvals, audit inspection, action management, allowlist editing, and policy grants.

For day-to-day operation, the TUI replaces the need to memorize individual CLI commands. Start the gate, launch the TUI, and stay there.

Terminal window
latchgate up # terminal 1: start the gate
latchgate tui # terminal 2: manage everything

First-time setup — open the TUI after latchgate up, switch to the Setup screen (6), and run the init wizard (i) to choose a preset. Add operators (2 sub-tab), then principals (3 sub-tab) and grant them actions with g. Configure webhooks and secrets as needed. Run doctor (d) to verify everything. Start the gate (u).

Day-to-day operation — the Dashboard (1) shows health, pending approvals, posture status, and recent activity at a glance. When an agent triggers a gated action, the Approvals screen (2) shows it with a countdown timer — approve (a), learn+approve (l), or deny (d) with one keypress. The Audit screen (4) provides a live, filterable event log. Use Shift+R for emergency revoke if needed.

Managing the gate — edit action manifests on the Actions screen (3), manage learned domains and paths on the Allowlists screen (5), and configure operators, principals, webhooks, and secrets on the Setup screen (6).

Terminal window
latchgate tui

The TUI requires operator authentication (same resolution as other operator commands). For single-operator setups, credentials are auto-discovered from latchgate.toml + .latchgate/<name>.pem. When multiple operators are configured, pass --operator-key and --operator-private-key explicitly.

The TUI connects to a running gate — it does not start one. If the gate is unreachable, the TUI exits with a diagnostic message. Start the gate first with latchgate up or latchgate serve. (The Setup screen can also launch latchgate up from within the TUI once connected.)

Not compatible with --json.

A terminal with raw mode support (any modern terminal emulator). Minimum size: 80 columns × 24 rows. Below that threshold the TUI displays a size warning instead of rendering screens.

Built on ratatui with crossterm as the backend.

The TUI has six screens, accessible by number key (16) or by cycling with Tab/Shift+Tab.

KeyScreenPurpose
1DashboardGate health, pending approvals, posture breakdown, recent activity
2ApprovalsReal-time approval queue with approve / learn+approve / deny
3ActionsBrowse, edit, and create action manifests; build custom presets
4AuditPaginated, filterable audit event log
5AllowlistsManage learned egress domains and path globs per action
6SetupConfig viewer, doctor checks, operator/principal/policy/webhook/secret management, init wizard, gate lifecycle

The default screen. A compact health bar at the top shows gate status, uptime, registered actions, pending approvals, dependency health (Redis, OPA), and security posture. When any security protection is relaxed, a posture breakdown line shows which protections are affected. Below the health bar, a recent-activity feed shows the latest audit events.

KeyAction
EnterJump to Approvals screen
rForce refresh

Real-time approval management. Pending approvals appear with countdown timers showing time remaining before expiry. A badge count on the tab label (e.g. Approvals(3)) indicates pending items from any screen.

KeyAction
aApprove selected (prompts for confirmation)
lLearn domain/path + approve (prompts for confirmation)
dDeny (opens reason input)
/kMove cursor up
/jMove cursor down
EnterJump to Dashboard (when queue is empty)

The l (learn+approve) key is context-sensitive: it appears in the status bar only when the selected approval has unresolved domains or paths. The learned entry is persisted only if execution succeeds — same semantics as latchgate approvals approve --learn-domain on the CLI.

Browse the action registry, edit manifests on disk, create new actions, and build custom presets.

List mode (default):

KeyAction
/kMove cursor up
/jMove cursor down
eEdit selected action manifest
nCreate new action
pBuild custom preset
rRefresh action list

Edit mode (after pressing e):

KeyAction
/kPrevious field / list item
/jNext field / list item
EnterEdit field / cycle risk level
aAdd item (list fields)
dDelete item (list fields)
sSave changes to disk
EscDiscard and close editor

Preset builder (after pressing p):

KeyAction
/kPrevious item
/jNext item
SpaceToggle action selection
EnterProceed to next step
EscCancel

Create wizard (after pressing n):

KeyAction
/kPrevious option
/jNext option
EnterConfirm selection
EscCancel

Paginated audit event log with filtering and text search. Events stream in during each tick cycle and can be browsed backward.

KeyAction
fCycle filter (decision → action → principal → event_type)
/Text search across visible fields
oLoad older events (backward pagination)
rClear and refetch
/kScroll up
/jScroll down
HomeJump to newest
EndJump to oldest

Manage learned egress domains and path globs per action. A sub-tab header toggles between Domains and Paths — both share the same interaction model. Entries are scoped per action: a domain learned for slack_post is not available to web_read.

Equivalent to the latchgate domains CLI commands (for the Domains sub-tab) and the /v1/admin/paths admin API endpoints (for the Paths sub-tab), but with a live, interactive interface.

KeyAction
dSwitch to Domains sub-tab
pSwitch to Paths sub-tab
/hPrevious action
/lNext action
/Filter actions by name
/kMove cursor up
/jMove cursor down
aAdd domain or path glob
xRemove selected entry
cClear all entries for action

Configuration and management hub with six sub-tabs. Sub-tabs are navigated with / (or H/L) and 16.

Sub-tabKeyContents
Overview1Config summary, doctor checks, gate lifecycle
Operators2Operator credentials (add/remove)
Principals3Peercred identity mappings + policy ACL (grant/revoke)
Webhooks4Webhook endpoints (add/remove/test)
Secrets5SOPS-encrypted secrets (init/set/remove)
Presets6Browse built-in presets, build custom presets

Overview sub-tab:

KeyAction
iRun init wizard (suspends TUI, launches interactive wizard, returns)
uStart gate via latchgate up (suspends TUI for startup output)
sSet a config value (opens key/value input)
dRun doctor checks
eOpen latchgate.toml in $EDITOR (suspends TUI, resumes on exit)

Operators / Webhooks sub-tabs:

KeyAction
aAdd item (opens form input)
rRemove selected item
/Navigate list

Principals sub-tab:

Two-panel layout: the left panel lists peercred identity mappings (UID, name, scopes), the right panel shows the policy ACL grants for the selected principal — including any wildcard (*) grants that apply to all callers.

KeyAction
aAdd peercred principal (UID/name/scopes)
rRemove selected peercred principal
gGrant action to selected principal (policy)
xRevoke action from selected principal
/Navigate list

Secrets sub-tab:

KeyAction
iInitialize SOPS encryption
sSet a secret value
rRemove selected secret
/Navigate list

These work from any screen when not in an input field:

KeyAction
16Jump to screen by number
TabNext screen
Shift+TabPrevious screen
qQuit
Ctrl+CQuit (always, even during input)
?Toggle help overlay (shows context-sensitive keybindings for current screen)
Shift+REmergency revoke epoch (double-confirm: y/n then type REVOKE)
Shift+SStop gate (confirmation required; only available when gate was started via up)

Advances the revocation epoch from within the TUI — the same operation as latchgate revoke on the CLI. Because this immediately invalidates all outstanding execution grants, it requires double confirmation:

  1. A dialog asks y/n.
  2. If y, a text input requires typing REVOKE exactly. Any other text or Esc cancels.

When the gate was started via latchgate up, the TUI can stop (Shift+S) and restart it. The restart flow stops the gate, suspends the TUI to print startup output, then resumes with the new configuration. When the gate is externally managed (systemd, Docker Compose, serve), these actions display a flash message directing the operator to the host.

The TUI polls the gate on a 3-second tick interval. If the gate becomes unreachable, the TUI enters a reconnect loop with exponential backoff (1 s → 2 s → 4 s → … capped at 30 s). The title bar shows ○ disconnected while disconnected and when connected, along with the gate mode (up, serve, or ext).

The TUI does not exit on connection loss — it keeps retrying so the operator does not lose their session when the gate restarts.

The bottom two rows show a context-adaptive hint line (keybindings relevant to the current screen and state) and a flash message area. Flash messages (success, error, info) appear for 5 seconds (success) or 10 seconds (error) after an action completes.

The TUI supplements the CLI — it does not replace it. The CLI remains the primary interface for scripting, CI pipelines, and non-interactive operation. Every action available in the TUI is also available via CLI commands.

For the CLI approval workflow, see latchgate approvals. For audit queries, see latchgate audit. For domain management, see latchgate domains.