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.7, pinned as the spec/ submodule. This is an alpha: the API will change with the draft.

Status

The world and client target Core World and Core Agent for both time models, and the world the sim profile in lockstep, self-assessed against 0.1-draft.7: awp-conformance reports no failure against any configuration 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 Standing approvals, 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) Robotics profile (a simulated arm proves nothing physical)
Audit log with redaction and hash chain; e-stop; world.reset
Beyond Core (--features): task, approval, 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.7
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.0a1

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.0a1
File Size Uploaded
awp_python-0.1.0a1.tar.gz 168.5 kB Details

Built distribution (wheel)

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

Total release size: 273.5 kB

Release files / awp_python-0.1.0a1.tar.gz

Download URL awp_python-0.1.0a1.tar.gz
Size 168.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8c7002b7f8062280bdf18eecb28b89250e857282ae92900ae91093d9ae9f73f9
BLAKE2b-256 checksum
How to use checksums
7c4a4621c99d445385845d8c69ad293eb639d5f5fa5586874d3c46a73b0ca8db
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.0a1-py3-none-any.whl

Download URL awp_python-0.1.0a1-py3-none-any.whl
Size 105.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df9584e44c6efa860515e6617a98c6faaea5cb825d6a00dad9a658a2a09d27f8
BLAKE2b-256 checksum
How to use checksums
9c9eab12df8ee26f4ef5c12e6b91dfac3dd9d1d55462a0099bce3e64543ca6f1
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 history Release notifications | RSS feed

This release

0.1.0a1 This release

2 release files

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