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 package's examples/ directory in the source repository has a test for each.

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.

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, such as one cargo build -p axorum-sandbox-cli built.

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.2.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.2.0
File
axorum_sandbox-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
axorum_sandbox-0.2.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.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64, Linux glibc 2.17+ ARM64 Details
axorum_sandbox-0.2.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
axorum_sandbox-0.2.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 31.2 MB

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

Download URL axorum_sandbox-0.2.0-py3-none-win_amd64.whl
Size 6.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
075faeb1f2c3ac96a3cb88c742ef5666a5faee2f9df449be34e534b978ea69dd
BLAKE2b-256 checksum
How to use checksums
d80865643ce8e00d7815cf2e9570d8dd1a4127085b23846268cfed51b242bf8b
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 10, 2026.

Transparency log

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

Download URL axorum_sandbox-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64.whl
Size 6.5 MB
Tags Linux glibc 2.17+ x86-64 Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
18183b548bfaf28fbd9ae4a0b962601046454707d33a6654f0fb93b188b21893
BLAKE2b-256 checksum
How to use checksums
337c439e04ac9096907afac14637c4ab20c139e36432e8f591c5916c6e860fcd
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 10, 2026.

Transparency log

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

Download URL axorum_sandbox-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_2_aarch64.whl
Size 6.0 MB
Tags Linux glibc 2.17+ ARM64 Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e68cf418507cf8ee0dce206cbfbaa053aa7416e47b497617cf51e1f8de8b9e73
BLAKE2b-256 checksum
How to use checksums
58aa86760a1a5e92d2ab25a858a3e23a5b0382cef212f870d324380bef695053
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 10, 2026.

Transparency log

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

Download URL axorum_sandbox-0.2.0-py3-none-macosx_11_0_arm64.whl
Size 5.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5bb99e8ef827a000baaf4015aa957313e907d8ee30c18f8f3cb7ba407141b530
BLAKE2b-256 checksum
How to use checksums
450666b8549877b270ab4d9763395c654e9d48996935694fc2138088469e117b
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 10, 2026.

Transparency log

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

Download URL axorum_sandbox-0.2.0-py3-none-macosx_10_12_x86_64.whl
Size 6.3 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
eeb7bc679e79ebc440ece5b1042a259d4aa554741b2d8094fe6abedb1f67350a
BLAKE2b-256 checksum
How to use checksums
e7c7c30cc98aff55964e82ab66e5a494aded449fcf941dead3d849502b5a13cb
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 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

5 release files

This release

0.2.0 This release

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