Skip to content

ov agent

import { Aside } from ‘@astrojs/starlight/components’;

ov agent is a background daemon that holds your KEK in memory after a one-time authentication, then serves secret injection requests over a Unix socket. Use it on Linux servers and CI runners where prompting for a password on every ov run invocation is not practical.


ov agent start --machine-key /etc/ov/machine.kek
daemon starts, loads KEK, listens on Unix socket
ov run --agent --secrets DATABASE_URL -- ./migrate
run sends signed request to socket → agent decrypts → subprocess runs

The agent authenticates requests via HMAC-SHA256 derived from the machine key. Only a client that holds the same machine key can send valid requests. The socket itself is protected by 0700 directory + 0600 permissions.

Plaintext secret values never cross the socket — the agent runs the subprocess itself and returns only the exit code.


A machine key file is required to start the agent:

Terminal window
ov auth derive-machine-key --out /etc/ov/machine.kek
chmod 600 /etc/ov/machine.kek

See Machine key setup for details.


CommandDescription
ov agent startStart the agent daemon
ov agent stopStop the running agent
ov agent statusShow agent status
ov agent installInstall a systemd unit file

Terminal window
ov agent start --machine-key /etc/ov/machine.kek --app my-saas

Starts the daemon in the foreground. Use --foreground with systemd Type=simple.

FlagDescription
--machine-key PATHPath to machine key file (required for HMAC socket auth)
--app NAMEDefault app slug for op=run requests
--socket PATHUnix socket path (default: $XDG_RUNTIME_DIR/ov-agent/ov-agent.sock)
--pid-file PATHPath to write PID file
--foregroundRun in foreground (required for systemd Type=simple)

Terminal window
ov agent stop
ov agent stop --pid-file /run/ov-agent/ov-agent.pid

Sends SIGTERM to the agent. Returns immediately — in-flight requests finish before the daemon exits.


Terminal window
ov agent status
ov agent status --machine-key /etc/ov/machine.kek

Queries the agent socket and prints uptime and version. If the socket is unreachable, falls back to checking the PID file.

Pass --machine-key if the agent was started with one — without it, the signed request will be rejected and status falls back to the PID file check.


Terminal window
ov agent install --machine-key /etc/ov/machine.kek
ov agent install --machine-key /etc/ov/machine.kek --enable

Writes a systemd unit file and prints the commands to enable and start it. Pass --enable to run systemctl daemon-reload && systemctl enable --now ov-agent automatically.

FlagDescription
--machine-key PATHPath to machine key file (required)
--socket PATHUnix socket path
--unit-name NAMEsystemd unit name (default: ov-agent)
--enableRun systemctl to enable and start immediately

The recommended production setup:

Terminal window
# 1. Create the machine key
ov auth derive-machine-key --out /etc/ov/machine.kek
chmod 600 /etc/ov/machine.kek
# 2. Install the systemd unit
ov agent install \
--machine-key /etc/ov/machine.kek \
--enable

The generated unit file uses Type=simple and restarts on failure. It runs as the current user.


  • Socket directory: 0700 (only the owning user can access it)
  • Socket file: 0600
  • HMAC-SHA256 per-request authentication when started with --machine-key
  • Replay window: ±30 seconds (timestamp-based; no stateful nonce store)
  • Plaintext values never cross the socket — the agent injects them directly into subprocess environments

Known limitations:

  • No server-side nonce store: a captured signed request can be replayed within the 30-second validity window
  • Interactive sessions (no --machine-key) have no socket authentication beyond filesystem permissions