Configuring Sweep to resolve bug fixes and open pull requests directly from GitHub issues requires two operational layers: installing the Sweep GitHub App for repository access and committing a sweep.yaml configuration file to the repository root. When configured properly, Sweep indexes your codebase, reads issue descriptions, drafts an execution plan, modifies files on an isolated branch, and opens a fully formed PR.
At 365Finds, we favor Sweep's asynchronous GitHub-native model over synchronous in-IDE autocomplete bots. Instead of interrupting a developer's concentration while typing, Sweep operates in the background on discrete tasks. However, Sweep is only as reliable as the guardrails you enforce. Left unconfigured, it can hallucinate file locations, introduce style violations, or spam repository maintainers with untested code changes.
Here is the step-by-step configuration workflow and the operational parameters 365Finds recommends for production teams.
1. Install and Authorize the Sweep GitHub App
Sweep interacts with your code directly through GitHub's API and Webhook infrastructure.
- Navigate to sweep.dev or the GitHub Marketplace and select Install Sweep.
- Select your GitHub organization or personal account.
- Choose repository permissions: 365Finds advises granting access only to specific target repositories rather than your entire GitHub organization.
- Confirm repository permissions: Sweep requires read/write permissions for issues, pull requests, repository contents, and GitHub Actions workflows.
Once installed, Sweep triggers an initial indexing run. It parses the repository's abstract syntax tree (AST), generates vector embeddings across the codebase, and maps module dependencies so it can locate files based on natural-language issue tickets.
2. Create the sweep.yaml Configuration File
The behavior of the Sweep agent is governed by sweep.yaml, which must reside in the root directory of your repository's default branch.
Below is a production-grade sweep.yaml template tested for modern software repositories:
# sweep.yaml - Configuration for Sweep AI Developer
branch: "main"
draft: false
gha_enabled: true
# Protect sensitive systems and core architectural files from modification
blocked_dirs:
- "infra/terraform"
- "src/auth/crypto"
- "migrations/"
- ".github/workflows"
# High-level architecture context for codebase navigation
description: |
This repository is a TypeScript and Node.js backend using Express and Prisma ORM.
All API routing is located in src/api/, and database models live in prisma/schema.prisma.
We use Jest for unit testing and ESLint/Prettier for formatting.
# Strict coding and testing constraints Sweep must follow
rules:
- "Always add TypeScript type annotations to function parameters and return values; never use 'any'."
- "Never use console.log in production code; use our structured logger from 'src/utils/logger.ts'."
- "All bug fixes must include a corresponding unit test reproducing the issue in the same directory."
- "Do not alter database migration files or existing Prisma schemas."
- "Keep commits atomic and follow Conventional Commits formatting (e.g., 'fix: handle null token')."
# Optional isolated sandbox commands executed before opening a PR
sandbox:
install:
- "npm ci"
check:
- "npx prettier --check {file_path}"
- "npx eslint {file_path}"
- "npm test"
Key Parameters Explained
branch: Defines the target base branch for pull requests (typicallymainordevelop).draft: Set totrueif your team requires all automated PRs to open in draft mode before triggering notifications for human reviewers.gha_enabled: When set totrue, Sweep monitors CI failures reported by GitHub Actions. If a test fails on its generated branch, Sweep reads the CI logs, analyzes the traceback, and pushes follow-up commits to self-heal the pull request. 365Finds considersgha_enabled: truenon-negotiable for unattended bug fixing.blocked_dirs: An explicit blacklist of directory paths and file patterns that Sweep is barred from reading or modifying. Use this to protect secrets, infrastructure-as-code manifests, and database migrations.description: Natural language context describing architectural hierarchy, primary frameworks, and package structures. This prevents Sweep from guessing where endpoint handlers or models live.rules: A prioritized list of deterministic constraints. Sweep includes these rules in every internal prompt generation step.sandbox: An optional execution container setup where Sweep runs installation (install) and verification (check) commands directly against modified files ({file_path}) before submitting the PR.
3. Triggering Bug Fixes from GitHub Issues
Once the app is authorized and sweep.yaml is merged, you can trigger Sweep using any of three GitHub issue patterns:
- Title Prefix: Create an issue starting with
Sweep:, for example:Sweep: Fix unhandled null pointer in UserProfile avatar parser - Body Mention: Mention
@sweepinside the issue description:@sweep Please resolve the off-by-one error when pagination reaches the final page. - Issue Labeling: Apply the
sweeplabel to an existing ticket.
Writing Issues That Sweep Can Actually Solve
Sweep operates by matching natural-language tickets against repository embeddings. Vague issues produce broken PRs. 365Finds has found that high-yield bug reports must contain three elements:
- Direct Error Signals: Include the complete stack trace or terminal error output.
- File Pointers: If known, specify the likely culprit file (e.g.,
src/auth/jwt.ts). - Explicit Acceptance Criteria: State what input causes the failure and what the expected return value should be.
4. Reviewing and Iterating on Sweep Pull Requests
When an issue is triggered, Sweep performs a multi-step sequence:
- Comments on the issue outlining its proposed plan and list of files to inspect.
- Checks out a new branch prefixed with
sweep/. - Writes code changes and optional tests.
- Runs sandbox checks or awaits GitHub Actions test results.
- Opens a pull request referencing the original issue (
Closes #123).
If the generated PR requires adjustments, you do not need to pull the code locally. Comment directly on the PR or highlight specific lines in the GitHub diff and write:
@sweep Refactor this check using optional chaining and add a test case for undefined tokens.
Sweep will re-read the context, apply changes to the branch, and commit the update directly to the existing PR.
5. 365Finds Assessment: Capabilities and Boundaries
At 365Finds, our testing demonstrates that Sweep handles well-isolated tasks with minimal intervention:
- Resolving null reference errors, boundary conditions, and missing validation checks.
- Writing unit tests for uncovered functions.
- Updating deprecated library calls across single-module codebases.
Where Sweep consistently struggles is architectural ambiguity. It cannot redesign multi-service transaction flows, resolve database lock contention, or diagnose bugs caused by external microservice dependencies without explicit logs. If you assign it an ambiguous issue like "Fix checkout flakiness," Sweep will often patch random frontend state variables while ignoring root backend causes.
For teams implementing Sweep, 365Finds recommends starting with low-severity bug backlogs, locking down all critical directories via blocked_dirs, and maintaining mandatory human reviews for all merged PRs. Sweep currently offers both self-hosted Docker options and hosted plans starting at around $20 per month for individual developers, scaling into team seats with pooled credit allocations.