Skip to main content

axorum-sandbox

The Axorum sandbox for Python: a world's agent plane served on 127.0.0.1, a clock that moves only when the test moves it, and the ledger to assert on. The wheel carries the axorum-sandbox binary; the axorum_sandbox module runs it.

pip install axorum-sandbox axorum-client

There is a wheel for Linux on x64 and arm64 (any libc), macOS on x64 and arm64, and Windows on x64.

An agent's test

from axorum import Agent, Amount, AxorumClient, Payment
from axorum_sandbox import Sandbox

BUYER = "agent://example.com/agent/buyer_01h455vb4pex5vsknk084sn02q"


def test_the_agent_stops_paying_a_suspended_vendor(tmp_path):
    with Sandbox.starter("agent-payments", tmp_path) as sandbox:
        # The agent's own client, unchanged but for where its requests go.
        axorum = AxorumClient(sandbox.url)
        agent = Agent(BUYER, lambda: sandbox.token(BUYER))
        pay = lambda minor, payee: axorum.authorize(agent, Payment.new(Amount(minor, "USD"), payee))

        assert pay(10_000, "api.anthropic.com").allowed
        sandbox.advance("7d")  # the vendor review suspends Anthropic
        assert not pay(100, "api.anthropic.com").allowed
        print(sandbox.report("exceptions")["text"])

A token lives a day of the sandbox's clock, so an agent that outlives a move of the clock takes a token source, Agent(uri, lambda: sandbox.token(uri)), rather than one token. A run reads no clock and no random source: one world and one seed give one run, on every machine.

Starter worlds

Starter What it shows
agent-payments An agent paying for the APIs it uses, held to a vendor registry's approvals and per-payee limits, until a review a week in suspends a vendor.
purchase-receipts A purchase over $500 leaves the agent a duty to file its receipt within a day; a forgotten one breaches, and the exceptions report lists it.
daily-budget An agent on a budget: no purchase over $50, and no more than $100 in any rolling day; a day on, the budget is free again.
spending-mandate An agent spending under a mandate: $1,000.00 in all, carved from a $5,000.00 team budget; a purchase past it is refused by the mandate and recorded, and the mandates report shows what each mandate has spent and what is left.
purchase-rate-limit An agent held to 5 purchases in any rolling hour, so one stuck in a loop stops at the sixth; an hour on, it may buy again.

starters() lists them, new(starter, directory) writes one's world and policy to disk, and Sandbox.starter(name, directory) writes and serves it. The sandbox guide shows how to test an agent with one.

Checking a policy

check(policy, *, world=None, deny_warnings=False) compiles a policy file offline as axorum policy check does and, with a world file, judges it against that world: the currencies it declares, the mandates it opens and the agents it binds. It answers the verdict document, with the id each mandate and party name derives to and every warning by code, and raises SandboxError when the policy does not compile, the world cannot run it, or deny_warnings refuses a warning.

from axorum_sandbox import check

checked = check("spending-mandate.axp", world="spending-mandate.world.yaml")
assert checked["warnings"] == [], checked["warnings"]

What a run offers

Sandbox(world, policy=None, seed=None) Serves a world file (YAML) until close(), or for a with block.
sandbox.url The agent plane, answered as axorum serve answers it. Hand it to AxorumClient.
sandbox.token(agent) A capability token for an agent the world names.
sandbox.advance(by) Moves the clock by an offset (30s, 1d), answering what applied on the way.
sandbox.inject(event) Applies one world event (YAML) now.
sandbox.events() Every world event applied so far, each as advance lists it, with the engine's refusal when it refused the change. The events applied at start (those at 0s, and any a 0s advance reaches) come first; no move of the clock reports them.
sandbox.policy(source) Puts another policy in force now, as axorum serve registers and activates one; answers what changed and when. An agent pinned to the old policy is refused stale_policy and re-pins; the policy in force sent again changes nothing; a refused policy raises and changes nothing.
sandbox.ledger(first=None, limit=None) A page of the journal, each record tagged by its kind: {"Transaction": …} for each judgement, a refusal with "posted": False.
sandbox.obligations() Every duty still open.
sandbox.report(kind, from_=None, to=None, usage=None, transaction=None) period, exceptions, activity, registers, usage_balance, mandates or explain, rendered as serve renders it.
sandbox.snapshot(), sandbox.save_run() The console's snapshot, and the scenario that replays the run.
snapshot_schema(), snapshot_schema_path() The JSON Schema (draft 2020-12) every snapshot meets, urn:axorum:schema:axorum.sandbox-snapshot.v1, parsed and as the file the package ships.

