Skip to content

Bug: safe-outputs add-comment sanitizer not honoring mentions.allowed-teams #42225

Closed

Description

@ivancea

We added safe-outputs.mentions.allowed-teams to the workflow:

safe-outputs:
  mentions:
    allowed-teams:
      - my-team

The workflow correctly resolved the team during the run: logs show it fetched 31 members and included the person in the allowed mentions. The agent’s raw safeoutputs.jsonl payload also contained an unformatted @ mention of this person.

However the add_comment safe-output handler still posted the comment with @person, so the mention did not notify. The logs suggest the final comment sanitizer only allowed comment/context aliases and did not honor the globally resolved allowed-teams list during add_comment.

A similar thing happened when we tried allow-team-members; it didn't work either

Activity

  1. locked and limited conversation to collaborators on Jun 29, 2026
  2. unlocked this conversation on Jun 29, 2026
  3. pelikhan commented on Jun 29, 2026

    @pelikhan
    Collaborator

    Could you run the debug.md agent to generate an anonymized bug report?

  4. ivancea commented on Jun 29, 2026

    @ivancea
    Author

    Anonymized report:

    • Workflow config included safe-outputs.mentions.allowed-teams with one allowed team.
    • The safeoutputs runtime parsed it correctly as mentions.allowedTeams: ["<org>/<team>"].
    • The workflow correctly fetched the members of that team.
    • The mentioned user was present in the fetched team-member set / allowed mentions set.
    • The agent’s raw add_comment safe-output payload contained a bare @<allowed-login> mention.
    • The final posted GitHub comment converted that mention to inline code: `@<allowed-login>`.
    • Because of that conversion, GitHub did not send a notification.

    Expected behavior

    If <allowed-login> is a member of a configured mentions.allowed-teams team, add_comment should preserve the bare @<allowed-login> mention.

    Actual behavior

    add_comment accepted the payload, but final comment sanitization still escaped the allowed mention.

    Most likely cause

    The team-member resolution path works, but the final add_comment apply-time sanitizer does not use the resolved allowed-team login set when deciding whether to preserve mentions.

    Versions / related runtime info

    • gh-aw actions/setup: v0.80.9
    • compile-agentic check: v0.80.9
    • safeoutputs MCP server: 1.0.0
    • MCP gateway / awmg GitHub server: v0.3.27
  5. locked and limited conversation to collaborators on Jun 29, 2026
  6. unlocked this conversation on Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions