Approvals
A run asks the hub's owner to OK a step it can't (or shouldn't) take by itself — a secret it can't read, a deploy to a server it can't reach, money, a change to their own app or host — instead of ending on "ask the owner".
- The
ask-approvalskill (owner and guests,GUEST_SANDBOX=1included):scripts/ask_approval.py "TITLE" --plan-file plan.md [--why] [--key] [--touches] [--project]callsPOST $AIA_TOOLS_URL/plugins/approvals/actions/requestwith the run's own token. - The owner gets an owner-only ask-form (via
ask-form/actions/create): Approve / Approve with changes / Deny, a note, and — when the request named akey— Always allow. A guest's conversation gets a "waiting for their OK" note. - On approve the owner's own run is told to go ahead; a guest's request
runs as a new owner run on the lab, in the project, told to do exactly
the plan. When that run ends (
conversation.finished, or the 1-minutesweep), its final answer goes back into the guest's conversation. - Always allow rules (requester + project + key) skip the form; the run
they start checks the new request is in scope (
STATUS: out-of-scopeasks the owner after all). - One request, one form per conversation and key, whatever the hub does.
A form create that errors may have made the form anyway (it timed out on
our side, not ask-form's), so the form is looked up by
meta.approvalIdand adopted before any new one opens. A slow hub leaves the request pending (formPending): the sweep tries again after 90 s, 3 tries in all, then fails it and tells the conversation. A retry with the same key lands on the same request — even one that failed only because its form didn't open. An answer on any form of the request counts; the extra forms are revoked, and their cancel events ignored. - Settings → Plugins → Approvals lists what's waiting (Open form), the history (requester and owner-run conversations) and the standing rules (Revoke).
For other plugins: decision
requires: ["approvals"], then
POST $AIA_TOOLS_URL/plugins/approvals/actions/decision with
{"requestId", "title", "description", "sessionId", "requester", "options"?, "fields"?, "meta"?}
→ {"approvalId", "formId", "url", "status": "pending"}. An owner-only form
(Approve / Decline by default), no run. fields (≤ 4: checkbox, text,
textarea, select, radio, number) are the caller's own, shown while the
first option is picked — ship's Also add host to project allowlist; their
answers come back in answers. Subscribe to
plugin:approvals:decision.resolved:
{"approvalId", "requestId", "formId", "decision": "approve" | "deny", "choice", "cancelled", "note", "answers", "sessionId", "requester", "meta"}.
Data
approvals.json in the plugin's hub-scoped dir — the core's old
/data/approvals.json shape (requests + rules), carried over once by the
hub (backend/plugins/carryover.py).