ALPQ

Safe Script Handoff

DRAFT 0.12026-11-11updated 2026-11-11for preliminary review

When an AI agent writes a script and a person runs it against live systems, the person is the last check, and people get tired. This draft makes that check small and hard to get wrong: every script is an approved template plus a few plain values, a runner proves both before anything happens, nothing changes until the person types what's on the screen, and every run leaves a record.

Status: a draft for review, not a standard. Adopting it is voluntary. MUST and SHOULD say what an organization that adopts it does. Part of: The Ai–Hi Bridge: this is its pipeline applied to scripts. Only values cross; the template comes from the approved list on the Hi side. Builds on: plan-then-apply tools, the in-toto and SLSA ideas of checking what was approved before it runs, Git history, and versioned parameter stores.

1Goals

  1. Safe when tired: running a script by mistake, or running the wrong one, changes nothing.
  2. Checked by a machine, confirmed by a person: the runner does the comparing; the person reads one plain sentence and types one word.
  3. Hard to tamper with: a script whose code differs from what was approved, by a single byte, does not run.
  4. On the record: every approval and every run can be traced later.

Not a goal: judging whether a change is a good idea. That is still the person's review; this draft only makes sure the reviewed thing is the thing that runs.

2Who does what

RoleWhoCanCannot
AuthorAn AI agent (or a person) on the Ai sideFill in values for an approved template; propose a new templateApprove templates; run scripts on live systems
ApproverA person on the Hi sideAdd a template to the approved list; move the pinBe the author of the template being approved, once a second person is available
OperatorA person on the Hi sideRun scripts through the runnerSkip the runner

In a one-person team, the approver and the operator are the same person. The author MUST still be someone else, or an AI agent.

3The shape of a script

A script has exactly two sections, in this order, with fixed markers:

#!/usr/bin/env bash
# --- PARAMS ---
ID=go56
TEMPLATE=promote
TEMPLATE_VERSION=1
REPO=alpq
FROM=dev
TO=master
EXPIRES=2026-11-18
# --- TEMPLATE ---
...the approved template, byte for byte...

4Values, not code

5Approved templates

The list of approved templates lives in a version-controlled repository that authors cannot write to. Each entry gives:

{ "template": "promote", "version": 1,
  "sha256": "9f2c...e41a",
  "title": "Promote a reviewed branch to production",
  "mode": "apply", "production": true,
  "params": { "ID": "go[0-9]+", "REPO": ["alpq", "miqr"],
              "FROM": ["dev"], "TO": ["master"] },
  "approved": "2026-11-12", "by": "BT" }

6The pin

The runner doesn't trust the repository's latest commit. A separate parameter store holds the pin: the commit of the approved list that is in force, and a version number. The runner reads the pin, fetches the approved list at exactly that commit, and checks against it.

7Delivery

Scripts reach the Hi side through a repository, never through chat or email.

8Running a script

  1. The operator runs the runner with the script number: go55 56 runs script go56.
  2. The runner fetches the script and its content files into a fresh folder and works only on that copy, so nothing can change between the check and the run.
  3. ScriptCheck: it reads the pin, fetches the approved list, and checks the template hash, the values, every content file's hash, the expiry and the template's approval date, using trusted time (section 9). Any mismatch stops it, with one plain line saying which. ScriptCheck is the Hi gate for scripts in the Bridge: verification, testing and security checks in one.
  4. It shows one sentence built from the approved title and the values, for example: go56: promote alpq dev to master (production), template cc-promote@1, approved 2026-11-11 by BT.
  5. It runs the template in plan mode first: it shows what would change and changes nothing.
  6. To apply, the operator types the script's ID as shown (go56); a template marked production asks for PROMOTE go56. Anything else cancels. The apply uses the same checked copy, in the same run.
  7. Fatigue guard: the runner refuses to apply during set quiet hours and after a set number of applies in one session, unless the operator types an override. Plan mode always runs.

9Trusted time and expiry

Old scripts are a quiet risk: a script reviewed in May and run in August meets a different system. So scripts expire, and the clock that decides is not one the author or the operator's machine can move.

10The run log

Every run, planned or applied, passed or refused, appends one line to a log kept apart from the approvals (a separate branch of the same repository works):

{"t":"2026-11-12T14:03:11Z","id":"go56","template":"promote","version":1,
 "sha256":"9f2c...e41a","pin":"3b7e1c0","mode":"apply","result":"ok"}

The author reads the log to learn what happened, instead of asking the operator.

Signed time: every apply and every approval SHOULD carry an RFC 3161 time stamp from a public time-stamp authority over a record that holds the output's SHA-256, so anyone can later prove when it happened and that the record wasn't changed, without trusting the operator. A missing authority MUST NOT block a run; the log says the stamp is missing.

11What a template never does

12How GOVW applies it

GOVW Foundation's runner is called Go55, the Bridge FastPass: the operator types go55 and a script number, reads one sentence and the plan, and types the script's ID. Typed alone, go55 only prints how it works and a link here. Kai, GOVW's AI agent, writes the scripts; GOVW's Director of Technology approves templates and runs scripts from the cloud provider's console shell. The first real run took 4.3 seconds, with the checks at 2.3, and the first approval carries a public time stamp. Three templates are approved so far: promote a reviewed branch, put content files on a preview branch, and hand reviewed code to its preview.

13Open questions

14References

Credit where it's due: plan-then-apply, allowlisted scripts and approved hashes each have long histories. This draft puts them together for one situation: an AI agent writing, a tired person running. Corrections and earlier work are welcome at security@govw.org.