v0.4.1 · disposable previews · mesh isolation · bucket websites Agents ship · humans inspect
← Engineering log

An audit trail agents can annotate

Every authenticated SSH command now lands in PostgreSQL as a redacted audit event, and agents can attach a --comment explaining why they ran it.

When agents operate a platform, the interesting question is rarely "what happened", because Git receipts already answer that. It is "who asked for it, when, and did it work". Mechanics 0.3.21 made that durable: every authenticated SSH command lands in PostgreSQL as a redacted audit event.

Recorded, but safe to record

Audit events capture the canonical command path, stable action name, principal, SSH key, timing, and outcome, including authorization denials, command-surface rejections, and non-zero exits. They deliberately exclude command output, stdin, tokens, passwords, and registry credential payloads. The display line is reconstructed from redacted argv, and help plus pre-auth paths never produce events at all. Audit writes are non-blocking after startup: an audit outage cannot take the control plane down with it.

operator inspection

mechanics audit list --account alice --outcome error --since 24h
mechanics audit list --action app.release --json
mechanics audit tunnels --account alice

Comments carry intent

0.3.28 added the other half. Any authenticated non-help command accepts a command-local --comment, and the note is persisted on the audit event. For an agent running a long convergence loop, that turns a wall of identical app wait rows into a legible story.

annotated commands

ssh -T mechanics.run -- app -a myapp wait --json \
  --comment "verifying rollout after fix for issue 42"
ssh -T mechanics.run -- route check web \
  --comment "confirming public reachability before handoff"

Comments are trimmed, capped at 2048 bytes, and scanned for obvious secret patterns before storage. Annotation is not a side channel for credentials. Since 0.3.37, workspace tunnels get the same treatment in their own event table, byte counts included.

The platform remembers what was done. --comment lets the actor say why.