AgentScope Runtime
Turn agent logic into a streaming, sandbox-backed API you can deploy anywhere from a laptop to Kubernetes.
- Source repo
- agentscope-ai/agentscope-runtime
- Stars
- ★ 863
- Last updated
- 5mo ago
- FARS reviewed
- Sep 12, 2026
- License
- Apache-2.0
- Primary language
- Python
- FA score
- 46/100 · Major gaps
At a glance
- How it runs
- Works with
- Portable with changesOpenAI API (Partial support)
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Developers who want to turn an AgentScope ReActAgent into a streaming HTTP API in an afternoon using the README's three-stage AgentApp template.
- Not a fit if
- Teams that need ongoing maintenance: the repo is read-only, archived, and succeeded by AgentScope 2.0
- Hosts without a container backend such as Docker, since every sandbox example needs one
- Users who need MobileSandbox on ARM64/Apple silicon; x86_64 hosts are recommended
- Maintenance
- Commits in the last 6 monthslast commit 2026-06-04
- Source review
- 46/100 · Major gaps
What does this agent do, and when should you use it?
AgentScope Runtime is a Python runtime that packages agent logic into a deployable HTTP service. Its central component, AgentApp, inherits directly from FastAPI as of v1.1.0 and structures code around a lifespan hook, a @agent_app.query(framework=...) handler, and shutdown cleanup, streaming output as Server-Sent Events from a /process endpoint. Tool calls run in container-backed sandboxes — BaseSandbox, GuiSandbox, BrowserSandbox, FilesystemSandbox, MobileSandbox and others, each with sync and async variants — on Docker, gVisor or BoxLite locally, and on Kubernetes, Function Compute (FC) or ACK in production. Deploy managers such as LocalDeployManager and ModelstudioDeployManager publish the app and automatically add A2A and Response API endpoints, so an OpenAI SDK client can call it in compatible mode. Adapters exist for AgentScope, LangGraph, Microsoft Agent Framework, Agno and AutoGen, with uneven feature coverage across them. The repository now carries an archive notice: its capabilities were folded into AgentScope 2.0, which is read-only here and recommended by the maintainers for new work.
You instantiate AgentApp with app_name, app_description and a lifespan context manager, then register a handler with @agent_app.query(framework="agentscope"). Inside the handler you build an agent (the README uses a ReActAgent with DashScopeChatModel), load and save state through agent_app.state.session.load_session_state / save_session_state, and yield (msg, last) pairs from stream_printing_messages, which the framework converts into SSE events (response, message, content objects). agent_app.run(host, port) serves POST /process, accepting JSON with role/content and returning the stream. The sandbox layer exposes concrete methods such as list_tools, run_ipython_cell, run_shell_command, computer_use, browser_navigate, create_directory and mobile_tap; the backend is selected with CONTAINER_DEPLOYMENT (docker / gvisor / boxlite) and image paths with RUNTIME_SANDBOX_REGISTRY, RUNTIME_SANDBOX_IMAGE_NAMESPACE and RUNTIME_SANDBOX_IMAGE_TAG, while runtime-sandbox-server --config fc.env starts a serverless sandbox server. On the deployment side, app.deploy(deployer=...) accepts a LocalDeployManager or ModelstudioDeployManager, publishes the service at endpoint_path, and adds A2A and Response API routes. Sandbox tools must be wrapped with sandbox_tool_adapter and registered via register_tool_function before an AgentScope agent can call them.
- Developers who want to turn an AgentScope ReActAgent into a streaming HTTP API in an afternoon using the README's three-stage AgentApp template.
- Teams that need model-generated Python code or shell commands to run isolated from the host, using BaseSandbox.
- Teams doing browser automation, virtual-desktop GUI work or Android emulator operations (tap, text input, screenshot) via BrowserSandbox, GuiSandbox or MobileSandbox.
- Platform engineers who want one agent service deployed locally, on Kubernetes, or on Alibaba Cloud Function Compute / ACK.
- Teams already using LangGraph, Agno or Microsoft Agent Framework that want a uniform API and deployment layer across them.
- Existing AgentScope users evaluating what the old runtime did before migrating to AgentScope 2.0.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
pip install agentscope-runtimepip install "agentscope-runtime[ext]"pip install -e
- Environment variables
DASHSCOPE_API_KEY- Runtime
- Python 3.10
- Install notes cover
- Docker
How do you install or deploy this agent?
Requires Python 3.10 or higher and pip or uv. Install the core package (or the [ext] extra) from PyPI:
pip install agentscope-runtime
pip install "agentscope-runtime[ext]"Or build from source:
git clone -b main https://github.com/agentscope-ai/agentscope-runtime.git
cd agentscope-runtime
pip install -e .The sandbox examples additionally need a Docker-capable host (gVisor and BoxLite are selectable backends), and the README examples read DASHSCOPE_API_KEY from the environment. Because the repository is archived, the maintainers recommend installing AgentScope 2.0 for new projects instead.
How do you use this agent?
Define a lifespan hook, create the AgentApp, register a query handler and run it:
import os
from contextlib import asynccontextmanager
from fastapi import FastAPI
from agentscope.agent import ReActAgent
from agentscope.model import DashScopeChatModel
from agentscope.formatter import DashScopeChatFormatter
from agentscope.tool import Toolkit, execute_python_code
from agentscope.pipeline import stream_printing_messages
from agentscope.memory import InMemoryMemory
from agentscope.session import RedisSession
from agentscope_runtime.engine import AgentApp
from agentscope_runtime.engine.schemas.agent_schemas import AgentRequest
@asynccontextmanager
async def lifespan(app: FastAPI):
import fakeredis
fake_redis = fakeredis.aioredis.FakeRedis(decode_responses=True)
app.state.session = RedisSession(connection_pool=fake_redis.connection_pool)
yield
print("AgentApp is shutting down...")
agent_app = AgentApp(
app_name="Friday",
app_description="A helpful assistant",
lifespan=lifespan,
)
@agent_app.query(framework="agentscope")
async def query_func(self, msgs, request: AgentRequest = None, **kwargs):
session_id = request.session_id
user_id = request.user_id
toolkit = Toolkit()
toolkit.register_tool_function(execute_python_code)
agent = ReActAgent(
name="Friday",
model=DashScopeChatModel(
"qwen-turbo",
api_key=os.getenv("DASHSCOPE_API_KEY"),
stream=True,
),
sys_prompt="You're a helpful assistant named Friday.",
toolkit=toolkit,
memory=InMemoryMemory(),
formatter=DashScopeChatFormatter(),
)
agent.set_console_output_enabled(enabled=False)
await agent_app.state.session.load_session_state(
session_id=session_id, user_id=user_id, agent=agent,
)
async for msg, last in stream_printing_messages(
agents=[agent], coroutine_task=agent(msgs),
):
yield msg, last
await agent_app.state.session.save_session_state(
session_id=session_id, user_id=user_id, agent=agent,
)
agent_app.run(host="127.0.0.1", port=8090)The server listens on http://localhost:8090/process; verify the SSE stream with curl:
curl -N \
-X POST "http://localhost:8090/process" \
-H "Content-Type: application/json" \
-d '{
"input": [
{
"role": "user",
"content": [
{ "type": "text", "text": "What is the capital of France?" }
]
}
]
}'Run tools inside an isolated sandbox:
from agentscope_runtime.sandbox import BaseSandbox
with BaseSandbox() as box:
print(box.list_tools())
print(box.run_ipython_cell(code="print('hi')"))
print(box.run_shell_command(command="echo hello"))Publish the service with a deploy manager, which adds A2A and Response API endpoints:
from agentscope_runtime.engine.deployers import LocalDeployManager
deployer = LocalDeployManager(host="0.0.0.0", port=8090)
deploy_result = await app.deploy(deployer=deployer, endpoint_path="/process")After deployment the OpenAI SDK can call it in compatible mode via http://localhost:8090/compatible-mode/v1.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
What are this agent's strengths and limitations?
- AgentApp inherits from FastAPI as of v1.1.0, so existing FastAPI routes, middleware and lifespan hooks for session/resource management can be reused directly.
- Seven sandbox types (Base, GUI, Browser, Filesystem, Mobile, Training, Agentbay), most with matching sync and async classes for non-blocking parallel tool execution.
- Deploy managers automatically expose A2A and Response API endpoints, so an OpenAI SDK client works after only changing base_url.
- Backend and image source are configurable through CONTAINER_DEPLOYMENT and the RUNTIME_SANDBOX_REGISTRY / IMAGE_NAMESPACE / IMAGE_TAG variables, useful behind firewalls or with a mirror registry.
- Deployment path spans LocalDeployManager through Kubernetes, Function Compute FC, ACK and ModelStudio, keeping development and production abstractions close.
- The repository carries an archive notice and is read-only; there will be no further updates and the maintainers direct users to AgentScope 2.0, so adoption now implies a migration.
- Adapter coverage is uneven: only AgentScope, Microsoft Agent Framework and Agno have both message and tool support; LangGraph tools and AutoGen messages are marked 🚧.
- Every sandbox example needs a container backend, and MobileSandbox additionally requires the Linux binder/ashmem kernel modules with x86_64 hosts recommended over ARM64.
- Serverless and cloud deployment paths depend on Alibaba Cloud services (Function Compute, ACK, ModelStudio) and the default example model needs a DASHSCOPE_API_KEY.
How does this agent compare with similar options?
The README positions the runtime above agent frameworks rather than against them: LangGraph, Agno, AutoGen and Microsoft Agent Framework are integration targets whose messages and tools are adapted into one service layer, and the feature-matrix table lets you compare per-framework coverage. The genuine alternative is its own successor, AgentScope 2.0, into which tool sandboxing, Agent-as-a-Service APIs and full-stack observability have been natively merged — new projects should evaluate that instead of this repository.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| AgentScope Runtime This agent | 46 · Major gaps | Library / SDKFree + model costs | ★ 863 | 5mo ago | Python | — |
| Agentor Agent Framework | 56 · Major gaps | Library / SDKFree + model costs | ★ 218 | 1mo ago | Python | OpenAI API |
| Helix Private Coding Fleet | 51 · Major gaps | Self-hosted serviceFreemium | ★ 834 | 4d ago | Go | Codex · Claude Code · OpenAI API · Claude API |
| FastAPI LangGraph Agent Production-Ready Template | 48 · Major gaps | Self-hosted serviceFree + model costs | ★ 2.8k | 1mo ago | Python | OpenAI API |
How does FollowAgents rate this agent?
Why each dimension lost points
README claims hardened sandboxing and CI manages credentials via GitHub secrets, but the supplied files do not show sandbox hardening details, permission model, user confirmation mechanisms, or sensitive-data handling; sandbox images default to :latest pulls — a supply-chain risk with no digest pinning or signing shown, so scores stay low.
Example code is largely self-consistent (FakeRedis explicitly marked dev/test-only); but the repo is announced as archived, dates in the README (2026) cannot be cross-verified, dependency ranges are broad (openai, jinja2 with no lower bound), and failure-handling paths are not evidenced.
README clearly states Python 3.10+, Docker/gVisor/BoxLite backends, local/K8s/serverless deployment, and a framework compatibility table with explicit partial-support markers; however, the 'framework-agnostic' claim conflicts with 'currently supports AgentScope', and trigger/boundary precision is under-evidenced.
Full Apache-2.0 license (Copyright 2025 Alibaba), installation instructions, bilingual README, Cookbook, changelog links, and architecture compatibility caveats (ARM64, kernel modules) are well done; but the repo is being archived, ongoing maintenance responsibility shifts to AgentScope 2.0, and naming changed with the v1.1.0 refactor.
SSE streaming output and concrete run/verify examples (curl) support output usability; but the value proposition rests largely on asserted 'production-grade' claims, and marginal value is diminished by the archive notice directing users to AgentScope 2.0, so cost-benefit evidence is weak.
Example code partially cross-checks against pyproject and test assets (agent_for_test.py) for API usage; but key claims ('production-grade', 'hardened sandbox') are not traceable within the supplied files, and external corroboration (PyPI, Cookbook, test coverage) is absent. Fact/inference separation is reasonable (clear NOTE/TIP markers).
- The repository is announced as archived; all capabilities have been merged into AgentScope 2.0 — do not start new projects on this repo.
- Sandbox images default to :latest tags; production use should pin digests and verify image provenance.
- 'Production-grade' and 'hardened sandbox' are documentation claims only; supplied evidence contains no security design detail, so independent security assessment is required.
- The dependency list is broad (multiple Alibaba Cloud SDKs; openai/jinja2 with no lower bounds) — lock and scan.
- Publisher identity is unverified in the FollowAgents registry; perform your own due diligence before enterprise adoption.
- Static review only: no code was executed and date/version metadata (2026 news entries) could not be independently verified.
FAQ
Is this repository still maintained?
Do I need Docker to use it?
Does it lock me into Alibaba Cloud?
Which agent frameworks work today?
What credentials are required?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.