This release is a pre-release and may not be stable for production use.
Plato Python SDK
Python SDK for the Plato platform. Uses Harbor for agent execution.
Installation
pip install plato-sdk-v2
# For agent functionality (requires Python 3.12+)
pip install 'plato-sdk-v2[agents]'
Or with uv:
uv add plato-sdk-v2
uv add 'plato-sdk-v2[agents]' # for agent support
Configuration
Create a .env file in your project root:
PLATO_API_KEY=your-api-key
PLATO_BASE_URL=https://plato.so # optional, defaults to https://plato.so
Or set environment variables directly:
export PLATO_API_KEY=your-api-key
Agents
The SDK uses Harbor's agent framework. All agents are BaseInstalledAgent subclasses that run in containers.
Available Agents
Harbor built-in agents (code agents):
| Agent | Description |
|---|---|
claude-code |
Claude Code CLI |
openhands |
OpenHands/All Hands AI |
codex |
OpenAI Codex CLI |
aider |
Aider pair programming |
gemini-cli |
Google Gemini CLI |
goose |
Block Goose |
swe-agent |
SWE-agent |
mini-swe-agent |
Mini SWE-agent |
cline-cli |
Cline CLI |
cursor-cli |
Cursor CLI |
opencode |
OpenCode |
qwen-coder |
Qwen Coder |
Plato custom agents (browser/automation):
| Agent | Description |
|---|---|
computer-use |
Browser automation (install: pip install plato-agent-computer-use) |
Python Usage
from plato.agents import ClaudeCode, OpenHands, AgentFactory, AgentName
from pathlib import Path
# Option 1: Use AgentFactory
agent = AgentFactory.create_agent_from_name(
AgentName.CLAUDE_CODE,
logs_dir=Path("./logs"),
model_name="anthropic/claude-sonnet-4",
)
# Option 2: Import agent class directly
agent = ClaudeCode(
logs_dir=Path("./logs"),
model_name="anthropic/claude-sonnet-4",
)
# Option 3: Create custom BaseInstalledAgent
from plato.agents import BaseInstalledAgent
CLI Usage
# Run an agent
plato agent run -a claude-code -m anthropic/claude-sonnet-4 -d swe-bench-lite
# List available agents
plato agent list
# Get agent config schema
plato agent schema claude-code
# Publish custom agent to Plato PyPI
plato agent publish ./my-agent
Agent Schemas
Get configuration schemas for any agent:
from plato.agents import get_agent_schema, AGENT_SCHEMAS
# Get schema for specific agent
schema = get_agent_schema("claude-code")
print(schema)
# List all available schemas
print(list(AGENT_SCHEMAS.keys()))
Custom Agents
Create a custom agent by extending BaseInstalledAgent:
from harbor.agents.installed.base import BaseInstalledAgent, ExecInput
from pathlib import Path
class MyAgent(BaseInstalledAgent):
@staticmethod
def name() -> str:
return "my-agent"
@property
def _install_agent_template_path(self) -> Path:
return Path(__file__).parent / "install.sh.j2"
def create_run_agent_commands(self, instruction: str) -> list[ExecInput]:
return [ExecInput(command=f"my-agent --task '{instruction}'")]
Publish to Plato PyPI:
plato agent publish ./my-agent-package
Sessions & Environments
Flow 1: Create Session from Environments
Use this when you want to spin up environments for development, testing, or custom automation.
import asyncio
from plato.v2 import AsyncPlato, Env
async def main():
plato = AsyncPlato()
# Create session with one or more environments
# (heartbeat starts automatically to keep session alive)
session = await plato.sessions.create(
envs=[
Env.simulator("gitea", dataset="blank", alias="gitea"),
Env.simulator("kanboard", alias="kanboard"),
],
timeout=600,
)
# Reset environments to initial state
await session.reset()
# Get public URLs for browser access
public_urls = await session.get_public_url()
for alias, url in public_urls.items():
print(f"{alias}: {url}")
# Get state mutations from all environments
state = await session.get_state()
print(state)
# Cleanup
await session.close()
await plato.close()
asyncio.run(main())
Flow 2: Create Session from Task
Use this when running evaluations against predefined tasks. This flow includes task evaluation at the end.
import asyncio
from plato.v2 import AsyncPlato
async def main():
plato = AsyncPlato()
# Create session from task ID
session = await plato.sessions.create(task=123, timeout=600)
# Reset environments to initial state
await session.reset()
# Get public URLs for browser access
public_urls = await session.get_public_url()
for alias, url in public_urls.items():
print(f"{alias}: {url}")
# Evaluate task completion
evaluation = await session.evaluate()
print(f"Task completed: {evaluation}")
# Cleanup
await session.close()
await plato.close()
asyncio.run(main())
Environment Configuration
Two ways to specify environments:
from plato.v2 import Env
# 1. From simulator (most common)
Env.simulator("gitea") # default tag
Env.simulator("gitea", tag="staging") # specific tag
Env.simulator("gitea", dataset="blank") # specific dataset
Env.simulator("gitea", alias="my-git") # custom alias
# 2. From artifact ID
Env.artifact("artifact-abc123")
Env.artifact("artifact-abc123", alias="my-env")
Per-Environment Operations
Access individual environments within a session:
# Get all environments
for env in session.envs:
print(f"{env.alias}: {env.job_id}")
# Get specific environment by alias
gitea = session.get_env("gitea")
if gitea:
# Execute shell command
result = await gitea.execute("whoami", timeout=30)
print(result)
# Get state for this environment only
state = await gitea.get_state()
# Reset this environment only
await gitea.reset()
Sync Client
A synchronous client is also available:
from plato.v2 import Plato, Env
plato = Plato()
session = plato.sessions.create(
envs=[Env.simulator("gitea", alias="gitea")],
timeout=600,
)
session.reset()
public_urls = session.get_public_url()
state = session.get_state()
session.close()
plato.close()
Architecture
plato/
├── agents/ # Harbor agent re-exports + schemas
├── sims/ # Simulator clients (Spree, Firefly, etc.)
├── world/ # World/environment abstractions
├── v1/ # Legacy SDK + CLI
└── v2/ # New API client
Documentation
- Generating Simulator SDKs - How to create API clients for simulators
- Building Simulators - Internal docs for snapshotting simulators
License
MIT
Metadata
Release files for plato-sdk-v2 2.11.1.dev202602060112
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plato_sdk_v2-2.11.1.dev202602060112.tar.gz | 849.5 kB | Without provenance | Details for plato_sdk_v2-2.11.1.dev202602060112.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| plato_sdk_v2-2.11.1.dev202602060112-py3-none-any.whl | Python 3 | none | any | Details for plato_sdk_v2-2.11.1.dev202602060112-py3-none-any.whl |
Total release size: 1.7 MB
Release files / plato_sdk_v2-2.11.1.dev202602060112.tar.gz
| Download URL | plato_sdk_v2-2.11.1.dev202602060112.tar.gz |
|---|---|
| Size | 849.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c2c2cb76b942e8cb836d0f76eaf2d44c7b212e28829fc2caac9a59d231a4e46
|
|
BLAKE2b-256 checksum How to use checksums |
e0c659fb012e6c5103833d9858690f824d5413832394908b7c72b3a3aed8419d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / plato_sdk_v2-2.11.1.dev202602060112-py3-none-any.whl
| Download URL | plato_sdk_v2-2.11.1.dev202602060112-py3-none-any.whl |
|---|---|
| Size | 896.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4d60d6922ecccd3b19ada5eca1a31270ca92526e4e650ec0ba5a2ec882c9381
|
|
BLAKE2b-256 checksum How to use checksums |
ab01827e4326b7440163d31721dfcfc5ff1eb0d791fee355ff9f821ea6407efc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for plato-sdk-v2 2.11.1.dev202602060112
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.