Remote execution and runbooks
Sencai gives you two ways to act on a fleet agent remotely: one-off commands from a fixed template, and multi-step runbooks you define once and trigger repeatedly. Both are dispatched over the agent’s existing connection - no inbound port, no separate SSH session - and both are capability-gated per agent, so nothing runs on a host that hasn’t explicitly been allowed to accept it.
Remote commands
Section titled “Remote commands”Fleet → Remote Exec (/gravity/fleet/remote-exec) dispatches a pre-defined command
template to one or more connected agents.
- Open Fleet → Remote Exec.
- Choose one or more Target Agents (only currently connected agents are listed).
- Choose a Command Template - only templates your organization has marked allowed appear here, and the template’s exact command is previewed before you run it.
- Optionally supply arguments as JSON.
- Click Execute.
Where dispatch is enabled, the target agent also needs the remote-exec capability granted (an organization Owner or Admin grants it per agent from Fleet → Agents → Grant Capability); without it, the dispatch is recorded as blocked rather than run.
Reading results
Section titled “Reading results”The Execution Results table shows every dispatch: agent, command, status (pending / running / completed / failed / blocked), exit code, and duration. Click into any row for the rendered command, stdout, and stderr.
Runbooks
Section titled “Runbooks”Runbooks (/gravity/runbooks) are named, reusable action sequences you define once
and trigger repeatedly - closer to a saved script than a one-off command.
- Open Runbooks and click New Runbook.
- Give it a name and a trigger type: manual (you trigger it yourself) or alert (triggered by the platform’s own alerting, covered in Operations → Auto-remediation).
- Define its actions as a JSON list. Supported action types are
restart_service,clear_disk_space,kill_process, andrun_approved_script- the last one is restricted to scripts already staged on the target agent, it can’t run arbitrary paths. - Approval is required by default - turn Require approval off if you want a trigger to execute immediately - and set a cooldown so the same runbook can’t be re-triggered too soon after itself.
Triggering a runbook
Section titled “Triggering a runbook”Open a runbook and click Trigger. You must specify which agent the run targets - there’s no organization-wide “run everywhere” option. You can also run a dry run first, which reports what would happen without actually executing anything.
If the runbook requires approval, triggering it creates a pending execution - nothing runs on the host until an admin approves it.
Creating, editing, and triggering runbooks - like triggering remote commands - requires an organization Owner or Admin role, given the direct access to a host either capability provides.
Audit trail
Section titled “Audit trail”Every command dispatch and every runbook trigger - who initiated it, on which agent, with what result - is recorded in your organization’s audit trail. See Audit log.
What’s next
Section titled “What’s next”- Fleet agent - the capability model this all runs on top of
- Agent policies - autonomy levels, freeze windows, secret injection and custom probes (capabilities are granted on Fleet → Agents)
- Runbooks - authoring, dry runs, approval, and versioning
- Auto-remediation - runbooks triggered by alerts, not by you
- Quarantine - isolating a host instead of running a command on it