Skip to content

Automatically attribute agent-assisted comments #13904

Open

Description

@domenkozar

Describe the feature or problem you’d like to solve

AI coding agents increasingly use gh to create issue and pull-request comments while authenticated as a human user. These comments currently look entirely human-authored because GitHub displays only the authenticated user.

GitHub should distinguish authorship from assistance. The user remains the author and responsible party, while the agent that helped prepare the comment should be shown next to the username.

For example:

@octocat · Assisted by Codex
Comment text…

This would make agent involvement visible without adding repetitive attribution text to every comment body.

This is related to #12522, which explores making gh a better interface for agents.

Proposed solution

When creating a comment, gh should detect common agent environment variables and send structured assistance metadata to GitHub.

For example:

gh issue comment 123 --body-file response.md

When invoked inside a recognized agent environment, gh could attach metadata resembling:

{
  "assisted_by": {
    "name": "Codex"
  }
}

GitHub would then:

  • Display “Assisted by Codex” next to the comment author.
  • Expose the attribution through REST and GraphQL APIs.
  • Preserve it when the comment is edited.
  • Include it in issue, pull-request, review, and discussion comments.
  • Keep the authenticated user as the comment’s author and responsible party.

gh could maintain a registry of well-known signals, such as the environment variables set by Codex, Claude Code, Copilot CLI, and other agents. Detection should use only the presence or documented value of these signals and should not transmit unrelated environment data.

The CLI should also support explicit control:

# Override or provide attribution
gh issue comment 123 --assisted-by "Codex" --body-file response.md

# Suppress automatically detected attribution
gh issue comment 123 --no-assisted-by --body-file response.md

An environment variable could support agents that are not yet recognized:

GH_ASSISTED_BY="My Agent" gh issue comment 123 --body-file response.md

Suggested behavior:

  1. --assisted-by takes precedence.
  2. --no-assisted-by disables attribution.
  3. GH_ASSISTED_BY provides an explicit environment-level value.
  4. Otherwise, gh checks its registry of known agent environment signals.
  5. If nothing is detected, the comment is created normally.

Additional context

A visible footer is insufficient because it is unstructured, inconsistently formatted, easy to omit, and visually noisy. A hidden HTML marker is machine-readable but does not inform readers viewing the comment.

First-class metadata would support transparency while preserving the distinction between authorship and assistance. It would also let repository owners audit or establish policies around agent-assisted interactions.

This likely requires coordination between gh, the GitHub API, and GitHub’s comment UI. The CLI can perform agent detection, but the platform must store and render the resulting metadata.

Activity

  1. cli-triage commented on Jul 17, 2026

    @cli-triage

    This is a well-described enhancement request to add structured agent-attribution metadata to comments created by gh, including auto-detection of known agent environments and explicit --assisted-by / --no-assisted-by flags. No duplicate was found - the related #12522 is a broader exploration issue that this proposal builds on rather than duplicating. I'm suggesting the enhancement label since the feature doesn't exist yet and the request is clear and actionable (pending GitHub API/platform support for the metadata field).

    Generated by Issue Triage (skills-driven) for #13904 · 20.4 AIC · ⌖ 4.99 AIC · ⊞ 5.1K · ◷

  2. added
    enhancement
    platform
    and removed
    needs-triage
    on Jul 20, 2026
  3. github-actions commented on Jul 20, 2026

    @github-actions
    Contributor

    Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.

    Unless you see the help wanted Contributions welcome label, we are not currently looking for external contributions for this feature.

    If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.

  4. BagToad commented on Jul 20, 2026

    @BagToad
    Member

    Thanks for the issue @domenkozar. This is an interesting idea, but needs platform / API support for such a thing, so I'm labeling it as blocked. Please feel free to ask for and advocate for this platform side feature in the GitHub Community discussions.

    When creating a comment, gh should detect common agent environment variables and send structured assistance metadata to GitHub.

    My 2c is that this is invasive and controversial. It's similar to AI harnesses adding their authorship to commits, which people have varying opinions about. Most of those cases have a way to turn it off as well.

  5. domenkozar commented on Jul 20, 2026

    @domenkozar
    Author

    Thanks for the issue @domenkozar. This is an interesting idea, but needs platform / API support for such a thing, so I'm labeling it as blocked. Please feel free to ask for and advocate for this platform side feature in the GitHub Community discussions.

    Closest I could find is https://github.com/orgs/community/discussions/178715

    When creating a comment, gh should detect common agent environment variables and send structured assistance metadata to GitHub.

    My 2c is that this is invasive and controversial. It's similar to AI harnesses adding their authorship to commits, which people have varying opinions about. Most of those cases have a way to turn it off as well.

    I'm fine if it's opt-in. The choice is between undisclosed and disclosed use of AI, given that git was always about tracking who did what, I'd say that's not invasive especially since it's transparent and you're able to turn it off. The social cost of not knowing AI was used is much bigger than the alternative. my 2c :)

  6. BagToad commented on Jul 20, 2026

    @BagToad
    Member

    FWIW I'm on board with knowing when AI is used, and I think something like this is an intriguing proposal.

    My point is just that this is invasive when I put on the gh maintainer and designer hat. Users don't like new on-by-default things that alter their output. I think we generally try to avoid it unless it has clear value. Not saying this doesn't have value or anything like that, but I'm just sharing a bit of what we're up against trying to get a feature like this to land.

  7. NorfairKing commented on Jul 21, 2026

    @NorfairKing

    Hard agree on this.
    It's pretty silly right now:

    Image
  8. domenkozar commented on Jul 29, 2026

    @domenkozar
    Author

    Looks like that codex already does this via apps

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedenhancementplatformstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions