An outcome action is an MCP tool call the backend makes after a run finishes, for example to open a ticket when a nightly run fails. The run’s policy selects its actions, and each action names the run outcomes that trigger it. The tools available depend on the MCP server you connect: a ticketing server may offer issue creation or commenting. Saci has no built-in GitHub or Jira client.
Actions follow these rules:
actions:
servers: # MCP servers the backend calls
tickets:
url: http://tickets-mcp:9090/mcp
headers:
Authorization: Bearer ${TICKETS_TOKEN}
secrets: # values for ${NAME} in servers, read by the backend
TICKETS_TOKEN: { env: SACI_TICKETS_TOKEN }
definitions:
open-ticket:
server: tickets
tool: create_issue
on: [failed, error] # run outcomes that trigger it
approval: none # or required
idempotency_key: request_id # only if the tool deduplicates on it
arguments:
title: ": "
body: |
Run in ended ().
Evidence:
policies:
nightly:
on_failure: continue
actions: [open-ticket]
| Setting | Meaning |
|---|---|
actions.servers.<name> |
An MCP server, written like mcp_servers: command, args and env for stdio, or url and headers for Streamable HTTP. |
actions.secrets.<NAME> |
{ env: VAR }: a backend environment variable. ${NAME} in servers expands to it, and it is redacted from stored results and errors. |
actions.definitions.<name>.server |
A server under actions.servers. |
.tool |
The tool to call. |
.on |
Run outcomes that trigger the action: passed, failed, blocked, inconclusive, error, cancelled. Required. |
.approval |
none (default): dispatched once recorded. required: kept as pending_approval until approved. |
.arguments |
The tool’s arguments. Strings may contain the variables below. Other values are sent as written. |
.idempotency_key |
Optional. The tool argument that receives Saci’s key for this run and action, saci-<run-id>-<name>. Set it only when the tool deduplicates calls on that argument; see Retries and restarts. |
policies.<name>.actions |
The actions considered when a run under this policy finishes. |
The configuration is checked at startup: unknown servers, unknown
variables, empty on lists and undefined policy actions are errors. A run
keeps the action definitions of its policy as they were when it was
accepted. Server connection settings are read when the action is
dispatched.
| Variable | Value |
| — | — |
| | The run ID. |
|, | The run's outcome and why it ended. |
| | Unit counts, such as 1 failed, 2 skipped. |
| , | RFC 3339 timestamps. |
| , | The plan title and entry document. |
| ,, | Names recorded in the report header. |
| | One line per finished unit: outcome, ID, title and the assessment’s explanation. |
| | The unsuccessful units, each with its criterion results. |
| | Excerpts of the evidence cited by unsuccessful units: commands with exit codes and output, HTTP requests with status and body, MCP results. Each output is cut to 1000 bytes, and the whole to 16 KiB. |
Evidence is redacted with the run’s secrets before it is stored, so excerpts never contain secret values.
The dispatcher runs inside the backend process, not in a worker:
command must be installed where the backend runs: on
its PATH, or as an absolute path. The process starts with only PATH
and its configured env entries.url must be reachable from the backend: from the
backend’s host locally, or from the backend pod in Kubernetes.config.actions, and pass secrets
to the backend through backend.extraEnv, for example with
valueFrom.secretKeyRef. The backend does not read Kubernetes Secrets
itself, so { secret, key } references are rejected here.| State | Meaning |
|---|---|
pending_approval |
Recorded with approval: required. It is not dispatched until approved. |
queued |
Waiting for the dispatcher: automatic, approved, replayed or redispatched. |
rejected |
A person rejected it. It is never dispatched. |
executing |
Claimed: the claim is stored before the call is made. |
completed |
The tool returned a result, or a person reconciled it as completed. |
error |
Delivery failed. error says why, and result holds the tool’s text when it answered. |
unknown |
The call may have reached the server, but no answer was recorded. It waits for a person. |
The dispatcher connects to the server, initializes it and lists its tools
within limits.operation_timeout_secs. It then checks the recorded
arguments against the tool’s input schema: required properties, property
types, and additionalProperties: false. A mismatch is an error, and
nothing is sent.
When the schema gives a maxLength for a string property and the value is
longer, the dispatcher shortens the value before the call. It counts the
limit in bytes, so the value also fits a server that counts characters. It
cuts the value at a character boundary, at the last line break in the
second half of the kept text when there is one, and adds a [truncated]
line. The recorded arguments keep the full value. The action’s result
ends with [shortened to the tool's maxLength: <names>].
The call itself must answer within limits.operation_timeout_secs.
Whatever happens to an action, the run’s outcome stays as it was.
Saci never retries a call blindly, and promises no exactly-once delivery for arbitrary tools: only the server can tell whether it acted on a call. What Saci guarantees:
error.executing, the server may or may not have acted.
idempotency_key, the call is replayed with the same key, up
to 3 attempts in all. The server recognizes the key and does not act
twice. When attempts run out, the action becomes unknown.unknown at once and is not sent
again.unknown, since
an earlier attempt may have reached the server.An unknown action needs a person who checks the remote system (for
example, whether the ticket exists):
saci actions show <run-id> open-ticket # error, attempts and history
saci actions reconcile <run-id> open-ticket --as completed --note "ticket 42 exists"
saci actions reconcile <run-id> open-ticket --as error --note "no ticket"
saci actions redispatch <run-id> open-ticket --note "no ticket; sending again"
reconcile records what the remote system shows, completed or
error, and sends nothing. Only unknown actions can be reconciled.redispatch queues the same recorded arguments again. It applies to
unknown and error actions and names the arguments’ digest, like an
approval. Without an idempotency key, a tool that already acted acts
again, so check first.409 action_not_resolvable.Each action keeps its history in SQLite: when it was recorded, approved or
rejected, claimed, answered, failed, found uncertain, replayed,
redispatched or reconciled, with its state and attempt count afterwards
and the error or note. saci actions show prints it, and
GET /api/v1/runs/{run_id}/actions/{name} returns it.
Approval is configured per action (approval: required) and applies after
a run, never before it: runs start immediately as usual. An approval-
required action is recorded as pending_approval with its arguments
already rendered. A reviewer decides on exactly that payload:
saci actions list # what waits for approval
saci actions show <run-id> escalate # arguments and digest
saci actions approve <run-id> escalate --digest <digest> --note "on-call agreed"
saci actions reject <run-id> escalate --note "known issue"
409 digest_mismatch), so
what is sent is what was reviewed. Recorded arguments never change.queued, and the dispatcher sends it.
Rejection is final.pending_approval actions take a decision. A second decision, or a
decision on an automatic action, is refused (409 action_not_pending).backend.auth is configured. Saci records no reviewer identity
beyond the note; anyone holding the token can decide.API: POST /api/v1/runs/{run_id}/actions/{name}/approval and
.../rejection with {"digest": "...", "note": "..."}, and
GET /api/v1/actions?state=pending_approval across runs
(API).
saci report <run> lists the actions after the report:
Actions (delivery does not change the outcome):
open-ticket: completed (tickets/create_issue): created issue 42
GET /api/v1/runs/{run_id}/actions returns them with the exact arguments
and their SHA-256 digest (API).