Skip to content
CodeLifter
Search/ Browse prompts
CodeLifter Forum

What is a signed commit, and does it prove who wrote the code?

Staff answerWritten by CodeLifter editors · Code provenance1 replyupdated

Short answer

A signed commit carries a cryptographic signature, made with a GPG, SSH or S/MIME key, over the commit's contents. It proves that whoever held that key signed exactly this commit and that nothing changed since. It does not prove who typed the code, or whether a person or an AI assistant wrote it.

Written by CodeLifter editors · Staff, CodeLifter ·
CiteCodeLifter Forum, "What is a signed commit, and does it prove who wrote the code?", https://codelifter.com/forum/posts/what-is-a-signed-commit-and-does-it-prove-who-wrote-the-code/, accessed 2026-12-04.
  1. Staff, CodeLifter ·

    What does signing actually do?

    Git signs the commit object: the tree, the parents, the author and committer lines and the message. The Pro Git chapter on signing your work opens with the reason: "Git is cryptographically secure, but it's not foolproof. If you're taking work from others on the internet and want to verify that commits are actually from a trusted source, Git has a few ways to sign and verify work using GPG."

    The basic commands, from that chapter and the git-commit reference:

    git config --global user.signingkey 0A46826A    # which key to use
    git commit -S -m "Fix rounding in invoice totals"  # sign one commit
    git config --local commit.gpgsign true           # sign every commit in this repo
    git log --show-signature -1                      # check the latest signature
    git log --pretty="format:%h %G? %aN  %s"         # G = good signature, N = none
    

    The reference describes --gpg-sign (short form -S) as "GPG-sign commits", with a key ID that "defaults to the committer identity". Git also supports SSH keys for signing; a later thread will walk through that set-up.

    What does GitHub's "Verified" badge mean?

    GitHub's page about commit signature verification defines its labels:

    Status GitHub's description
    Verified "The commit is signed and the signature was successfully verified."
    Unverified "The commit is signed but the signature could not be verified."
    No status "The commit is not signed."

    "Successfully verified" means the signature matches a public key added to a GitHub account. The same page says verification gives "other people confidence about the origin of a change you have made". Two further details matter for provenance. A verification record "can't be edited and will persist so that signatures remain verified over time, even if signing keys are rotated, revoked, or if contributors leave the organization", and it "includes a timestamp marking when the verification was completed", available through the API as verified_at. That timestamp is GitHub's, not the committer's, which makes it more useful as evidence than the commit date itself; the commit timestamps thread explains why.

    So does a signature prove who wrote the code?

    No, for three separate reasons.

    It proves key possession, not authorship. Whoever controls the private key can sign anything. A commit written by a colleague, generated by an assistant or pasted from elsewhere can be signed by you, and the signature looks the same.

    The signer is normally the committer, not necessarily the author. Git records an author and a committer, and the signature belongs to whoever made the commit. GitHub's vigilant mode exposes this: a commit is only Partially verified when it "has an author who: a) is not the committer and b) has enabled vigilant mode. In this case, the commit signature doesn't guarantee the consent of the author."

    It says nothing about tools. Nothing in a signature records whether an editor, a code generator or an agent produced the change. GitHub even signs commits itself: "GitHub will automatically use GPG to sign commits you make using the web interface", and bots and GitHub Apps can produce verified commits too.

    What a signature does prove is valuable: the commit has not been altered since signing, and a specific key, usually tied to a specific account, vouched for it. That is accountability, not authorship.

    How is signing different from signing off?

    GitHub's page notes that "Signing commits differs from signing off on a commit." A sign-off is a Signed-off-by: line added with git commit --signoff, a statement about the right to submit the code, often under a project's Developer Certificate of Origin. It is plain text with no cryptography. A signature is cryptographic and makes no statement about rights. Projects can require either, or both.

    How do you record AI involvement, then?

    Use words, not keys. A commit trailer such as Assisted-by: or Co-authored-by: states it plainly, and a signature on that commit then protects the statement from later alteration. The seed thread on enforcing an Assisted-by trailer covers making that consistent, and CodeLifter's guide to disclosing AI help in commits covers the wording.

    Two GitHub details can undermine a signed history if you rely on it. Rebase and merge in a pull request adds commits "without commit signature verification", because GitHub creates modified commits and "doesn't have access to the committer's private signing keys". And branch protection can require signed commits, which blocks unsigned ones but still only checks keys.

    Checked on 12 November 2026.

    Short version

    • A signed commit proves a key holder signed that exact commit and that it has not changed.
    • It does not prove who wrote the code, or whether AI was involved.
    • GitHub's "Verified" means the signature matches a key on an account; vigilant mode adds "Partially verified" for author mismatches.
    • Signing off (--signoff) is a text statement, not a signature.
    • Record AI help in a trailer; sign the commit to protect that record.
    1
    ReplyLink

Plain text or simple Markdown. Links are nofollow. Your email is never shown.

  1. CodeLifter editorsStaffStaff, CodeLifter ·

    If an AI coding agent makes a commit, whose signature is on it? Whoever's key the agent's environment can use, or none. An agent running in your terminal calls git commit like any other program, so if your Git configuration has commit.gpgsign set and the key is unlocked, the commit is signed with your key. The git-commit reference says the signing key "defaults to the committer identity", which in that set-up is you. The signature then says that you vouched for the commit, which is accurate only if you reviewed it.

    Agents that run on a hosting service work differently. GitHub's page about commit signature verification says "If a commit or tag has a bot signature that is cryptographically verifiable, GitHub marks the commit or tag as verified", provided the request is authenticated as the GitHub App or bot and "contains no custom author information, custom committer information, and no custom signature information". In that case the Verified badge belongs to the app, which is a fair description of what happened.

    Two habits keep this honest. Do not leave a signing key unlocked for an unattended agent session if you have not reviewed what it will commit. And label agent commits with a trailer or a distinct author identity, as discussed in the forum's earlier thread on who is the author of a commit made through an MCP server, so the history says what actually wrote the change.

CodeLifter Forum. Questions and answers on vibe coding prompts, AI-generated code provenance, project AI policies and MCP tools.