Setup Guide Beginner

This guide walks you through enabling GitHub Copilot Coding Agent for your organization, configuring your repositories, setting up the environment file, and running your first autonomous task assignment.

Prerequisites

Before you can use the Coding Agent, make sure you have the following in place:

Requirement Details
GitHub Plan Copilot Enterprise or Copilot Business subscription is required. The Coding Agent is not available on free or individual plans.
Organization Access You need organization owner or admin permissions to enable the Coding Agent feature.
Repository Access The repository must be part of the organization with Copilot enabled. Both public and private repositories are supported.
GitHub Actions GitHub Actions must be enabled for the repository, as the agent uses Actions for CI validation.
Note: If your organization does not yet have a Copilot Enterprise or Business subscription, you will need to set one up first. Visit github.com/features/copilot for plan details and pricing.

Enabling Copilot Coding Agent for Your Organization

Follow these steps to enable the Coding Agent at the organization level:

  1. Navigate to Organization Settings

    Go to your organization's GitHub page, click Settings in the top navigation bar.

  2. Open Copilot Settings

    In the left sidebar, click Copilot, then select Policies from the submenu.

  3. Enable the Coding Agent

    Find the "Copilot Coding Agent" section and toggle it to Enabled. You can choose to enable it for all repositories or select specific ones.

  4. Configure Permissions

    Set which members of the organization can assign issues to Copilot. Options include all members, specific teams, or only organization owners.

  5. Save Changes

    Click Save to apply the settings. The Coding Agent will be available in the selected repositories within a few minutes.

Organization Settings Path
github.com/orgs/{your-org}/settings/copilot/policies

# Look for:
# Copilot Coding Agent → Enabled
# Allowed repositories → All / Selected
# Allowed members → All / Specific teams

Repository Configuration

Each repository needs some basic configuration for the Coding Agent to work effectively:

  1. Enable Copilot for the repository

    Go to the repository's Settings → Copilot and ensure Copilot access is enabled.

  2. Ensure GitHub Actions is active

    The agent relies on GitHub Actions to run tests and validate its changes. Check Settings → Actions → General and confirm Actions are allowed.

  3. Set up branch protection (recommended)

    Configure branch protection rules on your default branch to require PR reviews and passing status checks before merging. This ensures agent-generated PRs go through the same quality gates as human PRs.

Setting Up copilot-setup-steps.yml

The copilot-setup-steps.yml file tells the Coding Agent how to set up the development environment. It is a GitHub Actions workflow file that runs before the agent starts working on code. Place it in the .github/ directory of your repository.

.github/copilot-setup-steps.yml
name: "Copilot Setup Steps"

on: workflow_dispatch

jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Build project
        run: npm run build
Tip: The setup steps file should mirror your project's actual build process. If the agent cannot build your project, it won't be able to validate its changes. Include all necessary setup: language runtimes, package managers, database seeds, environment variables, and build commands.

Here is an example for a Python project:

.github/copilot-setup-steps.yml (Python)
name: "Copilot Setup Steps"

on: workflow_dispatch

jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.12'
          cache: 'pip'

      - name: Install dependencies
        run: |
          pip install -r requirements.txt
          pip install -r requirements-dev.txt

      - name: Run migrations
        run: python manage.py migrate --settings=config.test

Configuring Allowed Tools and Permissions

You can control which tools and actions the Coding Agent is allowed to use within your repository:

Permission Default Description
File read/write Enabled Allows the agent to read and modify files in the repository
Shell commands Enabled Allows running build, test, and lint commands
Git operations Enabled Allows creating branches, commits, and pull requests
Network access Restricted Firewalled by default; only GitHub and configured package registries are accessible
Secrets access Disabled Repository secrets are not exposed to the agent by default; must be explicitly allowed
Security Note: Be cautious when granting the agent access to secrets or expanding network access. The agent runs in a sandboxed environment for safety. Only add exceptions when strictly necessary, and always review the agent's changes carefully before merging.

Setting Up CI/CD Integration

The Coding Agent validates its changes by running your CI pipeline. For best results, ensure your CI workflow is configured to run on pull requests:

.github/workflows/ci.yml
name: CI

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm ci
      - run: npm test
      - run: npm run lint
Tip: The more comprehensive your CI pipeline, the more confident the agent can be in its changes. Include unit tests, integration tests, linting, and type checking in your CI workflow.

Testing Your First Assignment

Now that everything is configured, let's test the setup with a simple task:

  1. Create a simple issue

    Create a new issue with a well-defined, low-risk task. For example: "Add a getVersion() function to src/utils.ts that returns the version from package.json."

  2. Assign it to Copilot

    In the issue's right sidebar, click Assignees and select Copilot from the list. Alternatively, comment @copilot on the issue.

  3. Monitor progress

    Watch the issue for status updates. The agent will post comments showing its progress: reading the codebase, making changes, running tests.

  4. Review the pull request

    Once the agent finishes, it will open a PR linked to the issue. Review the code changes, run additional checks if needed, and provide feedback.

  5. Iterate or merge

    If the changes look good, approve and merge. If you need adjustments, leave review comments and the agent will attempt to address them.

Try It Yourself

Pick a small, well-defined task in one of your repositories and assign it to Copilot. Start with something simple like adding a utility function, fixing a typo, or adding a missing test case. This will help you validate your setup and understand the agent's workflow.