Actions and targets
Actions are the scheduler’s event handlers, made callable without a schedule. Each has three steps: Validate at authoring, Authorize at every fire (frozen ceiling + live permission + standing), and Fire. The permission is always the one the creator would need to do the same thing by hand.
message; dispatch_agent and exec move into the core in Stage 1 PR 2 for schedules first, and become trigger actions in Stage 2 (P1 and P8). A conversation action and a delete_agent action are Stage 4 candidates.message
Delivered through the hub’s canonical delivery path (authorize, phase and hold gates, persist, render envelope, broker or Conduit). The envelope gains webhook.received and a generic trigger.fired type, plus trigger id, event id, source, subject, attributes and a size-capped external_payload section that the agent is told is data, not instructions. Stage 2 adds templated text and an offline: skip | queue policy: a queued fire waits (TTL default 24 h) and is nudged when the agent starts running, re-checking full authority on every retry.
dispatch_agent
- Headless create (Stage 1 PR 2): a real internal create function with labels and event context, lifted from the scheduler. The agent is the one its recorded author would have created by hand: the author as owner, credentials on, project defaults applied (ptone, 2026-11-17, option (b);
noAuth: trueopts out). It gathers required env vars and secrets from hub storage with the same resolver as an interactive create; if needs remain, the fire fails and only key names reach audit. Nothing in the event selects secrets. AgithubToken: installation | user_preferredfield (defaultinstallationfor GitHub triggers) keeps GitHub-started agents acting as the App; it is built in Stage 2 P1c. - From an event (Stage 2 P1):
templateis literal; task, name, branch, labels and message are templatable with${path}; name collisions get a-<4 hex>suffix.ephemeralis refused until ptone/scion#194 lands. - Context to the new agent: exactly three env vars (
SCION_TRIGGER_EVENT_ID,SCION_TRIGGER_ID,SCION_TRIGGER_EVENT_FILE) and the event JSON in~/.scion/trigger-event.json, written by the broker at create (newHomeFileschannel).
The trusted / untrusted templating rule
| Trusted (hub-generated or author-written) | Untrusted (sender-controlled) |
|---|---|
event.id, event.source.*, event.received_at, trigger.*, project.*, result.* (after the fire) | event.type, event.subject, event.occurred_at, event.attributes.*, event.payload.* (scalars) |
Untrusted values may fill data slots only, each must be opted in by name (untrustedVars, which the CLI derives and records), no slot is ever silently truncated (a value over its bound refuses the fire), and a task that used untrusted values gets a hub-written “data, not instructions” trailer. Template, secrets, workspace, remotes and URLs only ever come from literal authoring-time values. The rule copies the lifecycle-hooks precedent.
exec in an agent
Exec schedules (ptone/scion#7818, design AGREED; Phases B, 1, A2, 2, 4 and the web UI merged upstream by 2026-11-17) run an argv in an agent’s container over Conduit, with no LLM turn. Triggers reuse that path rather than building a second one (decided by ptone 2026-11-17, Stage 2 addendum P8, ptone/scion#8241):
- Shared fire/authorize path: the same
execaction (action_exec.go, generalised in Stage 1 PR 2), the sameagent.attachcheck at authoring and at every fire, the same Conduit routes, the same argv-redaction serializer. Target must be running; otherwiseskipped, no wake. - argv is fixed: authored literally;
${…}in the command is refused. Event data never enters argv. - One bounded context variable:
SCION_TRIGGER_CONTEXT(event, trigger and fire ids, subject, and attributes the rule allow-lists), carried by a new versionedexec-startfield that old sciontool rejects (fail closed); fuller data viascion trigger event get. - Accounting: run rows get a
fire_idowner and anoverlap_key; trigger exec has its own per-trigger caps, separate from exec-schedule quotas; the per-container limit of 2 live runs is shared.reuseis refused for exec; a replay-protected or hub-token source is required. - First user: a webhook-started cron-like job on a generic endpoint (no GitHub dependency).
hub.triggers, hub.exec_schedules, hub.conduit), as does the exec-alignment assessment; the P8 scope note names none. The Stage 2 design text still lists exec as a non-goal; P8 was added afterwards by scope note.github.comment
The hub posts a templated comment as the GitHub App, using the project’s installation token narrowed to issues: write. It is for acknowledgements (“on it, here is the agent”), guidance, and the optional unmatched-command reply. Every comment ends with a per-fire idempotency marker; a per-project bucket limits it to 1/s, burst 5. Agents still post their own results with gh and their repo-scoped token.