Netlify Agent Runners

Start Netlify Agent Runners agent runs from GitHub issues and pull requests. Just mention @netlify and the selected agent builds your site.

- uses: netlify-labs/agent-runner-action@v1
  with:
    netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
    netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}

Setup

1

Install the GitHub App

Install netlify-coding on your repository. This lets the agent create commits and pull requests.

2

Create a Netlify site

Link your repo to a Netlify site. Note the Site ID from Site configuration > General.

netlify init
3

Add repository secrets

Go to Settings > Secrets and variables > Actions and add:

SecretDescription
NETLIFY_AUTH_TOKENYour Netlify personal access token
NETLIFY_SITE_IDYour Netlify site ID
4

Add the workflow

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

Usage

From an issue

Create an issue with @netlify in the body:

@netlify Build a landing page for a coffee shop with a menu and contact form

Choose an agent

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.

Follow-up prompts

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.

Execution modes

dry-run and preflight-only are different controls:

- 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

Typo-tolerant

Common typos are recognized: @nelify, @netlfy, @netify, @netlif, @netfly. Aliases like @netlify-agent and @netlify-ai also work.

Inputs

InputRequiredDefaultDescription
netlify-auth-tokenYesNetlify personal access token
netlify-site-idYesNetlify site ID
github-tokenNogithub.tokenGitHub token for API calls
allowed-usersNo''Comma-separated usernames allowed to trigger
default-agentNocodexDefault agent (claude, codex, gemini)
default-modelNocodexBackward-compatible alias for default-agent
manage-labelsNofalseAuto-create and apply labels on runs
dry-runNofalseStart an agent run but skip commit/PR creation
preflight-onlyNofalseValidate setup and exit without creating/resuming an agent run
timeout-minutesNo10Max minutes to wait for agent
netlify-cli-versionNo24.8.1Netlify CLI version to install
debugNofalseEnable debug API logging
timezoneNoAmerica/Los_AngelesTimezone used for date/time rendering in comments

Outputs

Use these in subsequent workflow steps for custom automation:

OutputDescription
agent-idAgent run ID
outcomesuccess, failure, or timeout
agent-resultAgent result summary text
agent-pr-urlPull request URL (if created)
agent-deploy-urlDeploy preview URL
agentAgent that was used
modelBackward-compatible alias for agent
trigger-textCleaned trigger prompt
is-prtrue / false
issue-numberIssue or PR number
is-dry-runWhether the run used preview mode (true / false)
preflight-okWhether preflight validation passed (true / false)
preflight-jsonSerialized preflight result payload (ok, checks, warnings, failures)
preflight-summaryHuman-readable preflight status summary
should-continueWhether execution should continue into agent runtime
failure-categoryPreflight/runtime taxonomy category when available
failure-stagePreflight/runtime failure stage when available
agent-errorSanitized runtime error summary emitted by agent orchestration

Example: run tests after agent

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 }}"

How it Works

  1. You mention @netlify in an issue, PR, or comment
  2. The action reacts with eyes emoji and posts an in-progress status comment
  3. It creates an agent run with your prompt
  4. The selected agent builds or modifies your site
  5. On completion, the action posts a full result comment, then updates the status comment with a short summary and a link to that result
  6. If triggered from an issue, a pull request is automatically created with the changes

Comments

Security

Troubleshooting

Missing NETLIFY_AUTH_TOKEN or NETLIFY_SITE_ID

Go 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.

Preflight-only failed checks

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 project can't be found"

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.

Agent timed out

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.

"dry-run" still contacted Netlify

This is expected. dry-run skips commit and PR creation only. Use preflight-only: 'true' when you need validation with no agent run.

"Requested agent is not available"

The selected agent is temporarily unavailable. Try a different agent: @netlify claude, @netlify codex, or @netlify gemini.

Bot triggered the workflow

Add a job-level if: guard to skip bot senders. The example workflow includes this by default. See the setup section.

Node.js 20 deprecation warning

Update the action dependencies in action.yml to their latest versions (v5/v6/v8). The published action already uses Node 24-compatible versions.