How to Install SWE Agent for GitHub Issue Fixing (2026)

Quick answer

To install SWE agent for GitHub issue fixing, clone the official repository, run python -m pip install --upgrade pip && pip install --editable . at the repository root, add your model and GitHub keys, then run sweagent run against one small test issue. The licence fee is $0 under MIT. You still pay for the model you connect and the review time to check every patch.

Quick Answer

To install SWE agent for GitHub issue fixing, clone the official repository, run python -m pip install --upgrade pip && pip install --editable . at the repository root, add your model and GitHub keys, then run sweagent run against one small test issue. The licence fee is $0 under MIT. You still pay for the model you connect and the review time to check every patch.

In this article

  • How we checked this guide
  • Read this first: issue fixer, licence, and project status
  • What SWE-agent replaces, and what it does not
  • How the model, environment, and patch fit together
  • Routes to install SWE-agent
  • Requirements before you install
  • Step 1: clone SWE-agent from source
  • Step 2: install SWE-agent and check the command
  • Step 3: set up Docker and your model keys
  • Step 4: run SWE-agent on one test issue
  • Step 5: inspect, test, and apply the patch
  • First-run security steps you must not skip
  • Backup and update routine
  • Common errors and fixes
  • Tips and tricks that save money
  • The real cost maths
  • When not to install SWE-agent
  • Pros and cons
  • Our verdict
  • FAQ
  • Strategic Pivot
  • Sources

How we checked this guide

We checked this guide on December 4, 2026, against SWE-agent’s official GitHub repository, its source-installation page, its models-and-keys page, its command-line tutorial, and its pyproject.toml. We checked Copilot Business and Enterprise prices on official GitHub Docs.

One status point matters before you install. The README carries a warning that most current development effort is on mini-SWE-agent, which has superseded SWE-agent, matches its performance while being much simpler, and is the team’s general recommendation going forward. That does not make SWE-agent broken. It means you should install SWE-agent when you want its fuller, configurable agent-computer interface and documented issue-fixing workflow, and you should read the verdict before building a long-term daily workflow on it. The repository itself is public and not archived.

Read this first: issue fixer, licence, and project status

SWE-agent official GitHub repository to install swe agent for github issue fixing

SWE-agent takes a GitHub issue and tries to fix it with the language model you choose. You point it at a repository and a problem statement, the model uses tools inside a sandboxed environment to explore the code, edit files, and run commands, and the run ends with a patch you can inspect.

The licence is MIT. GitHub lists the repository licence as MIT License, and the README states the licence plainly. In plain words, the software carries a $0 licence fee for use under MIT terms, including commercial use, with the licence’s notice and warranty conditions. That grant covers SWE-agent itself. It does not cover the model you connect, your provider’s terms, your Docker host, or the quality of any patch the agent produces.

Project status needs a clear eye. SWE-agent is built and maintained by researchers from Princeton University and Stanford University, and its README describes it as configurable, fully documented, and governed by a single YAML file. At the same time, the same README now recommends mini-SWE-agent for most new use. Treat SWE-agent as the richer research-grade system you supervise issue by issue, not as a managed coding seat with a support desk.

SWE-agent fits a technical owner, freelancer, or small team that already works from GitHub issues and wants an agent to attempt a first fix that a human then reviews. It is a poor fit when nobody will read the patch, run the tests, or own API-key and Docker hygiene.

What SWE-agent replaces, and what it does not

SWE-agent replaces the blank-page start of an issue fix. Instead of a developer spending the first hour locating the relevant files and drafting a first change, the agent explores the repository, reproduces the problem where it can, edits code, and hands back a diff.

It can replace part of a per-seat coding subscription when your work is issue-shaped: bug reports with a clear reproduction, small features with a written problem statement, and maintenance tasks where a reviewable patch matters more than inline autocomplete. The agent layer is $0 in licence fees; the model layer is where money moves.

SWE-agent does not replace code review, tests, or judgment. A patch that looks plausible can still break an edge case, edit the wrong file, or solve the reported symptom instead of the cause. Your branch discipline, test suite, and diff review remain the control, and the agent’s confidence does not change that.

It also does not replace a managed platform’s support desk, seat administration, or policy controls. You own the install, the Docker backend, the model keys, the per-issue cost limits, and the decision to apply or discard each patch. The $0 licence removes a seat fee for the agent; it does not remove operations work.

