Files
pipelines/docs/system-hardening.md

62 lines
3.1 KiB
Markdown

# Execution safety and reliability
## Artifact trust boundary
Generated files are untrusted input, not application code. Artifact responses
carry a CSP sandbox with no script, form, or connection permission, plus
`nosniff` and `private, no-store`. This applies to direct/raw links as well as
embedded previews. Inline CSS and same-origin/data images remain readable;
interactive HTML applications are deliberately not supported as trusted reports.
The opt-in scratch-browser regression is:
```sh
PIPELINES_BROWSER_TEST=1 go test ./internal/server -run TestArtifactHTMLBrowserIsolation -v
```
It serves a malicious fixture from an ephemeral server and checks that the report
remains readable without executing its script or contacting the control origin.
It never uses a deployed server or model.
## Definition publication is a server capability
The server defaults to execution-only. Browsing and validation are read-only;
publication via `submit`, import, template creation, or raw RPC is refused unless
the operator starts the server with `-allow-authoring` (also accepted through
`pipelines serve`). No client `--yes` flag can enable this capability.
Enable it deliberately for authorized definition changes, preferably in a
separate trusted authoring deployment; leave it disabled for execution workers.
This is a deployment-level gate, not a claim that a program can infer human
intent. An enabled authoring server still trusts its authenticated operator.
An agent with the operator's full OS authority can alter configuration or access
the database: preventing that requires an actual OS/service identity boundary,
not more command-string patterns. Do not give execution agents the authoring
service's credentials or database access.
## Shell tools are trusted local execution
Tool declarations, edit paths, and protected-file read rules are useful controls,
but an arbitrary shell is not a filesystem jail. Programs launched by the shell
can use the host user's permissions, credentials, and network. Use a dedicated
unprivileged account, VM, or container with an explicit workspace mount for
untrusted definitions. Do not advertise prompt instructions as sandboxing.
## Lost run-start replies
The web Run dialog saves one immutable launch payload and request key in tab
storage before sending it. An uncertain launch is not automatically replayed.
`Check / retry` first uses the read-only `get_run` command with `request_key`;
if admitted, it opens that exact run, even if it already finished. Otherwise it
resends the original intent with the same key. Changing the task requires first
resolving admission; an explicit refusal is editable only after that lookup
confirms no run exists. A page reload and reopening the same pipeline/version
recovers the pending intent on the same endpoint.
## Delivery discipline
Checks and browser probes use scratch databases and loopback ports. Installing
changes and restarting shared services are separate operator actions; restarts
must not be used to test cancellation or recover a run while unrelated work is
active. Preserve existing sessions, outputs, branches, and database backups.