Skip to main content

RunAgents Python SDK

Everything you need to build, test, and deploy AI agents on RunAgents — in one package.

The public source for this package lives in sdk/python/ in the runagents-io/runagents repository so the CLI, SDK, MCP server, docs, and skills ship together.

Install

pip install runagents        # Core SDK + CLI + runtime (zero deps)
pip install runagents[mcp]   # + MCP server for AI coding assistants
pip install runagents[dev]   # + hot-reload for local dev

Quickstart

runagents init my-agent      # Scaffold a project
cd my-agent
runagents dev                # Local dev server with mock tools
runagents deploy             # Ship to the platform

Python API

Client — manage platform resources

from runagents import Client

client = Client()  # reads ~/.runagents/config.json + env vars

agents = client.agents.list()
tools = client.tools.list()
runs = client.runs.list(agent="payment-agent")

result = client.agents.deploy(
    name="my-agent",
    source_files={"agent.py": open("agent.py").read()},
    required_tools=["stripe-api"],
    llm_configs=[{"provider": "openai", "model": "gpt-4o-mini", "role": "default"}],
)

Agent — write agent code

from runagents import Agent, tool

agent = Agent()  # reads TOOL_URL_*, LLM_GATEWAY_URL, LLM_MODEL from env

# Call a platform tool (platform egress layer handles auth)
result = agent.call_tool("echo-tool", "/echo", {"message": "hello"})

# Chat via LLM gateway
response = agent.chat("What is 2+2?", tools=[...])

# Custom handler (Tier 2)
def handler(request, ctx):
    message = request["message"]
    result = agent.chat(message)
    return result["choices"][0]["message"]["content"]

@tool decorator

from runagents import tool

@tool(name="calculator", description="Evaluate math expressions")
def calculate(expression: str) -> str:
    return str(eval(expression))

CLI Commands

Command Description
runagents init [name] Scaffold a new agent project
runagents dev Start local dev server with mock tools
runagents deploy Deploy an agent (delegates to Go CLI)
runagents catalog Browse and deploy catalog agents
runagents policies Manage governance policies
runagents approval-connectors Manage approval routing connectors
runagents identity-providers Manage workspace identity providers
runagents agents list List agents
runagents tools list List tools
runagents runs list List runs
runagents context export Export assistant/workspace context
runagents config Manage configuration

Runtime

The runtime provides the HTTP server for deployed agents — tool calling loop, SSE streaming, health checks, OAuth consent, and JIT approvals. It runs automatically inside the platform; for local development use runagents dev.

Policy enforcement remains active at runtime. Agents need bound policy rules (allow or approval_required) for tool calls.

# Backward compatible — still works
import runagents_runtime

MCP Server

pip install runagents[mcp]
runagents-mcp  # starts on stdio

Assistant tools for deployment, catalog inspection, policies, approval connectors, runs, and approvals. See AI Assistant Setup.

Configuration

Reads from ~/.runagents/config.json with env var overrides:

Variable Description Default
RUNAGENTS_ENDPOINT Platform API URL http://localhost:8092
RUNAGENTS_API_KEY API key or workspace key —

Documentation

License

Apache-2.0

Metadata

Release files for runagents 1.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for runagents 1.4.2
File Size Uploaded Provenance
runagents-1.4.2.tar.gz 58.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for runagents 1.4.2
File Interpreter ABI Platform
runagents-1.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 112.1 kB

Release files / runagents-1.4.2.tar.gz

Download URL runagents-1.4.2.tar.gz
Size 58.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a5992dff0797b3663c60923c1a44b35f1c197c263d0b1d947ea0aac262fbf144
BLAKE2b-256 checksum
How to use checksums
f3139bee8808e880d801f8dab75c9ac13a112a9703df5afda6ff11f26f4a252b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Release files / runagents-1.4.2-py3-none-any.whl

Download URL runagents-1.4.2-py3-none-any.whl
Size 53.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9372b025e9e3d29ce6b02648448f5878754f3a4e1d1a64ddc323d2c8129a7fa1
BLAKE2b-256 checksum
How to use checksums
f936263bd475a35f822eeb8409877c2ab9c8b81e15b80bdf7dee31e115fcf39a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Security for runagents 1.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for runagents-1.4.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page