Best for: a small technical team that works from GitHub issues and will review every patch before it lands. Skip if: you need managed seats, vendor support, or patches nobody will test.

How the model, environment, and patch fit together

Think of three layers, and keep them separate when troubleshooting. The model is where reasoning happens. The environment is the sandboxed computer where tools run. The patch is the only output you should trust, and only after review.

SWE-agent supports the models supported by LiteLLM, and its keys page lists claude-sonnet-4-20250514 as the recommended model, with gpt-4o and o1-preview also shown as options. Local models are supported through OpenAI-compatible endpoints, with an Ollama example in the official documentation. Your model choice changes cost, speed, and patch quality more than any other setting, so record it in your runbook.

The default backend is Docker. The agent’s commands run inside a container deployment rather than directly on your host, which is the right default for software that executes model-generated commands. Cloud execution is also documented for readers who do not want local Docker, including a Modal route.

Configuration is governed by YAML. The default config file is config/default.yaml, options can also be passed as command-line arguments, and multiple config files can be combined. That single-file control is useful for a small business because one reviewed config can define the model, the cost limit, and the tools for every run.

For a coding agent that works through a broader task loop, see our OpenHands guide. For prompt-file codebase generation instead of issue fixing, see our GPT Engineer guide. SWE-agent’s difference is the issue-to-patch workflow.

Routes to install SWE-agent

RouteBest forMain requirementWatch out for
Source install with editable pipMost trials and daily useGit, Python 3.11 or newer, Docker for the default backendKeep the checkout and environment pinned so updates do not surprise you
GitHub Codespaces trialBrowser-only first lookA GitHub account with Codespaces accessAPI keys in a cloud workspace need extra care
Cloud execution backendReaders who do not want local DockerA supported cloud deployment setupYour code and keys still need the same review discipline
Local model routePrivacy-first or offline-leaning trialsAn OpenAI-compatible local endpointCost tracking must be disabled or given a custom registry

This guide uses the source route because the official installation page calls installation from source the preferred way to set up SWE-agent. Use the same route for your trial and your runbook so the test matches production.

Requirements before you install

You need Python 3.11 or newer. The project’s pyproject.toml declares requires-python = ">=3.11", and its classifiers list Python 3.11 and 3.12. Check your version before installing, because an older interpreter turns a simple install into a debugging session.

You need Git and a model route. Decide before the first run whether you will use an API model through LiteLLM or a local OpenAI-compatible endpoint, and confirm the key belongs to the account you intend to bill. Private GitHub repositories also need the corresponding GitHub access.

You need Docker for the default backend. The installation page recommends installing Docker and starting it locally, and points readers with Docker problems to its installation tips. If you plan to use the web-based GUI, the same page says to install Node.js.

Decide your test scope before you install. One small repository, one clear issue, and one acceptance check you can run yourself. A vague first test teaches you nothing about whether the agent fits your work.

Step 1: clone SWE-agent from source

Clone the official repository:

git clone https://github.com/SWE-agent/SWE-agent.git
cd SWE-agent

Work from the repository root for every following step. The installation page runs the pip install at the repository root, and the .env option for keys also lives at the repository root, so staying in that folder keeps the setup predictable.

Record the checkout state before you change anything. Note the date and that you installed from the official repository, so a later update can be compared against a known-good starting point.

Keep secrets out of the clone. Your keys belong in environment variables or a .env file that stays out of version control, never in a config file you commit or a screenshot you share.

Step 2: install SWE-agent and check the command

SWE-agent official source installation guide to install swe agent for github issue fixing

At the repository root, run the official install command:

python -m pip install --upgrade pip && pip install --editable .

The installation page recommends conda or a virtual environment to manage dependencies. Use a dedicated environment for SWE-agent so its dependency set does not collide with your other Python work, and activate that environment before every run.

Then run the quick check:

sweagent --help

The command should show an overview of the available top-level commands. If the command is not found, the documentation says to try python -m sweagent, and to check with which python that you are using the same Python as when you installed SWE-agent. Most not-found errors are environment mix-ups, not broken packages.

Do not move on until the help output appears. An install you have not verified is a debugging session waiting to happen during your first real issue.

Step 3: set up Docker and your model keys

SWE-agent official models and keys guide to install swe agent for github issue fixing

