Skip to content

mandatory authorization check to prevent external contributors from triggering AI agent#23

Merged
derekmisler merged 2 commits intodocker:mainfrom
derekmisler:only-allow-actions-run-by-owner-member-or-c
Feb 3, 2026
Merged

mandatory authorization check to prevent external contributors from triggering AI agent#23
derekmisler merged 2 commits intodocker:mainfrom
derekmisler:only-allow-actions-run-by-owner-member-or-c

Conversation

@derekmisler
Copy link
Copy Markdown
Contributor

@derekmisler derekmisler commented Feb 2, 2026

Summary

Add mandatory authorization check for comment-triggered events to prevent external contributors from abusing AI agent commands.

Changes

  • action.yml: Add authorization check step for comment-triggered events

    • Validates author_association when triggered by comments (e.g., /review)
    • Only allows OWNER, MEMBER, COLLABORATOR roles
    • Blocks CONTRIBUTOR, FIRST_TIME_CONTRIBUTOR, NONE, and other external roles
    • Skips for non-comment events (PR triggers, scheduled jobs, workflow_dispatch)
  • security/README.md: Update documentation

    • Add authorization as the first security feature
    • Update architecture diagram to show auth check as first step
    • Document scope of auth check (comment events only)

Security Rationale

Comment-triggered workflows (like /review commands) are the main abuse vector:

  • External contributors could spam expensive AI operations
  • Potential for prompt injection via crafted comments

PR-triggered and scheduled workflows are controlled by the workflow author, so auth is not enforced.

How It Works

Trigger Auth Check Result for External User
/review comment ✅ Enforced ❌ Blocked
pull_request event ⏭️ Skipped ✅ Allowed (workflow controls this)
workflow_dispatch ⏭️ Skipped ✅ Allowed
Scheduled job ⏭️ Skipped ✅ Allowed

Backward Compatibility

  • Comment-triggered workflows: External contributors will now be blocked
  • PR-triggered workflows: No change, works as before
  • Scheduled/dispatch workflows: No change, works as before

@derekmisler derekmisler self-assigned this Feb 2, 2026
@derekmisler derekmisler force-pushed the only-allow-actions-run-by-owner-member-or-c branch from 7db82be to 7f4b0ce Compare February 2, 2026 18:27
@derekmisler derekmisler marked this pull request as ready for review February 2, 2026 18:28
@derekmisler derekmisler requested a review from a team as a code owner February 2, 2026 18:28
@derekmisler
Copy link
Copy Markdown
Contributor Author

/describe

@derekmisler derekmisler merged commit f8a84b0 into docker:main Feb 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants