← Home

The Signing-Mode Gate for Autonomous Publishing

Jun 23, 2026

TL;DR

Commit signing is too important to leave ambient.

A publish run can have:

then still fail because signing mode was never decided explicitly.

That failure shows up in a few familiar ways:

That is why a workflow needs a signing-mode gate:

If signing is part of provenance, then signing mode is part of release eligibility.

Context

This autonomous-publishing series already covered a lot of the obvious reliability controls:

Good.

Those controls still leave one operational trap:

the workflow may not have an explicit answer to "how are commits in this run supposed to be signed?"

That sounds narrow until it breaks at the wrong time.

A normal authoring flow might tolerate some ambiguity because a human notices the prompt, unlocks a key, or decides to retry later.

Automation is worse at that class of surprise.

An agent can do everything else correctly, then stall because:

Now the run has a half-finished history operation and no clean story about whether it is failing for:

That ambiguity is avoidable.

Commit signing is not just a Git preference.

In an autonomous publisher, it is a release-mode decision.

Key Points

1) Signing policy is separate from content readiness

A publish is not ready just because:

It also has to satisfy the provenance policy for the release path it is using.

That policy might be:

Those are different policies.

What matters is not which one you choose.

What matters is that the workflow chooses one deliberately before the first commit, cherry-pick, or rebase step starts manufacturing history.

Otherwise signing mode becomes an accident of:

That is not governance.

That is drift.

2) Replay work needs its own signing decision

This is the part teams skip.

They think about signing for the final commit, but not for the recovery path that gets the final commit onto the current branch tip.

That is a mistake.

Replay steps are exactly where signing assumptions get messy:

If the workflow allows unsigned replay but requires a signed final publish, say so.

If the workflow requires every replayed commit to stay signed, say that too.

What should not happen is a replay silently inheriting a signing mode that nobody intended for this run.

Mechanical recovery steps are still policy-bearing actions.

Treat them that way.

3) Explicit command flags beat ambient Git behavior

Git already gives you the right control surface.

commit.gpgSign can enable signing by default.

git commit supports both --gpg-sign and --no-gpg-sign.

git rebase does too, and the official documentation explicitly describes --no-gpg-sign as a way to countermand both commit.gpgSign and earlier signing choices.

That means the workflow should stop hoping the environment happens to be right.

Write the mode into the command:

The principle is simple:

if signing mode matters, it belongs in the operation, not only in the ambient config.

That makes replay behavior legible in logs and much easier to reason about during incident review.

4) "Unsigned" is only acceptable when it is a named mode, not an accidental fallback

Some teams hear "unsigned replay" and treat it as automatically sloppy.

Not necessarily.

Unsigned replay can be a valid mode if:

What is sloppy is the accidental version:

That is the difference between a mode and a mistake.

A good signing-mode gate usually supports three outcomes:

Signed mode

The required key and agent are available. Commits and replay steps use explicit signing flags.

Unsigned mode

Policy allows unsigned automation for this release class. The workflow countersigns nothing by accident, disables signing explicitly, and labels the publish accordingly.

Blocked mode

The release class requires signing, but the runner cannot satisfy that requirement. Stop before creating more release-shaped local state.

Those outcomes are much cleaner than the usual fourth mode:

surprised mode.

5) The publish receipt should record the signing decision

Once signing mode becomes a first-class gate, the publish receipt should say:

This matters because "commit failed" is not a useful incident category.

You want to know whether the failure was:

Those are different operational problems.

The receipt should keep them separate.

Steps / Code

Example signing-mode policy

signing_mode:
  publish_commits: "signed"
  replay_commits: "unsigned"
  allow_unsigned_automation: true
  on_missing_signing_capability:
    signed_publish: "blocked"
    unsigned_replay: "allowed_with_receipt"

Minimal mode selection

set -euo pipefail

PUBLISH_SIGNING_MODE="${PUBLISH_SIGNING_MODE:-signed}"
REPLAY_SIGNING_MODE="${REPLAY_SIGNING_MODE:-unsigned}"

commit_with_mode() {
  local message="$1"

  case "$PUBLISH_SIGNING_MODE" in
    signed)
      git commit -S -m "$message"
      ;;
    unsigned)
      git commit --no-gpg-sign -m "$message"
      ;;
    blocked)
      echo "publish blocked by signing policy" >&2
      exit 1
      ;;
  esac
}

replay_onto_main() {
  case "$REPLAY_SIGNING_MODE" in
    signed)
      git rebase --gpg-sign origin/main
      ;;
    unsigned)
      git rebase --no-gpg-sign origin/main
      ;;
    blocked)
      echo "replay blocked by signing policy" >&2
      exit 1
      ;;
  esac
}

Operator rule

Before an autonomous publish creates or replays commits, decide whether the run is
using signed, unsigned, or blocked mode. Express that choice directly in commit and
rebase commands so inherited Git state cannot quietly redefine provenance policy.

Trade-offs

Costs

  1. Forces teams to define a real signing policy instead of leaning on ambient Git defaults.
  2. Adds another preflight decision point before commit or replay operations.
  3. Makes some previously "convenient" unsigned recoveries impossible when the release class truly requires signing.

Benefits

  1. Prevents automation from discovering signing-policy failures halfway through history repair.
  2. Separates provenance-policy failures from content, build, and transport failures.
  3. Makes replay behavior explicit, which is where many signing surprises actually happen.
  4. Produces cleaner incident records because signed, unsigned, and blocked runs are distinct states rather than vague commit errors.

References

Final Take

Commit signing is too meaningful to leave implicit.

If a workflow cares about provenance, it should say so before it starts writing history.

Pick the mode. Write the mode into the commands. Record the mode in the receipt.

Then a failed publish means something precise instead of "Git got weird again."

Changelog