Start Docker locally before your first run. The default backend for SWE-agent is Docker, so the agent’s environment depends on it. If Docker is not running, fix that first rather than changing agent settings.

Add your keys in one of the three ways the documentation names: environment variables, a .env file at the repository root, or the --agent.model.api_key option. The documented example covers GITHUB_TOKEN, OPENAI_API_KEY, ANTHROPIC_API_KEY, and TOGETHER_API_KEY. Uncomment only the keys you have actually set.

Protect every key like a password. Never commit .env to Git, never paste a key into a problem statement, and never share a trajectory or screenshot that shows one. If a key leaks into a patch or a repository, rotate it immediately.

Set a per-issue cost limit before your first run. The command-line tutorial’s first example uses --agent.model.per_instance_cost_limit=2.00, which turns an experiment into a bounded cost instead of an open-ended one. For local models, the documentation says cost tracking cannot work the same way, so you disable the cost limit and use a per-instance call limit instead.

Step 4: run SWE-agent on one test issue

Start with the documented shape: a GitHub repository, a GitHub issue as the problem statement, a named model, and a cost limit.

sweagent run \
  --agent.model.name=gpt-4o \
  --agent.model.per_instance_cost_limit=2.00 \
  --env.repo.github_url=https://github.com/SWE-agent/test-repo \
  --problem_statement.github_url=https://github.com/SWE-agent/test-repo/issues/1

Replace the test repository and issue with your own small, real issue once the test run works. Keep the cost limit in place for real work, and record the model name with every run so results stay comparable.

For a local repository instead, the tutorial shows the same pattern with --env.repo.path, a problem statement file with --problem_statement.path, and a Docker image such as python:3.12. Use whichever shape matches where your code actually lives, and keep the problem statement as clear as a good GitHub issue: what fails, how to reproduce it, and what done means.

When the run finishes, do not apply anything yet. The output is a patch and a trajectory, and both need your eyes before they touch a branch you care about.

Step 5: inspect, test, and apply the patch

Read the patch before you run anything. The hello-world documentation shows the finished flow plainly: the patch is saved to your local filesystem, you inspect it, and only then do you apply it to a local repository with git apply.

Work on a branch, never directly on your main line. Apply the patch there, run your own test suite, and read the full diff as if a new hire wrote it. Check for edits to test files, hardcoded secrets, and changes wider than the issue asked for.

Commit only what you can explain. If the patch is wrong, discard the branch and improve the problem statement rather than arguing with the agent. A clearer issue produces a better second attempt than a longer argument with the first one.

Keep the trajectory with the branch record. When a patch surprises you later, the trajectory shows what the agent did, which turns a mystery into a reviewable decision.

First-run security steps you must not skip

Treat the agent’s commands as untrusted commands. SWE-agent exists to let a model use tools and execute actions in an environment, so the Docker backend is a safety boundary, not a formality. Run first trials against a repository with no customer data and no production credentials.

Keep keys out of every file the agent can read as context. Use environment variables or a .env file excluded from Git, and check the patch and trajectory for leaked secrets before committing anything.

Give the GitHub token the least access that works. A token that can read one test repository does not need write access to your whole organization. Least privilege turns a bad run into an inconvenience instead of an incident.

Review dependencies before installing anything a patch suggests. A patch that adds a package is a proposal, not an approval. Install only packages you recognize, from their official sources, at versions you choose.

Read the patch for test-file edits. An agent that changes the tests to pass has not fixed your issue. The default template itself tells the agent not to modify testing logic, and your review should enforce the same line.

Backup and update routine

Your backup unit is the SWE-agent checkout, your config files, and your environment record. Keep your working config in version control without keys, so a result can be reproduced and a bad config change can be rolled back.

Update with the documented routine. The installation page says SWE-agent is still in active development and advises periodically running git pull, with no need to redo the pip install after that pull. After each update, re-run your small test issue before trusting the new version on real work.

Pin what you can. Record the model name, the config file, and the cost limit that produced an accepted patch. An agent whose settings drift between runs cannot be evaluated, and unevaluated agents do not belong near production code.

Back up trajectories for accepted patches. They are the audit trail for why a change was made, and they cost nothing to keep next to the branch record.

Common errors and fixes

The sweagent command is not found. Try python -m sweagent, then check with which python that the active Python is the one you installed into. The documentation names this exact check because environment mix-ups cause most cases.