A refusal raises SandboxError, with the status and code the sandbox answered, and its body. AXORUM_SANDBOX_BIN names a binary to run in place of the packaged one.

The same binary is the axorum-sandbox command: axorum-sandbox serve, run (replays saved scenarios in CI), new, inject, policy, save-run, token and pull. With AXORUM_SANDBOX_SINK and AXORUM_SANDBOX_TOKEN set from the console, axorum-sandbox serve --console-events serves the world attached to the sandbox there and reports each run back.

Metadata

Release files for axorum-sandbox 0.3.0

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

Built distributions (wheels)

Table of built distributions (wheels) for axorum-sandbox 0.3.0
File
axorum_sandbox-0.3.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
axorum_sandbox-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64, Linux musl 1.2+ x86-64 Details
axorum_sandbox-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_2_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64, Linux musl 1.2+ ARM64 Details
axorum_sandbox-0.3.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
axorum_sandbox-0.3.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 32.9 MB

Release files / axorum_sandbox-0.3.0-py3-none-win_amd64.whl

Download URL axorum_sandbox-0.3.0-py3-none-win_amd64.whl
Size 6.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
f52bf9d7f193570eb97f0791f15a2a82d30262e8d48f55bfaef636debee9f601
BLAKE2b-256 checksum
How to use checksums
f2b96ba4e703951526516a97980cd9c5e1bae5e26d59d0881d03eb38227e71a7
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 Oct 12, 2026.

Transparency log

Release files / axorum_sandbox-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64.whl

Download URL axorum_sandbox-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64.whl
Size 6.9 MB
Tags Linux glibc 2.17+ x86-64 Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
ddfa52963bb3446ebef2344114232669e06f8ebbc4ea504a8b82c8fb4872a986
BLAKE2b-256 checksum
How to use checksums
0270a30cbfee271ad099240a6f84aa6b6572579c7c5ad68a2b8c8bbf2aa84acc
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 Oct 12, 2026.

Transparency log

Release files / axorum_sandbox-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_2_aarch64.whl

Download URL axorum_sandbox-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_2_aarch64.whl
Size 6.3 MB
Tags Linux glibc 2.17+ ARM64 Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
7f9201e09c5e2dc5a2dce74c1303f7d1e2f983858dd5db2cb16dd9b471662beb
BLAKE2b-256 checksum
How to use checksums
6cf62f8fad27895f6ce4326c60dd30cad9a6bcebc717c55ab272d3923ccea546
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 Oct 12, 2026.

Transparency log

Release files / axorum_sandbox-0.3.0-py3-none-macosx_11_0_arm64.whl

Download URL axorum_sandbox-0.3.0-py3-none-macosx_11_0_arm64.whl
Size 6.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bf0b22880b26166218097711122cd748972527225c6f84852c6b542fffd02439
BLAKE2b-256 checksum
How to use checksums
ea381b393ea7489224af452dff7d51f82b0d9c5a6d877135c288f27bec518500
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 Oct 12, 2026.

Transparency log

Release files / axorum_sandbox-0.3.0-py3-none-macosx_10_12_x86_64.whl

Download URL axorum_sandbox-0.3.0-py3-none-macosx_10_12_x86_64.whl
Size 6.7 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ff71becb16efee2aed64d667de7d662d6fa3f85ac3ddf91de016bb8995784f43
BLAKE2b-256 checksum
How to use checksums
a498d14e9b65ed07a04d8c31d16b637527054d62714ed206bb472f4e4279e0f7
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 Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

5 release files

0.2.0

5 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