Start Netlify Agent Runners agent runs from GitHub issues and pull requests. Just mention @netlify and the selected agent builds your site.
Install netlify-coding on your repository. This lets the agent create commits and pull requests.
Link your repo to a Netlify site. Note the Site ID from Site configuration > General.
netlify init
Go to Settings > Secrets and variables > Actions and add:
| Secret | Description |
|---|---|
NETLIFY_AUTH_TOKEN | Your Netlify personal access token |
NETLIFY_SITE_ID | Your Netlify site ID |
Create .github/workflows/netlify-agents.yml:
name: Netlify Agent Runners
on:
workflow_dispatch:
inputs:
trigger_text:
description: 'Prompt for the agent run'
required: true
type: string
default: '@netlify'
actor:
description: 'Actor triggering the agent'
required: true
type: string
agent:
description: 'Agent to use (claude, codex, gemini)'
required: false
type: string
default: 'codex'
pull_request_target:
types: [opened, synchronize, reopened]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted, edited]
issues:
types: [opened, assigned, edited]
issue_comment:
types: [created, edited]
concurrency:
group: netlify-${{ github.repository }}-${{ github.event.pull_request.number || github.event.issue.number || github.run_id }}
cancel-in-progress: false
jobs:
netlify-agent:
# Skip bot senders early to avoid burning Actions minutes
if: >-
github.event_name == 'workflow_dispatch' ||
(
github.event.sender.login != 'github-actions[bot]' &&
github.event.sender.login != 'netlify-coding[bot]' &&
github.event.sender.login != 'netlify[bot]'
)
runs-on: ubuntu-latest
timeout-minutes: 25
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: netlify-labs/agent-runner-action@v1
with:
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
# preflight-only: 'false' # Validate setup and skip agent execution
Create an issue with @netlify in the body:
@netlify Build a landing page for a coffee shop with a menu and contact form
Specify claude, codex, or gemini after @netlify:
@netlify claude Add a dark mode toggle
@netlify codex Make the hero section responsive
@netlify gemini Add a testimonials carousel
Default agent is codex. You can change the default with the default-agent input.
After the first run creates a PR, add follow-up @netlify comments on the PR to iterate. The agent continues from where it left off.
dry-run and preflight-only are different controls:
dry-run: 'true' still starts an agent run, but skips commit and PR creation.preflight-only: 'true' validates setup and exits before any agent run is created or resumed.true, preflight-only behavior wins and no agent run starts.- uses: netlify-labs/agent-runner-action@v1
with:
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
preflight-only: 'true' # setup validation only
- uses: netlify-labs/agent-runner-action@v1
with:
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
dry-run: 'true' # run agent preview, skip commits/PR
Common typos are recognized: @nelify, @netlfy, @netify, @netlif, @netfly. Aliases like @netlify-agent and @netlify-ai also work.
| Input | Required | Default | Description |
|---|---|---|---|
netlify-auth-token | Yes | — | Netlify personal access token |
netlify-site-id | Yes | — | Netlify site ID |
github-token | No | github.token | GitHub token for API calls |
allowed-users | No | '' | Comma-separated usernames allowed to trigger |
default-agent | No | codex | Default agent (claude, codex, gemini) |
default-model | No | codex | Backward-compatible alias for default-agent |
manage-labels | No | false | Auto-create and apply labels on runs |
dry-run | No | false | Start an agent run but skip commit/PR creation |
preflight-only | No | false | Validate setup and exit without creating/resuming an agent run |
timeout-minutes | No | 10 | Max minutes to wait for agent |
netlify-cli-version | No | 24.8.1 | Netlify CLI version to install |
debug | No | false | Enable debug API logging |
timezone | No | America/Los_Angeles | Timezone used for date/time rendering in comments |
Use these in subsequent workflow steps for custom automation:
| Output | Description |
|---|---|
agent-id | Agent run ID |
outcome | success, failure, or timeout |
agent-result | Agent result summary text |
agent-pr-url | Pull request URL (if created) |
agent-deploy-url | Deploy preview URL |
agent | Agent that was used |
model | Backward-compatible alias for agent |
trigger-text | Cleaned trigger prompt |
is-pr | true / false |
issue-number | Issue or PR number |
is-dry-run | Whether the run used preview mode (true / false) |
preflight-ok | Whether preflight validation passed (true / false) |
preflight-json | Serialized preflight result payload (ok, checks, warnings, failures) |
preflight-summary | Human-readable preflight status summary |
should-continue | Whether execution should continue into agent runtime |
failure-category | Preflight/runtime taxonomy category when available |
failure-stage | Preflight/runtime failure stage when available |
agent-error | Sanitized runtime error summary emitted by agent orchestration |
steps:
- uses: netlify-labs/agent-runner-action@v1
id: agent
with:
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
- name: Run tests on agent PR
if: steps.agent.outputs.outcome == 'success'
run: echo "PR created at ${{ steps.agent.outputs.agent-pr-url }}"
@netlify in an issue, PR, or commentallowed-users input can further restrict accessGo to Settings > Secrets in your repo and add both secrets. Create a token here. Find your Site ID in the Netlify dashboard under Site configuration > General.
Use preflight-summary and preflight-json outputs to identify failing checks. Common fixes: token/site ID mismatch, invalid default agent, non-positive timeout, or missing workflow permissions.
The NETLIFY_SITE_ID secret points to a site that doesn't exist or that your token can't access. Verify the site ID in the Netlify dashboard and regenerate your token if needed.
The default timeout is 10 minutes. For complex prompts, increase it with timeout-minutes: '15'. You can also break large tasks into smaller follow-up prompts.
This is expected. dry-run skips commit and PR creation only. Use preflight-only: 'true' when you need validation with no agent run.
The selected agent is temporarily unavailable. Try a different agent: @netlify claude, @netlify codex, or @netlify gemini.
Add a job-level if: guard to skip bot senders. The example workflow includes this by default. See the setup section.
Update the action dependencies in action.yml to their latest versions (v5/v6/v8). The published action already uses Node 24-compatible versions.