The run fails before the agent starts. Confirm Docker is installed and running, because Docker is the default backend. If you chose cloud execution instead, confirm that backend is configured rather than half-configured.

The model rejects the request. Confirm the key is set in the same shell that runs sweagent, or that .env sits at the repository root. The keys page also warns that a wrong OPENAI_API_BASE_URL causes 404 errors, and that the line should be deleted or commented out when you are not using it.

A local model run errors on cost tracking. The documentation says the cost calculator cannot find local models in its dictionary. Disable the cost limit, use a per-instance call limit, or provide a custom model registry with cost information.

The patch fixes the symptom, not the cause. Your problem statement was probably too thin. Add the reproduction steps, the expected behavior, and the files you suspect, then run again on a fresh branch. Clear issues produce reviewable patches.

Costs surprise you. Lower the per-instance cost limit, shorten the problem statement, and use a cheaper model route for first attempts. Issue fixing makes repeated model calls, so cost control belongs in setup, not in hindsight.

Tips and tricks that save money

Write issues like contracts. Every ambiguity in a problem statement becomes model calls spent guessing, and usually a second run spent correcting. Ten minutes of issue writing saves real money.

Start with the cheapest model that can do the job. The keys page recommends a specific model, but your first test only needs to prove the workflow. Prove the loop cheaply, then spend on quality where the patch matters.

Use the test repository first. The documented examples run against SWE-agent/test-repo for a reason: a known issue with a known fix proves your install, keys, Docker backend, and patch flow in one run.

Keep one config per job type. A bug-fix config with a tight cost limit and a feature config with a wider one beat a single config you keep editing. Reviewed configs are cheaper than improvised ones.

Apply patches on branches, always. A branch makes every agent run reversible, and reversible runs are the only kind a small business should accept from an autonomous tool.

The real cost maths

GitHub Copilot official billing plans to install swe agent for github issue fixing

SWE-agent’s licence fee is $0 under MIT. Your real costs are the model calls each run makes, the machine running Docker, and the review time for every patch. The comparison that matters is against the per-seat subscription a small team would otherwise buy.

GitHub’s official billing documentation lists Copilot Business at $19 USD per user per month, including 1,900 AI credits per user contributed to a shared pool, with usage beyond the pool billed separately. Copilot Enterprise is $39 USD per user per month with 3,900 AI credits per user.

Take a three-person team. Three Copilot Business seats cost $57 a month, which is $684 a year before any overage beyond the pooled credits. That $57 monthly figure is the break-even line for SWE-agent’s model spend for the same team: keep total model spend under it and the $0 licence wins on cash; spend past it and the managed seats win on cash before counting administration.

Now use the documented per-instance cost limit as a budget ceiling. At a $2.00 cap per issue, twenty capped issues cost at most $40 in model spend, which sits under the $57 seat line with room to spare. Twenty-eight capped issues reach $56, still under the line. The cap is a ceiling, not a prediction: a run that solves an issue early spends less, and a run that hits the cap without a usable patch spends the full amount for nothing. That is why the review habit matters as much as the cap.

The maths flips in three situations. First, when issue volume is high and every run burns its full cap, model spend passes the seat line and the subscription’s pooled credits look better. Second, when nobody reviews patches, the $0 licence buys unreviewed code, which is expensive at any price. Third, when managed seat administration, policy controls, and vendor operations matter more than model choice, the subscription is buying operations you would otherwise staff yourself.

The lean choice is SWE-agent on an existing machine with a tight per-issue cap and a real review habit. The full-stack choice is managed seats for the team plus the agent for issue-shaped work the seats do not cover. Run both through the calculator in the Strategic Pivot before you commit.

When not to install SWE-agent

Skip SWE-agent when nobody will review patches. An autonomous issue fixer without review is a code generator with extra steps, and the risk lands on your customers.

Skip it when your work is not issue-shaped. Inline completion, chat-driven editing, and pair programming are different jobs; our Aider guide covers the terminal pair-programming route, and our Continue guide covers the editor route.

Skip it when Docker and key hygiene cannot be enforced. The agent executes model-driven commands, and a team that cannot keep keys out of repositories cannot run it safely.

Skip it when you want the team’s current recommended tool with the least machinery. The README itself recommends mini-SWE-agent going forward, so a team starting fresh should weigh that recommendation honestly against SWE-agent’s fuller configuration and documentation.

