Ultrastable
Local-first runtime governance for Python agent systems, with deterministic policy checks and bounded evidence without a hosted control plane.
Documentation · Changelog · Security · Contributing
Ultrastable monitors agent runs for budget pressure, repeated output, tool loops, retry churn, and context pressure. It evaluates those signals against explicit viability policies, proposes typed interventions, and records privacy-bounded JSONL events for inspection and fixed-trace rescoring. The core is offline-first and depends only on NumPy and the Python standard library.
Status: beta. Version 0.4.x is suitable for evaluation and controlled integration, but public APIs may still change before 1.0. Read the assurance matrix before using evidence or replay results in a security-sensitive workflow.
Install and verify
Install the minimal package from PyPI:
python -m pip install ultrastable
ultrastable self-check
Expected output:
self-check OK
The self-check runs locally, creates no durable output, calls no external
service, and exercises only APIs and resources shipped in the installed
distribution. Use ultrastable self-check --json for structured diagnostics.
For a visible offline run, install the CLI extra and write a bounded demo ledger:
python -m pip install "ultrastable[cli]"
ultrastable demo budget-cap --output runs/budget-cap.jsonl
ultrastable ledger validate runs/budget-cap.jsonl --hash-chain
The final command checks JSON structure and the ledger's unauthenticated internal-consistency chain. It does not establish who created the file.
What Ultrastable does
agent step metrics
↓
essential variables + viability policy
↓
detectors and controller decision
↓
typed intervention proposal
↓
privacy-bounded ledger and optional exporters
- Tracks tokens, spend, retries, tool calls, context utilization, and health distance with explicit limits.
- Detects lexical repetition, tool loops, repeated failures, context pressure, and predicted budget exhaustion without requiring a remote service.
- Produces typed reset, trim, replan, fallback, backoff, and stop proposals for caller-controlled execution.
- Records schema-versioned run, step, trigger, intervention, and health events.
- Supports strict ledger parsing, fixed-trace policy rescoring, reports, and privacy-bounded evidence bundles.
- Keeps CLI, telemetry, LangChain integration, and robotics dependencies behind optional extras.
Choose an installation
| Goal | Command | Main additions |
|---|---|---|
| Minimal library and installed self-check | python -m pip install ultrastable |
NumPy |
| CLI, demos, and reports | python -m pip install "ultrastable[cli]" |
Rich, Typer |
| Agent guard, CLI, HTTP, and OTLP tooling | python -m pip install "ultrastable[cortex]" |
Pydantic, HTTPX, OpenTelemetry, CLI dependencies |
| Robotics examples and wrappers | python -m pip install "ultrastable[robotics]" |
Gymnasium, Torch |
Extras can be combined. The separately distributed
ultrastable-langchain
connector is an alpha monitor integration: callbacks observe framework events
but cannot prevent an external side effect.
Compatibility and stability
- Python: CPython 3.10–3.14 is release-tested on Linux. Python 3.15 prereleases are an advisory CI signal.
- Platforms: the pure-Python wheel is platform-independent, but safe bundle creation and extraction are enabled only on the tested Linux/filesystem combinations documented in bundle platform support.
- Core dependency boundary: importing
ultrastable.coremust not import Torch, OpenTelemetry, HTTPX, Rich, or Pydantic. - Schemas: event, policy, ledger, benchmark, and evidence formats are versioned independently of the Python API.
- Versioning: releases use PEP 440 versions and
v<version>Git tags. Breaking changes before 1.0 are documented in the changelog and migration guide.
Limitations and non-goals
AgentGuardand framework callbacks are in-process monitors. They propose actions; the caller remains responsible for executing or enforcing them.- JSONL hashes and legacy evidence are
best_effort_unverifiedconsistency evidence, not authentication. A party able to rewrite the complete record can recompute those hashes. - Replay is
fixed_trace_rescoring, not reconstruction of a live agent session or proof of a counterfactual outcome. - Recursive sanitization enforces bounded project privacy rules; it is not a general data-loss-prevention system. Remote export is opt-in.
- The library does not host agents, schedule tools, manage credentials, or replace an application sandbox, authorization layer, or external deadline.
- Robotics support is optional and heavier than the agent-governance core.
See the complete 0.4.4 known limitations and trust boundaries.
Documentation
- Start: quickstart and concepts
- How-to: detectors, interventions, privacy, and LangChain migration
- Reference: public API map, CLI, event schema, and ledger format
- Evidence and assurance: assurance matrix, replay semantics, and security advisory
- Benchmarks and reproducibility: AFMB explanation, run manifests, and repository benchmark policy
- Development: architecture, contribution guide, and release checklist
Work from a source checkout
The repository uses pyproject.toml plus a committed uv.lock. Make is a thin
interface over the same scripts and locked environments used by GitLab CI:
make install
make quality
make test
make test-min
make test-coverage
make docs-check
Run the deterministic AFMB behavior smoke suite with make benchmark-smoke.
Run the repository experiment plan with make experiment-smoke. Generated
ledgers, reports, documentation, distributions, and benchmark runs are ignored;
only their definitions, small reviewed golden references, and release evidence
metadata belong in source control.
Support and development
- Report a bug or request a feature
- Report a vulnerability privately
- Contribute a change
- Read the code of conduct
- Review release history
License and citation
Ultrastable is released under the
MIT License.
For research use, cite the software metadata in
CITATION.cff
and include the exact package version used.
The name acknowledges W. Ross Ashby's work on ultrastability and homeostatic systems. Those ideas motivate the library's essential-variable and viability models; the software does not claim to reproduce Ashby's complete theory.
Metadata
Release files for ultrastable 0.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ultrastable-0.4.4.tar.gz | 265.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ultrastable-0.4.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 501.8 kB
Release files / ultrastable-0.4.4.tar.gz
| Download URL | ultrastable-0.4.4.tar.gz |
|---|---|
| Size | 265.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
42393be1be4c839c4d99b6b5d0510f6478ea398b63c62a9706b3bf0ffc029bcd
|
|
BLAKE2b-256 checksum How to use checksums |
c932b8071980b380fa9a1e11d6420a25c887c3137b61c9460d72546a57e35d22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.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 GitLab CI/CD, verified by PyPI on Aug 30, 2026.
Transparency logRelease files / ultrastable-0.4.4-py3-none-any.whl
| Download URL | ultrastable-0.4.4-py3-none-any.whl |
|---|---|
| Size | 236.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
094a5fd08184227b1948592d4ce6724ff739d8627523509124becab5a27f8fc9
|
|
BLAKE2b-256 checksum How to use checksums |
049be285b6fb0cbdd0908bb0bd77fa70d69b4820eeafa8f6e9ca46345572c453
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.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 GitLab CI/CD, verified by PyPI on Aug 30, 2026.
Transparency log