Skip to content

Tarsus Configuration

Configure the Tarsus client agent.

Tarsus searches for a config file in the following order:

  1. Path specified by TARSUS_CONFIG environment variable
  2. tarsus.toml in the current directory
  3. /etc/mantis/client.toml
  4. ~/.config/mantis/client.toml (platform-dependent config directory)

If no file is found, defaults are used. Environment variables always override file settings.

name = "web-server-01"
mode = "listen"
data_dir = "/var/lib/tarsus"
log_level = "info"
FieldTypeDefaultRequiredDescription
namestringhostnameNoClient name for registration. Env: TARSUS__NAME
modestring"listen"NoOperating mode: listen (server connects to client) or poll (client polls server). Env: TARSUS__MODE
data_dirstringplatform data dir + /tarsusNoData directory for certificates and state. Env: TARSUS__DATA_DIR
log_levelstring"info"NoLog level: trace, debug, info, warn, error. Env: TARSUS__LOG_LEVEL

TLS configuration. TLS is always enabled and cannot be disabled.

[tls]
cert_path = "/etc/mantis/certs/client.crt"
key_path = "/etc/mantis/certs/client.key"
ca_cert_path = "/etc/mantis/certs/ca.crt"
server_name = "thorax.example.com"
trust_server_thumbprint = "a1b2c3d4..."
FieldTypeDefaultRequiredDescription
cert_pathstring-NoClient certificate PEM file. If not set, auto-generated. Env: MANTIS_TLS_CERT_PATH
key_pathstring-NoClient private key PEM file. Must be set with cert_path. Env: MANTIS_TLS_KEY_PATH
ca_cert_pathstring-YesCA certificate for server verification. Env: MANTIS_TLS_CA_CERT_PATH
server_namestring-NoServer name for SNI validation
trust_server_thumbprintstring-Yes (thumbprint mode)Expected server certificate SHA-256 thumbprint (64 hex chars). Required when using auto-generated certs. Env: MANTIS_TLS_SERVER_THUMBPRINT

Mandible connection settings (registration + heartbeat). Tarsus registers with Mandible’s internal gRPC endpoint; Mandible’s response assigns the Thorax instance responsible for command execution. In poll mode Tarsus then connects outbound to that Thorax to fetch commands; in listen mode (the default) Tarsus exposes a gRPC server and the assigned Thorax connects inbound.

[mandible]
endpoint = "mandible.example.com:50052"
connect_timeout_secs = 30
request_timeout_secs = 360
FieldTypeDefaultRequiredDescription
endpointstring"localhost:50052"NoMandible internal gRPC endpoint for registration (hostname:port) — this is the gRPC server port (50052), not the REST API port (3000). Env: TARSUS__MANDIBLE__ENDPOINT
connect_timeout_secsinteger30NoConnection timeout in seconds
request_timeout_secsinteger360NoRequest timeout in seconds. Must exceed Thorax’s command timeout (300s); default is 300s + 60s buffer.

Listen mode configuration (when mode = "listen").

[listen]
address = "0.0.0.0"
port = 9342
FieldTypeDefaultRequiredDescription
addressstring"0.0.0.0"NoBind address. Env: TARSUS__LISTEN__ADDRESS
portinteger9342NoListen port. Env: TARSUS__LISTEN__PORT

Poll mode configuration (when mode = "poll").

[poll]
interval_secs = 30
max_commands = 10
FieldTypeDefaultRequiredDescription
interval_secsinteger30NoPolling interval in seconds. Env: TARSUS__POLL__INTERVAL_SECS
max_commandsinteger10NoMaximum commands to fetch per poll

Registration and heartbeat configuration.

[registration]
enabled = true
heartbeat_interval_secs = 30
max_retries = 3
retry_delay_secs = 5
environment = "production"
token = "your-registration-token"
[registration.tags]
role = "web-server"
region = "us-east-1"
[registration.labels]
team = "platform"
FieldTypeDefaultRequiredDescription
enabledbooleantrueNoEnable registration with server
heartbeat_interval_secsinteger30NoHeartbeat interval. Env: TARSUS__REGISTRATION__HEARTBEAT_INTERVAL_SECS
max_retriesinteger3NoMax registration retry attempts
retry_delay_secsinteger5NoDelay between retries (seconds)
environmentstring-NoEnvironment name for auto-created target (e.g., "production"). Env: TARSUS__REGISTRATION__ENVIRONMENT
tagsmap{}NoKey-value tags for deployment filtering
labelsmap{}NoCustom metadata labels
tokenstring-NoRegistration token for automated approval (Octopus-style). Env: TARSUS__REGISTRATION__TOKEN

Connection retry configuration.

[retry]
max_retries = 3
initial_delay_ms = 1000
max_delay_ms = 60000
backoff_multiplier = 2.0
retry_indefinitely = true
failure_threshold = 5
FieldTypeDefaultRequiredDescription
max_retriesinteger3NoMax retries before resetting backoff
initial_delay_msinteger1000NoInitial delay before first retry (ms)
max_delay_msinteger60000NoMaximum delay between retries (ms)
backoff_multiplierfloat2.0NoExponential backoff multiplier
retry_indefinitelybooleantrueNoKeep retrying after max_retries (with max_delay). Set false only for testing
failure_thresholdinteger5NoConsecutive failures before opening circuit