Pros and cons

Pros

  • $0 MIT licence fee for the agent itself
  • Issue-to-patch workflow built for real GitHub repositories
  • Model choice through LiteLLM, including local OpenAI-compatible routes
  • Docker as the default sandboxed backend
  • Single YAML configuration with per-instance cost limits
  • Patches you inspect and apply yourself with git apply

Cons

  • The team now recommends mini-SWE-agent for most new use
  • You own Docker, keys, updates, and patch review
  • Model costs vary by provider and must be checked on official provider pages
  • Weak problem statements produce weak patches
  • No vendor support desk or seat administration is included
  • Source install needs Python 3.11 or newer and Git discipline

Our verdict

Install SWE-agent when your team works from GitHub issues and will actually review what it produces. Clone from source, install into a dedicated environment, keep Docker as the backend, protect your keys, cap the per-issue cost, and prove one small issue end to end before trusting it further.

The maths favors SWE-agent when disciplined issue writing and a tight cost cap keep model spend under the seat equivalent: $0 in licence fees against $684 a year for three Copilot Business seats before overage, with a $57 monthly break-even line for that team. The maths flips when capped runs burn their full budget without usable patches, or when managed seats and vendor operations matter more.

Choose Copilot Business when managed access, pooled credits, and vendor operations matter more. Choose SWE-agent when issue-driven patches, model choice, and local control matter more, and when your review habit is real. Weigh the team’s own mini-SWE-agent recommendation before making SWE-agent a long-term daily driver.

FAQ

Is SWE-agent free for a business?

The software licence fee is $0 under the MIT licence, including commercial use under the licence terms. You still pay for any hosted model provider you choose, the machine running Docker, and the review time to check every patch.

What Python version does SWE-agent need?

The project’s pyproject.toml declares Python 3.11 or newer. Install into a conda or virtual environment, then confirm the setup with sweagent --help.

How do I run SWE-agent on a GitHub issue?

Run sweagent run with a model name, a per-instance cost limit, --env.repo.github_url for the repository, and --problem_statement.github_url for the issue. The run produces a patch you inspect before applying.

Can SWE-agent run with a local model?

Yes. The documentation supports models that serve an OpenAI-compatible endpoint, with an Ollama example. For local models you disable cost tracking or provide a custom registry, and use a per-instance call limit instead.

When should a small business skip SWE-agent?

Skip it when nobody will review patches, Docker and key hygiene cannot be enforced, or managed seats and vendor support matter more than local control. Also weigh the team’s recommendation of mini-SWE-agent for most new use.

Strategic Pivot

Before you commit to any AI coding stack, run your own numbers. Our free AI Cost Calculator helps you compare licence fees, seat costs, and usage spend side by side, so the SWE-agent versus subscription decision rests on your figures, not on a headline price.

Sources

Price note — updated December 4, 2026: Prices in this post were checked on December 4, 2026. When you are reading this, the price may be lower or higher, so check the official pricing page before buying.

Pros

  • $0 MIT licence fee
  • issue-to-patch workflow for real GitHub repositories
  • model choice through LiteLLM including local routes
  • Docker default sandboxed backend
  • single YAML configuration with per-instance cost limits
  • patches inspected and applied by you with git apply

Cons

  • team now recommends mini-SWE-agent for most new use
  • you own Docker, keys, updates, and patch review
  • model costs vary by provider and must be checked on official provider pages
  • weak problem statements produce weak patches
  • no vendor support desk or seat administration is included
  • source install needs Python 3.11 or newer
Our verdict

Install SWE-agent when your team works from GitHub issues and will actually review what it produces. Clone from source, install into a dedicated environment, keep Docker as the backend, protect your keys, cap the per-issue cost, and prove one small issue end to end before trusting it further. The maths favors SWE-agent when disciplined issue writing and a tight cost cap keep model spend under the seat equivalent: $0 in licence fees against $684 a year for three Copilot Business seats before overage, with a $57 monthly break-even line for that team. The maths flips when capped runs burn their full budget without usable patches, or when managed seats and vendor operations matter more. Choose Copilot Business when managed access, pooled credits, and vendor operations matter more. Choose SWE-agent when issue-driven patches, model choice, and local control matter more, and when your review habit is real.

Leave a Comment