Skip to main content
Pre-release

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

ContextOS for Python

Two modules, one package:

  • contextos.client (and contextos.aio for asyncio) talks to contextosd over HTTP. Standard library only: no compiled code, no dependencies.
  • contextos itself is the kernel, in-process, through a compiled extension (contextos._native). You need it only to embed the kernel without a server.

python -m contextos.replay replays recorded tool calls through a gateway and reports what it would have refused, held or sent for approval (example).

Install

pip install --pre contextos-client

Published on PyPI as contextos-client from 0.1.0-alpha.13; the module is still import contextos. Linux (x86_64 and aarch64, glibc 2.28 or newer) and macOS on Apple silicon get a wheel with the compiled kernel. Every other platform gets a pure-Python wheel with the HTTP client only; kernel calls there raise native_unavailable. Use the client release that matches your contextosd: before its first admission the client warns (VersionMismatchWarning) when the server is another release, and refuses (IncompatibleServer) a server with another API generation.

The HTTP client (most agents)

From a checkout instead of the package index, put the package on your path or copy bindings/python/contextos/ into your project:

export PYTHONPATH=/path/to/ContextOS/bindings/python
python3 -c "from contextos.client import Client; print('ok')"

Try it against a local server: ./examples/dev-server.sh prints CONTEXTOS_URL and CONTEXTOS_TOKEN, and examples/support-refund/requests/run.json is a run you can admit. examples/frameworks/ shows the client inside eleven agent frameworks.

run.check_tool_call(capability_id, args, ...) answers what run.call_tool would do with the same call (allowed, approval_required, escalation_required, blocked or rejected, with reason codes and obligations) without effect: nothing is requested, reserved or sent, and the check is audited. It is advisory; not_evaluated names what only dispatch decides.

client.plan(pack_ref, run_context, intent=None) (compile scope) answers, before any request, what a pack lets that principal do: each rule applies always, or when / unless a residual condition over request.* holds. client.reload_packs() (control scope) has the server re-read its pack sources and add new versions.

The embedded kernel

The platform wheels above include it. To build the extension yourself, use maturin (needs the Rust toolchain):

python3 -m pip install maturin
python3 -m pip install ./bindings/python    # or: cd bindings/python && maturin develop
python3 -c "import contextos; print(contextos.__version__)"

Without it, import contextos still works for the client; kernel calls raise an error that says to build the extension.

Metadata

Release files for contextos-client 0.1.0a21

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 contextos-client 0.1.0a21
File Actions
contextos_client-0.1.0a21-py3-none-any.whl Python 3 none any Details for contextos_client-0.1.0a21-py3-none-any.whl
contextos_client-0.1.0a21-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details for contextos_client-0.1.0a21-cp39-abi3-manylinux_2_28_x86_64.whl
contextos_client-0.1.0a21-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details for contextos_client-0.1.0a21-cp39-abi3-manylinux_2_28_aarch64.whl
contextos_client-0.1.0a21-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for contextos_client-0.1.0a21-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 10.8 MB

Release files / contextos_client-0.1.0a21-py3-none-any.whl

Download URL contextos_client-0.1.0a21-py3-none-any.whl
Size 33.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5d36b342ef3b708e004f2b32184e7e12f2f7b5195c1c3a4a9a2e290542c2755
BLAKE2b-256 checksum
How to use checksums
5769dac0ae0bf34bf32bb4f01a148618b79300635d48bc1d273342258f9d75d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Release files / contextos_client-0.1.0a21-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL contextos_client-0.1.0a21-cp39-abi3-manylinux_2_28_x86_64.whl
Size 3.8 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
480b9529e86b1f64dc5ca02aeb3b19c6d17cd8d3629d1fafa283c0f8561bc9cd
BLAKE2b-256 checksum
How to use checksums
108d0d507cb753a3f74f921dbe0aee971174d7471f33e3b567cb7e6f87831060
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Release files / contextos_client-0.1.0a21-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL contextos_client-0.1.0a21-cp39-abi3-manylinux_2_28_aarch64.whl
Size 3.6 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
055019a2fd85cd0b82f1026f850529523792b04099c36902bdeece04e2ffd1b6
BLAKE2b-256 checksum
How to use checksums
f38b9cfbbf931aa1ffefabec32591e150f81ce2fe84ffbed73ee9c9102c7c136
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Release files / contextos_client-0.1.0a21-cp39-abi3-macosx_11_0_arm64.whl

Download URL contextos_client-0.1.0a21-cp39-abi3-macosx_11_0_arm64.whl
Size 3.4 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ae66df58802f37daea099426abd194801d6a99432afdce754301f5cff5e8ef46
BLAKE2b-256 checksum
How to use checksums
3090f12e34683aa519d24c2b3fb40dbc4189e73e14ced9cc503c3a7ea04569dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Security for contextos-client 0.1.0a21

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.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for contextos_client-0.1.0a21-py3-none-any.whl

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 Nov 14, 2026.

Transparency log

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.

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