Master SWE-agent with our step-by-step tutorial, detailed feature walkthrough, and expert tips.
Install SWE
agent via pip: run 'pip install sweagent' in a Python
9+ environment with Docker installed and running Configure your LLM API key by setting the appropriate environment variable (e.g., OPENAI_API_KEY or ANTHROPIC_API_KEY) or add it to the YAML config file Run your first issue fix: execute 'sweagent run
agent.model.name=gpt
env.repo.github_url=https://github.com/OWNER/REPO
problem_statement.github_url=https://github.com/OWNER/REPO/issues/NUMBER' Review the generated patch in the output directory and apply it to your repository with git apply Explore mini
agent at https://github.com/SWE
agent for a simplified 100
line alternative
💡 Quick Start: Follow these 9 steps in order to get up and running with SWE-agent quickly.
Explore the key features that make SWE-agent powerful for coding agents workflows.
SWE-agent is an open-source autonomous coding agent created by researchers at Princeton University and Stanford University. It was introduced in a NeurIPS 2024 paper and takes a GitHub issue as input, then uses an LLM to navigate the repository, edit files, and run tests to propose a fix. The same system, configured as EnIGMA, can also tackle offensive cybersecurity challenges.
SWE-agent is model-agnostic. It officially supports GPT-4o and other OpenAI models, Anthropic's Claude family (including Sonnet and Opus), DeepSeek, and any OpenAI-compatible endpoint — which means you can point it at local models served via Ollama, vLLM, or LM Studio. Model selection is handled in the agent config file.
Yes. The SWE-agent codebase is fully open-source under the MIT license and free to self-host. The only costs are the LLM API fees you incur when using commercial models like GPT-4o or Claude; running it with a local model is free apart from compute.
Devin is a closed, hosted autonomous agent with a managed UI and subscription pricing; Cursor is an interactive IDE with AI assistance. SWE-agent is an open-source, self-hostable agent framework focused on autonomously resolving issues end-to-end. It is research-grade software — you bring your own model and infrastructure, and you get full transparency into the agent's prompts, tools, and trajectories.
SWE-agent executes all commands inside Docker containers via its SWE-ReX runtime, which isolates file and network access from the host. For additional safety on private repos, you can use ephemeral sandboxes on Modal or AWS, and you should always review generated patches before merging — especially for long autonomous runs.
Now that you know how to use SWE-agent, it's time to put this knowledge into practice.
Sign up and follow the tutorial steps
Check pros, cons, and user feedback
See how it stacks against alternatives
Follow our tutorial and master this powerful coding agents tool in minutes.
Tutorial updated March 2026