SWE-agent: safety, run options and how to run it
How SWE-agent runs in Docker, what its flags can do to your repo, where trajectories are stored, its 2026 inspector CVE and steps to run it safely.
- Made by
- Princeton University and Stanford University researchers (SWE-agent team)
- Runs in
- Command line (sweagent run), Batch mode for benchmarks, Web GUI (needs Node.js), Trajectory inspector
- Platforms
- macOS, Linux, Windows
- Licence
- MIT, open source
1 public advisory
Security advisories and reported issues since 2025, from vendor advisories, NVD and public reports. Checked December 2, 2026.
On this page
What SWE-agent is
SWE-agent lets a model use tools to fix issues in a repository, find security vulnerabilities, or work on other custom tasks, and it is driven from the sweagent command line with YAML config. By default it starts a Docker container, copies or clones the repo into it, and runs the model's commands there through SWE-ReX. It has no per-action approval prompt: you set limits, choose what happens to the result, and review the patch. The README and docs say development effort has moved to mini-SWE-agent, which is a separate, much smaller project.
Install SWE-agent
From source (the documented way):
git clone https://github.com/SWE-agent/SWE-agent.git && cd SWE-agent && python -m pip install --upgrade pip && pip install --editable .Check the install:
sweagent --helpSWE-agent news and advisories
Releases and announcements, with public security advisories on the same line.
- CVE-2026-75482
Path traversal in the trajectory inspector (sweagent inspector), found in v1.1.0 and listed as affecting 1.1.0 and earlier. The /trajectory/ handler did not reject .. segments, bound all interfaces, allowed any web origin and needed no login, so a network client or a malicious web page could read JSON files shaped like trajectories, which can hold secrets. VulnCheck gives CVSS 8.7. The advisory page names no fixed version and points to GitHub issue 1472.
VulnCheck advisory The latest commit on main, a fix mapping the multimodal subset to sb-cli's swe-bench-m name, landed. The repository holds 2,182 commits and no release has followed v1.1.0.
SWE-agent repositorySWE-agent 1.1.0 was released. It changed the trajectory format (messages became query), renamed tool bundles, and added SWE-bench multilingual and multimodal support plus SWE-smith compatibility.
SWE-agent changelogRelease v1.0.1 reported state of the art results on the full SWE-bench set with Claude 3.7.
SWE-agent release page
How SWE-agent keeps itself in bounds
Out of the box, autonomous: runs the model's commands in a Docker container with no approval prompt, stopped only by cost and call limits.
| Mode | How to turn it on | Asks you | What it allows |
|---|---|---|---|
Docker deployment (default) | sweagent run ... with optional --env.deployment.image=<image> | Never | The model's commands run inside a Docker container. Nothing asks you before a command runs. |
Cost and call limits | --agent.model.per_instance_cost_limit=2.00, per_instance_call_limit, total_cost_limit | Never | Stops a run when spend or call counts reach the limit. It limits runaway runs but does not review actions. |
Apply patch locally | --actions.apply_patch_locally | Never | Applies a successful solution to your local files without a separate step. Without it, the patch is saved to a file for you to inspect and apply. |
Open a pull request | --actions.open_pr | Never | On a GitHub issue, opens a PR automatically when the issue is solved. The docs say to use it responsibly, on your own repositories. |
Cloud execution | --env.deployment.type=modal | Never | Runs the environment on Modal instead of local Docker. It needs a Modal account and the swe-rex modal extra. |
Where its settings live
| Path | What it holds |
|---|---|
trajectories/ | Default output folder for runs, with one <instance_id>.traj JSON file per instance holding each thought, action, observation and the messages sent to the model |
.env (repository root) | Optional place for API keys and GITHUB_TOKEN. Values there replace environment variables |
config/default.yaml | Default agent templates, tool bundles and parser. Used when no --config is given |
patches/ | Where the patch from a successful run is saved, as shown in the submission message in the logs |
- SWE-agent trusts the container boundary and your limits, not per-action review. The default backend is Docker, and a local repo is copied into the container, so the model's edits land in the copy until you apply the patch.
- The options that cross that boundary are the ones to watch. --actions.apply_patch_locally writes to your files, --actions.open_pr publishes a pull request, and any API keys or GITHUB_TOKEN you supply are available to the run.
- Trajectory files hold repository source, command output and anything the model saw, including secrets that reached its context. Treat the trajectories folder as sensitive.
- The trajectory inspector is a local web server and has had a path traversal flaw, so do not expose it to a network. The project is in maintenance-only mode, so do not expect fast fixes.
Security incidents and advisories
| Date | Advisory | What happened |
|---|---|---|
CVE-2026-75482High | Path traversal in the trajectory inspector (sweagent inspector), found in v1.1.0 and listed as affecting 1.1.0 and earlier. The /trajectory/ handler did not reject .. segments, bound all interfaces, allowed any web origin and needed no login, so a network client or a malicious web page could read JSON files shaped like trajectories, which can hold secrets. VulnCheck gives CVSS 8.7. The advisory page names no fixed version and points to GitHub issue 1472.No fixed version published |
How to run SWE-agent safely
- Consider mini-SWE-agent first. SWE-agent is in maintenance-only mode and its authors recommend the newer project for most uses.
- Keep Docker as the backend and use a custom image with only the dependencies the task needs, via --env.deployment.image.
- Set --agent.model.per_instance_cost_limit and a call limit on every run, and use a model key with a spending cap.
- Leave --actions.apply_patch_locally and --actions.open_pr off. Read the saved patch, then apply it yourself with git apply.
- Give it a read-only or fine-grained GITHUB_TOKEN, and only when it must reach a private repo.
- Run sweagent inspector only with --host 127.0.0.1 and reach it through an SSH tunnel if needed. Never leave it on a shared network.
- Store the trajectories folder like a secret: it can contain source code and keys. Delete old runs you no longer need.
- Work on a copy of the repo or a branch, and review every diff before you merge.
Where Excellent fits
| What Excellent does | With SWE-agent |
|---|---|
Reads its session logs (free scan) | Yes |
Its key finder reads its key files | Yes |
Live check before risky actions (Pro) | No |
Excellent's sandbox | Claude Code and Codex only |
Rule sharing | Claude Code and Codex only |
Excellent reads SWE-agent's session logs on your Mac. The free scan shows what it did: your email in request commands or form inputs, keys sitting in logs, secrets files read, history overwritten, checks skipped. Each finding says which agent and where.
Excellent's sandbox and rule sharing are for Claude Code and Codex only. The check reads what a command says, so it isn't a wall around your Mac.
Questions
Does SWE-agent run commands in a container?
Yes, by default. It uses a Docker container through SWE-ReX, and the docs say Docker is the default backend. It can also run on Modal. Without Docker you would need cloud execution.
Does SWE-agent ask before running a command?
No. The default setup has no approval prompt. Its controls are the container, cost and call limits, and what you do with the final patch.
Is SWE-agent still developed?
It is in maintenance-only mode. Both the README and the docs say mini-SWE-agent has superseded it and recommend using that instead.
Where does SWE-agent keep its logs and trajectories?
Runs write to the trajectories folder by default, with a .traj JSON file per instance that records thoughts, actions and observations.
What is the difference between SWE-agent and mini-SWE-agent?
SWE-agent has custom tools, history processors and rich YAML config and runs in Docker by default. mini-SWE-agent has only a bash tool and about 100 lines of agent code, and its local CLI asks you to confirm each command.
Sources
Checked December 2, 2026. SWE-agent changes often, so its own docs win where they differ from this page.
- SWE-agent repository README
- SWE-agent docs: Setting up
- SWE-agent docs: Installation from source
- SWE-agent docs: Models and API keys
- SWE-agent docs: Command line basics
- SWE-agent docs: Output files
- SWE-agent docs: FAQ
- SWE-agent docs: Changelog
- SWE-agent release page
- SWE-agent security advisories
- VulnCheck: CVE-2026-75482
