Build a Go/No-Go File for an Unattended AI Worker
Description and use
Create a gates.json file and a runner.py script to ensure an unattended AI worker starts only when all predefined conditions are met, preventing runaway processes and hidden costs.
Problem
Running an AI worker unattended can lead to runaway processes, unnecessary costs, and silent failures when remote services become unavailable.
Outcome
The worker runs only when all safety gates are satisfied, preventing runaway execution, ensuring cost control, and providing clear failure diagnostics.
Workflow
- 1. Create gates.json with required parameters (heartbeat_path, max_wall_seconds, max_remote_calls, empty_output_policy, output_allowlist, stop_file, stub_command, min_free_mb, probe_attempts, probe_timeout_seconds).
- 2. Ensure the stub command (e.g., python stub_classify.py) is available on PATH.
- 3. Run the go/no-go checker script (runner.py) before launching the worker. It validates all gates and writes a heartbeat file.
- 4. If the checker exits with code 0, start the worker; otherwise, abort or wait.
- 5. The worker writes output only to allowed directories and respects the heartbeat and stop file signals.
Evidence
The runner never calls the remote model. It only answers go or no-go for launch.
Eight gates I refuse to skip
- Record date: 2026-09-16T15:30:27.680Z