Tokio-console settings for async runtime debugging. Only active when the tokio-console feature is enabled.

[console]
enabled = true
address = "127.0.0.1"
port = 6671
retention_secs = 60
publish_interval_ms = 1000
FieldTypeDefaultRequiredDescription
enabledbooleantrue (no config file); false (serde default when section is absent)NoEnable the tokio-console server. When Tarsus starts without a config file it uses ConsoleConfig::with_port(6671), which sets enabled = true. When a config file is present but omits [console], serde’s own default applies (enabled = false, port 0). Env: TARSUS__CONSOLE__ENABLED
addressstring"127.0.0.1"NoBind address. Env: TARSUS__CONSOLE__ADDRESS
portinteger6671 (assigned at startup)NoConsole port (Tarsus assigns 6671 at startup; the serde default is the sentinel 0). Env: TARSUS__CONSOLE__PORT
retention_secsinteger60NoHow long to retain completed task data. Env: TARSUS__CONSOLE__RETENTION_SECS
publish_interval_msinteger1000NoUpdate interval for connected clients (ms). Env: TARSUS__CONSOLE__PUBLISH_INTERVAL_MS
recording_pathstring-NoPath to record console data for offline analysis. Env: TARSUS__CONSOLE__RECORDING_PATH

WireGuard-based transport configuration for encrypted connectivity. When enabled, Tarsus uses the WireGuard overlay assigned during registration. The relay endpoint (for NAT traversal fallback) is supplied by Mandible at registration time — it is not a config field.

[transport]
enabled = true
private_key_path = "/etc/mantis/wireguard/private.key"
key_rotation_interval_secs = 0
FieldTypeDefaultRequiredDescription
enabledbooleanfalseNoEnable WireGuard transport. Env: TARSUS__TRANSPORT__ENABLED
private_key_pathstring-NoWireGuard private key file. If not set, keys are auto-generated in data_dir. Env: TARSUS__TRANSPORT__PRIVATE_KEY_PATH
key_rotation_interval_secsinteger0NoInterval at which the agent rotates its WireGuard static key over the live overlay. 0 disables periodic rotation. Env: TARSUS__TRANSPORT__KEY_ROTATION_INTERVAL_SECS

Security configuration for protected settings. Settings in this section cannot be overridden by environment variables, preventing configuration injection attacks.

[security]
minimum_transport_level = "wireguard"
FieldTypeDefaultRequiredDescription
minimum_transport_levelstring"none"NoMinimum transport security: none (env override allowed) or wireguard (env override blocked)

Tarsus uses double-underscore env var names in its apply_env_overrides() method.

Environment VariableDescription
TARSUS_CONFIGPath to config file
TARSUS__NAMEClient name
TARSUS__MODEOperating mode (listen or poll)
TARSUS__LOG_LEVELLog level
TARSUS__DATA_DIRData directory
TARSUS__MANDIBLE__ENDPOINTServer address (hostname:port)
TARSUS__LISTEN__ADDRESSListen bind address
TARSUS__LISTEN__PORTListen port
TARSUS__POLL__INTERVAL_SECSPoll interval (seconds)
TARSUS__REGISTRATION__HEARTBEAT_INTERVAL_SECSHeartbeat interval (seconds)
TARSUS__REGISTRATION__ENVIRONMENTEnvironment name for target
TARSUS__REGISTRATION__TOKENRegistration token
MANTIS_TLS_CERT_PATHClient TLS certificate
MANTIS_TLS_KEY_PATHClient TLS private key
MANTIS_TLS_CA_CERT_PATHCA certificate
MANTIS_TLS_SERVER_THUMBPRINTServer thumbprint (SHA-256 hex)
TARSUS__TLS__ENROLLMENT_ADDRESSCSR enrollment address (host:port)
TARSUS__TRANSPORT__ENABLEDEnable WireGuard transport
TARSUS__TRANSPORT__PRIVATE_KEY_PATHWireGuard private key path
TARSUS__TRANSPORT__KEY_ROTATION_INTERVAL_SECSWireGuard key rotation interval (seconds)

See Environment Variables for complete reference.

tarsus.toml
name = "web-server-01"
mode = "listen"
log_level = "info"
[tls]
ca_cert_path = "/etc/mantis/certs/ca.crt"
trust_server_thumbprint = "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2"
[mandible]
endpoint = "mandible.example.com:50052"
[listen]
address = "0.0.0.0"
port = 9342
[registration]
enabled = true
heartbeat_interval_secs = 30
environment = "production"
token = "your-registration-token"
[registration.tags]
role = "web-server"
region = "us-east-1"
[retry]
retry_indefinitely = true
tarsus.toml
name = "db-server-01"
mode = "poll"
log_level = "info"
[tls]
cert_path = "/etc/mantis/certs/client.crt"
key_path = "/etc/mantis/certs/client.key"
ca_cert_path = "/etc/mantis/certs/ca.crt"
[mandible]
endpoint = "mandible.example.com:50052"
[poll]
interval_secs = 15
max_commands = 5
[registration]
enabled = true
environment = "production"
[security]
minimum_transport_level = "wireguard"
[transport]
enabled = true