GitHub Action that brings AgentScan's automation pattern detection into your CI pipeline.
See the codeGitHub action that analyzes PR and issue authors' recent activity patterns to detect automation signals.
Create a workflow file in your repository (e.g., .github/workflows/agentscan.yml):
name: AgentScan
on:
pull_request_target:
types:
- opened
- reopened
issues:
types:
- opened
jobs:
agentscan:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
contents: read
steps:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
The action will run automatically on new and reopened pull requests, and on newly opened issues, analyzing the author's activity patterns to detect automation signals.
${{ github.token }})collaborator, contributor, first_timer, first_time_contributor, member, owner)true)false)full (comment and labels), labels (labels only), comment (comment only), or silent (outputs only) (default: full)false).agentscan-cache). When provided, analysis results are cached and reused within the TTL periodagentscan:community-flagged)agentscan:mixed-signals)agentscan:automated-account)false)automation)false)A machine-readable reference for these inputs (types, enums, defaults) is available at agentscan-action-v2.json.
To skip specific team members from being scanned, add their usernames to the allowed-users input:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
allowed-users: "dependabot,renovate,my-trusted-bot"
Members in the allowed-users list will be excluded from analysis without any PR comment or labels added. Known CI/CD bot accounts (e.g. dependabot, renovate, github-actions[bot]) are always skipped automatically, regardless of this list.
To skip analysis based on the author's relationship to the repository, set trusted-author-associations:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
trusted-author-associations: "member,owner,collaborator"
Use scan-pull-requests and scan-issues to control which event types are analyzed. scan-issues defaults to false:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
scan-pull-requests: true
scan-issues: true
To enable caching and avoid redundant API calls, use actions/cache@v5 and pass the cache path to the action:
steps:
- name: Cache AgentScan analysis
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
with:
path: .agentscan-cache
key: agentscan-cache-${{ github.actor }}
restore-keys: agentscan-cache-
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
cache-path: ".agentscan-cache"
How caching works:
actions/cache with a path and unique keycache-path inputactions/cache persists the directory between workflow runsCache Invalidation: Cached entries automatically expire after 2 days.
By default, the action skips posting a PR or issue comment when the analysis result is "organic" (clean, human-like activity). To always comment, enable comment-on-organic:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
comment-on-organic: true
The action always outputs all analysis data (for downstream steps to use) regardless of this setting.
To customize labels added to PRs and issues, set any of the label inputs:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
label-community-flagged: "security:community-flagged"
label-mixed: "needs-review:automation-signals"
label-automation: "blocked:automated-account"
Control what AgentScan does with its findings via mode:
full (default): post a comment and add labelslabels: add labels onlycomment: post a comment onlysilent: neither — only use the action's outputs in downstream steps- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
mode: silent
The activity analysis looks at a contributor's past. The honeypot looks at what happens right here: AgentScan posts an ordinary-looking greeting whose hidden part asks any automated reader to reply with a verification code and nothing else. A human never sees that instruction — it lives in an HTML comment. An agent drafting the next reply does, and follows it.
If the author's next comment contains the code, AgentScan reports it, labels the
thread, and closes it when auto-close is on.
It needs the workflow to also run on issue_comment, so the reply can be seen:
on:
pull_request_target:
types:
- opened
- reopened
issues:
types:
- opened
issue_comment:
types:
- created
jobs:
agentscan:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
contents: read
steps:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
honeypot: true
Notes:
GITHUB_TOKEN (or a GitHub App token). The bait is only
trusted back when a bot posted it, which is what stops a third party from
planting a code and having someone else's PR closed.mode does not apply to the bait itself: it is a comment, and there is no
honeypot without one. It does apply to what happens after the trap is sprung.Replace the greeting with your own if the default doesn't sound like your
project. {username} and {type} (pull request or issue) are substituted:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
honeypot: true
message-honeypot: "Thanks for the {type}, @{username}! A maintainer will review it shortly."
message-honeypot-first-time: "Welcome, @{username} — great to have your first {type} here!"
The honeypot-triggered output tells downstream steps whether the author took
the bait.
Stay safe out there, fellow human, and use AI responsibly.
TypeScript
100.0%
GitHub Action that brings AgentScan's automation pattern detection into your CI pipeline.
See the codeGitHub action that analyzes PR and issue authors' recent activity patterns to detect automation signals.
Create a workflow file in your repository (e.g., .github/workflows/agentscan.yml):
name: AgentScan
on:
pull_request_target:
types:
- opened
- reopened
issues:
types:
- opened
jobs:
agentscan:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
contents: read
steps:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
The action will run automatically on new and reopened pull requests, and on newly opened issues, analyzing the author's activity patterns to detect automation signals.
${{ github.token }})collaborator, contributor, first_timer, first_time_contributor, member, owner)true)false)full (comment and labels), labels (labels only), comment (comment only), or silent (outputs only) (default: full)false).agentscan-cache). When provided, analysis results are cached and reused within the TTL periodagentscan:community-flagged)agentscan:mixed-signals)agentscan:automated-account)false)automation)false)A machine-readable reference for these inputs (types, enums, defaults) is available at agentscan-action-v2.json.
To skip specific team members from being scanned, add their usernames to the allowed-users input:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
allowed-users: "dependabot,renovate,my-trusted-bot"
Members in the allowed-users list will be excluded from analysis without any PR comment or labels added. Known CI/CD bot accounts (e.g. dependabot, renovate, github-actions[bot]) are always skipped automatically, regardless of this list.
To skip analysis based on the author's relationship to the repository, set trusted-author-associations:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
trusted-author-associations: "member,owner,collaborator"
Use scan-pull-requests and scan-issues to control which event types are analyzed. scan-issues defaults to false:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
scan-pull-requests: true
scan-issues: true
To enable caching and avoid redundant API calls, use actions/cache@v5 and pass the cache path to the action:
steps:
- name: Cache AgentScan analysis
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
with:
path: .agentscan-cache
key: agentscan-cache-${{ github.actor }}
restore-keys: agentscan-cache-
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
cache-path: ".agentscan-cache"
How caching works:
actions/cache with a path and unique keycache-path inputactions/cache persists the directory between workflow runsCache Invalidation: Cached entries automatically expire after 2 days.
By default, the action skips posting a PR or issue comment when the analysis result is "organic" (clean, human-like activity). To always comment, enable comment-on-organic:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
comment-on-organic: true
The action always outputs all analysis data (for downstream steps to use) regardless of this setting.
To customize labels added to PRs and issues, set any of the label inputs:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
label-community-flagged: "security:community-flagged"
label-mixed: "needs-review:automation-signals"
label-automation: "blocked:automated-account"
Control what AgentScan does with its findings via mode:
full (default): post a comment and add labelslabels: add labels onlycomment: post a comment onlysilent: neither — only use the action's outputs in downstream steps- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
mode: silent
The activity analysis looks at a contributor's past. The honeypot looks at what happens right here: AgentScan posts an ordinary-looking greeting whose hidden part asks any automated reader to reply with a verification code and nothing else. A human never sees that instruction — it lives in an HTML comment. An agent drafting the next reply does, and follows it.
If the author's next comment contains the code, AgentScan reports it, labels the
thread, and closes it when auto-close is on.
It needs the workflow to also run on issue_comment, so the reply can be seen:
on:
pull_request_target:
types:
- opened
- reopened
issues:
types:
- opened
issue_comment:
types:
- created
jobs:
agentscan:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
contents: read
steps:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
honeypot: true
Notes:
GITHUB_TOKEN (or a GitHub App token). The bait is only
trusted back when a bot posted it, which is what stops a third party from
planting a code and having someone else's PR closed.mode does not apply to the bait itself: it is a comment, and there is no
honeypot without one. It does apply to what happens after the trap is sprung.Replace the greeting with your own if the default doesn't sound like your
project. {username} and {type} (pull request or issue) are substituted:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e
with:
honeypot: true
message-honeypot: "Thanks for the {type}, @{username}! A maintainer will review it shortly."
message-honeypot-first-time: "Welcome, @{username} — great to have your first {type} here!"
The honeypot-triggered output tells downstream steps whether the author took
the bait.
Stay safe out there, fellow human, and use AI responsibly.
TypeScript
100.0%