Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

awp-python

Python implementation of the Agent World Protocol:

  • awp — the client protocol layer. ClientConnection is the agent side of AWP as a sans-IO state machine; awp.aio.AsyncClient drives it over a WebSocket.
  • awp_sim — the reference world. A sans-IO world engine with a simulated arm, a WebSocket server, an audit log, and a scenario suite that records wire traces.

It targets specification revision 0.1-draft.9, pinned as the spec/ submodule. This is an alpha: the API will change with the draft.

Status

AWP: Core World, AWP-conformant against 0.1-draft.9 AWP: Core Agent, AWP-conformant against 0.1-draft.9

The world is Core World: AWP-conformant against 0.1-draft.9, and the client, through its demo agent, Core Agent: AWP-conformant against 0.1-draft.9, each in both time models: awp-conformance reports no failure and nothing untested, and conformance/ holds the reports and the evidence for their manual rows. The sim profile in lockstep is self-assessed against 0.1-draft.9: the suite reports no failure and leaves a few requirements untested. Every recorded trace also passes the spec's own checker, which verifies schemas, the action lifecycle table, idempotency, replay, and frame sequencing.

Implemented Not implemented
Lockstep (on_tick, any_session) and streaming barrier tick authority
Inline and ws stream bindings; binary frame codec (all spec vectors) Other stream bindings (webrtc, webtransport, shm, grpc)
Full action lifecycle; preemption (replace, queue, reject, blend); idempotency Grant expiry
Watchdog and safe state, heartbeats, resumption with replay and acknowledgement Multi-bind and shared control (one embodiment)
Spatial, velocity, and rate envelopes (command_check), monitored during execution Robotics profile (a simulated arm proves nothing physical)
Audit log with redaction and hash chain; e-stop; world.reset
Beyond Core (--features): task, approval and standing approvals, transfer, seeding, snapshots, replay bundles, a servo command channel

Quickstart

Requires Python 3.11+ and uv (Node 20+ only for the trace checker).

git clone --recurse-submodules https://github.com/Hyperduality/awp-python
cd awp-python
uv sync

Run a world, then drive it with the scripted demo agent:

uv run awp-sim serve                 # streaming world on ws://127.0.0.1:8710
uv run awp-sim demo                  # in another terminal

awp-sim serve --mode lockstep runs the lockstep world. A token (--token, or $AWP_SIM_TOKEN) is required on any non-loopback bind, as is TLS (--tls-cert, --tls-key). Audit logs go to ./awp-audit; --record-dir also writes each session's wire trace. kill -USR1 engages the e-stop and kill -USR2 releases it.

Run the failure scenarios and check their traces against the spec:

uv run awp-sim scenarios --out traces
uv run python scripts/check_traces.py traces/*.jsonl

Using the client

With asyncio:

from awp import ClientConnection
from awp.aio import AsyncClient

conn = ClientConnection({"name": "my-agent", "version": "0.1.0", "vendor": "me"}, ["proprio/json"])
async with AsyncClient(conn, "ws://127.0.0.1:8710") as client:
    await client.initialize()
    await client.open_session("streaming", embodiment="arm_01", subscribe=["proprio"])
    await client.wait_for(lambda e: "proprio" in client.latest)
    record = await client.submit(
        "move_to_pose",
        {"pose": {"frame": "base", "p_m": [0.3, 0.2, 0.5], "q": [0, 0, 0, 1]}},
        basis=client.latest["proprio"].frame,  # the observation this intent rests on
        valid_for_ms=200,
    )
    print((await client.wait_terminal(record.action_id)).state)
    await client.close_session()

Without it, feed ClientConnection decoded messages and send what it queues:

events = conn.receive(message)  # typed events: ActionUpdated, FrameReceived, ...
for out in conn.outgoing():  # messages to send, in order
    transport.send(json.dumps(out))

The connection tracks the action lifecycle against the spec's transition table, deduplicates replayed statuses, keeps the clock offset from heartbeats, and reports any violation by the world as a ProtocolViolation event.

Layout

src/awp/            client protocol layer (sans-IO), asyncio adapter, frame codec, schemas
src/awp/_spec/      schemas and lifecycle table bundled from spec/ (scripts/sync_spec.py)
src/awp_sim/        world engine, arm, server, audit log, loopback, scenarios, CLI
spec/               agent-world-protocol, pinned at spec-v0.1-draft.9
scripts/            spec sync and trace checking

Development

uv run ruff check && uv run ruff format --check
uv run mypy
uv run pytest --cov
uv run python scripts/sync_spec.py --check

To move to a new draft revision: check out its tag in spec/, run scripts/sync_spec.py, update SPEC_REVISION in src/awp/__init__.py, and fix what the tests report.

License

Apache-2.0. See LICENSE.

Release files for awp-python 0.1.0a3

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

Source distribution (sdist)

Source distribution for awp-python 0.1.0a3
File Size Uploaded
awp_python-0.1.0a3.tar.gz 197.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for awp-python 0.1.0a3
File Interpreter ABI Platform
awp_python-0.1.0a3-py3-none-any.whl Python 3 none any Details

Total release size: 306.1 kB

Release files / awp_python-0.1.0a3.tar.gz

Download URL awp_python-0.1.0a3.tar.gz
Size 197.6 kB
Tags Source
SHA-256 checksum
How to use checksums
70a987676770909f7754397d10f68fe48b275a699a6e4a4073ea5815e47fa235
BLAKE2b-256 checksum
How to use checksums
27c0bd4ebe95c3a2597cbdad6f9596469e2f3de01f867de4f40b3a74ecc6ae83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 25, 2026.

Transparency log

Release files / awp_python-0.1.0a3-py3-none-any.whl

Download URL awp_python-0.1.0a3-py3-none-any.whl
Size 108.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6711ff93b2ba3ecc990426fddb1f92c0a888404d506ecac9d5f9af90af08c2f5
BLAKE2b-256 checksum
How to use checksums
beb7f58cdbf178ed3b964c6b79b9c637fd747cffd29fabd8f6888355310064d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 25, 2026.

Transparency log
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