AgentScope Runtime

Turn agent logic into a streaming, sandbox-backed API you can deploy anywhere from a laptop to Kubernetes.

Stars
★ 863
Last updated
5mo ago
FARS reviewed
Sep 12, 2026
License
Apache-2.0
Primary language
Python

At a glance

How it runs
Library / SDKSelf-hosted service
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
Python 3.10+Docker (local sandbox backend; gVisor or BoxLite optional)DASHSCOPE_API_KEY (used by the README examples)Shell / CLINetwork accessLocal filesystem
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

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.

  1. Developers who want to turn an AgentScope ReActAgent into a streaming HTTP API in an afternoon using the README's three-stage AgentApp template.
  2. Teams that need model-generated Python code or shell commands to run isolated from the host, using BaseSandbox.
  3. Teams doing browser automation, virtual-desktop GUI work or Android emulator operations (tap, text input, screenshot) via BrowserSandbox, GuiSandbox or MobileSandbox.
  4. Platform engineers who want one agent service deployed locally, on Kubernetes, or on Alibaba Cloud Function Compute / ACK.
  5. Teams already using LangGraph, Agno or Microsoft Agent Framework that want a uniform API and deployment layer across them.
  6. 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-runtime
  • pip 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)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

What are this agent's strengths and limitations?

Pros
  • 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.
Limitations
  • 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?

FollowAgents source review · FARS-2.1
Major gaps
46/ 100 5-point scale 2.3 / 5
Trust 10/29
Reliability 5/14
Adaptability 10/18
Convention 11/18
Effectiveness 6/13
Verifiability 4/8
Why each dimension lost points
Trust10 / 29 · 1.7/5

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.

Reliability5 / 14 · 1.8/5

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.

Adaptability10 / 18 · 2.8/5

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.

Convention11 / 18 · 3.1/5

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.

Effectiveness6 / 13 · 2.3/5

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.

Verifiability4 / 8 · 2.5/5

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).

Risks and how to mitigate them
  • 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.
Evidence confidence: Low Reviewed Sep 12, 2026 Reviewed revision 22072fd7075c
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/agentscope-runtime.svg)](https://followagents.com/en/agents/agentscope-runtime)
<a href="https://followagents.com/en/agents/agentscope-runtime"><img src="https://followagents.com/badge/agentscope-runtime.svg" alt="FARS review"></a>

FAQ

Is this repository still maintained?
No. An archive notice states that all capabilities have been integrated into AgentScope 2.0, that this repository is read-only and will be archived soon, and that all users should migrate to AgentScope 2.0 for updates and community support.
Do I need Docker to use it?
For the sandbox examples, yes. Local backends are Docker (optionally gVisor) or BoxLite, chosen with CONTAINER_DEPLOYMENT; the README points large or production deployments to Kubernetes, Function Compute FC or ACK. MobileSandbox additionally needs binder/ashmem kernel modules and is best on x86_64.
Does it lock me into Alibaba Cloud?
Local runs do not — AgentApp needs only Python and a container backend. The managed paths (ModelstudioDeployManager, Function Compute, ACK sandboxes, and the DashScope models used in examples) are Alibaba Cloud services, and sandbox images can be pulled from either Docker Hub or the Alibaba Cloud registry.
Which agent frameworks work today?
Per the adapter table, AgentScope, Microsoft Agent Framework and Agno have both message and tool support; LangGraph has message support with tools still 🚧, and AutoGen has tool support with messages still 🚧. Check your framework's row before relying on a specific path.
What credentials are required?
The README examples need DASHSCOPE_API_KEY for DashScopeChatModel. Deploying to ModelStudio additionally needs ALIBABA_CLOUD_ACCESS_KEY_ID, ALIBABA_CLOUD_ACCESS_KEY_SECRET and MODELSTUDIO_WORKSPACE_ID.
Was this page helpful?
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts