Headless automation runs AI-supported software work without an interactive interface or continuous supervision, moving assistance into CI pipelines and the broader software lifecycle. section 5.0
Its appeal is speed and persistent coverage; its risk is silent failure. Treat autonomous output as triage or advice until deterministic checks and human judgment establish trust. section 5.0 section 5.3.2
Disciplined headless automation separates enforcement from model judgment:
- Use deterministic checks for blocking decisions, such as secret detection and repository policy violations. section 5.3.2
- Use the model for advisory review of logic, edge cases, performance, security, conventions, and test coverage. section 5.3.2
- Keep humans responsible for architectural decisions, business correctness, and issues automated review can miss. section 5.3.2
- Feed dismissed comments back into review rules so automation reflects the team's actual priorities. section 5.3.2
Pull-request review pipeline
A GitHub Action checks each opened or synchronized pull request, extracts the diff, asks an AI reviewer for file-and-line comments, and posts the resulting review for human evaluation. section 5.3.2
Listing 5.4 Pre-commit hook example
#!/bin/bash
# .git/hooks/pre-commit
set -euo pipefail
DIFF=$(git diff --cached)
[ -z "$DIFF" ] && exit 0
# Deterministic checks block. This is the real gate.
gitleaks protect --staged --redact || exit 1
# The model advises. It cannot block on its own.
VERDICT=$(printf '%s' "$DIFF" | claude -p "Review this diff against our
conventions: error handling, test coverage for new public functions,
naming. Reply with exactly one line of JSON and nothing else:
{\"verdict\":\"clean\"} or {\"verdict\":\"concerns\",\"notes\":\"...\"}")
if [ "$(printf '%s' "$VERDICT" | jq -r '.verdict')" = "concerns" ]; then
echo "AI reviewer raised concerns (advisory, not blocking):"
printf '%s' "$VERDICT" | jq -r '.notes'
fi
exit 0Inspect a pre-commit pattern that blocks on deterministic secret scanning while keeping AI findings advisory. section 5.3.2
