GitHub Actions
Store the API key as a secret and the agent ID as a variable, then add a step before the risky one:.github/workflows/deploy.yml
- Pass untrusted text (like the commit message) through an environment variable, never straight into the script, so it can’t inject shell commands.
--request-idmakes a re-run of the same attempt reuse the approval instead of asking again.--max-waitshould be shorter than the job’s timeout. If it’s reached, the CLI exits6and the approval stays open; someone can still answer, and a re-run picks it up.
Branching on the answer
Any exit code other than0 fails the step. To do different things per answer, read the exit code or the JSON:
Other CI systems
GitLab CI, CircleCI, Buildkite and Jenkins work the same way: install Node.js 20+, setFINALSAY_API_KEY and
FINALSAY_AGENT_ID from your secret store, and run npx finalsay ask … --wait. See exit codes.