--- id: swe-rex version: "1.4.0" license: unclear license_treatment: permissive maintenance: active --- # swe-rex — Sandboxed code execution for AI agents, locally or on the cloud. License: permissive · Maintenance: active · Downloads: 3.2M/mo ## What it is and what it does SWE-ReX is a runtime abstraction layer that lets AI agents execute shell commands in sandboxed environments without caring whether they run locally, in Docker, on AWS, or on Modal. It handles the messy details of spawning sessions, detecting command completion, capturing output and exit codes, and managing multiple parallel shells—so your agent code stays the same whether you're testing locally or scaling to dozens of parallel runs. The package is built on fastapi and uvicorn, suggesting it exposes a web service interface for remote execution. It integrates with pexpect and bashlex to parse and interact with shell sessions, and uses pydantic for configuration validation. It's designed for developers building AI agents that need to run arbitrary commands in controlled environments without reimplementing infrastructure plumbing. Use it for: - Let an AI agent run code-fixing commands in an isolated Docker container without hardcoding container-specific logic in your agent. - Evaluate an AI agent on a benchmark by spinning up parallel shell sessions and running the agent on each without managing infrastructure. - Build a multi-tool agent that uses ipython, gdb, and bash interactively, with SWE-ReX handling session multiplexing and output parsing. - Deploy an agent to Modal or AWS and have it execute shell commands remotely while your agent code remains unchanged. - Run many agents in parallel locally or on the cloud without writing custom process management or container orchestration code. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. SWE-ReX provides a runtime interface for AI agents to execute shell commands in sandboxed environments—local, Docker, AWS, or Modal—with a unified API that abstracts away infrastructure details. Yes, if you are building AI agents that need to execute shell commands in sandboxed or remote environments. The package solves a real infrastructure abstraction problem and is actively maintained with no known vulnerabilities. Install friction is low and the permissive MIT license removes legal friction. Start with the base install; add optional dependencies only if you need Modal, Fargate, or Daytona support. ## Install pip install swe-rex uv add swe-rex poetry add swe-rex ## Installing swe-rex Before you install: Low friction install with a pure-Python wheel. Active maintenance (last commit 2026-08-10) and recent releases (1.4.0 on 2025-08-14) suggest ongoing support. Eight runtime dependencies including fastapi, uvicorn, and pydantic indicate a web-service-oriented architecture. License in practice: MIT license (permissive) allows unrestricted use, modification, and distribution with minimal legal friction for commercial or private projects. Quickstart: pip install swe-rex from swe_rex import LocalExecutor executor = LocalExecutor() result = executor.run_command('echo hello') Requires Python >=3.10. For cloud platforms (Modal, Fargate, Daytona), additional optional dependencies and platform credentials are needed. Verify before relying: - Exact API surface and how to instantiate executors for different platforms (Docker, AWS, Modal) beyond the install extras shown. - Whether interactive tools like ipython or gdb require special configuration or just work out of the box. - Performance characteristics and latency overhead when running commands remotely vs. locally. - Limits on parallel agent count or resource consumption when scaling to many concurrent sessions. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags ai agent shell execution, sandboxed code execution, remote command execution framework, agent infrastructure abstraction, parallel shell environment management, docker container execution api, interactive shell session control, agent-infrastructure, sandbox-execution, parallel-shells [View on SkillFed](https://skillfed.io/packages/swe-rex) · [View on PyPI](https://pypi.org/project/swe-rex/)