Skip to main content

Mnemox Control

Mnemox Control is a broker-neutral Policy Evaluation Engine for agentic trading. It evaluates an untrusted order intent against an owner policy and sealed account, market, and instrument state, then returns deterministic proof-carrying evidence with 40 ordered rules.

This repository implements the v0.3 Policy Decision Point (PDP). It does not execute trades, hold broker credentials, authenticate policy owners, reserve exposure, or issue single-use order authorizations.

Evaluate a conformance input

import json
from datetime import datetime
from pathlib import Path

from mnemox_control import (
    InstrumentCatalog,
    MarketSnapshot,
    OrderIntent,
    PolicyBundle,
    TrustedAccountSnapshot,
    evaluate,
)

fixture = json.loads(Path("tests/conformance/v0.3/basic-allow.json").read_text(encoding="utf-8"))
inputs = fixture["inputs"]
result = evaluate(
    policy=PolicyBundle.model_validate(inputs["policy"]),
    intent=OrderIntent.model_validate(inputs["intent"]),
    account=TrustedAccountSnapshot.model_validate(inputs["account"]),
    market=MarketSnapshot.model_validate(inputs["market"]),
    instruments=InstrumentCatalog.model_validate(inputs["instruments"]),
    evaluated_at=datetime.fromisoformat(inputs["evaluated_at"].replace("Z", "+00:00")),
)

print(result.decision, result.content_hash)

An ALLOW result must not be sent directly to a broker. It is a static PDP result, not an execution authorization. A production Policy Enforcement Point must verify authority and revocation, atomically reserve capacity, issue and consume a single-use grant, submit idempotently, and reconcile broker truth.

What v0.3 guarantees

  • Pure deterministic evaluation: no clock, storage, network, UUID, or randomness reads.
  • Complete binding to policy, intent, account, market, instrument catalog, state version, and time.
  • Full account-wide worst-case exposure; opposing pending orders never net.
  • Exact Decimal quantities, prices, increments, notionals, and leverage.
  • Known unsupported instruments deny instead of using an incorrect valuation formula.
  • Strict monotonic reduce-only semantics with a data-driven exemption matrix.
  • One structured result for every rule; dependent SKIP requires a prior DENY.
  • DENY outranks ESCALATE, while all triggered evidence remains visible.
  • Byte-identical Apache-licensed conformance vectors for independent implementations.

The full equations, rule order, temporal semantics, and conformance procedure are in docs/protocol/evaluation-v0.2.md. What v0.3 changes on top of it (a required require_protective_stop policy field and four protective-stop reason codes, 36 -> 40) is in docs/protocol/evaluation-v0.3.md. v0.3 is a breaking change: v0.2 policies and conformance vectors do not validate against a v0.3 engine.

Install

pip install mnemox-control

Python 3.12 or newer. The engine is AGPL-3.0-only; see Licensing below. The TradeMemory broker proxy (pip install "tradememory-protocol[proxy]") pulls it in as its policy engine.

Development

Mnemox Control requires Python 3.12 or newer.

python -m venv .venv
.venv\Scripts\python -m pip install -e ".[dev]"
.venv\Scripts\python -m pytest -q
.venv\Scripts\python -m ruff check .
.venv\Scripts\python -m mypy src
.venv\Scripts\python -m build

Hypothesis properties cover exposure monotonicity, pending-risk monotonicity, strict reductions, determinism, hash binding, decision precedence, and input immutability. Conformance tests compare the full result, canonical JSON, and SHA-256 byte for byte.

Security boundary

Content hashes detect mutation but do not prove issuer identity or current authority. v0.3 has no signature verification, policy registry, revocation lookup, atomic reservation, authorization grant, broker adapter, execution receipt, reconciliation service, or coverage proof. These are explicit future PEP/evidence layers, not implied capabilities of this kernel.

Do not place API keys, exchange secrets, broker sessions, or live-order access in this package.

DecisionReceipt remains importable for v0.1 compatibility but is deprecated. New integrations use EvaluationResult.

Licensing

  • Python engine: AGPL-3.0-only, with separate commercial licensing available.
  • Protocol specifications and conformance vectors: Apache License 2.0.
  • Mnemox names and trademarks are excluded except for origin identification.

See LICENSE, COMMERCIAL-LICENSE.md, and docs/protocol/LICENSE.

Metadata

Release files for mnemox-control 0.3.1

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

Source distribution (sdist)

Source distribution for mnemox-control 0.3.1
File Size Uploaded
mnemox_control-0.3.1.tar.gz 91.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mnemox-control 0.3.1
File Interpreter ABI Platform
mnemox_control-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 123.5 kB

Release files / mnemox_control-0.3.1.tar.gz

Download URL mnemox_control-0.3.1.tar.gz
Size 91.6 kB
Tags Source
SHA-256 checksum
How to use checksums
67e4a870726200ae7a73a5e8a807bd68164dc64e62a36b4d9fd78088d20d4690
BLAKE2b-256 checksum
How to use checksums
8a83cb1ae83d489b0a1c672b47f970c210482c3b2942cd6c287f17d76671e21e
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 2, 2026.

Transparency log

Release files / mnemox_control-0.3.1-py3-none-any.whl

Download URL mnemox_control-0.3.1-py3-none-any.whl
Size 31.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb4ffaede2cd2453c5825ae703c7ff8a691117b4d6fa5de252509fe91356140d
BLAKE2b-256 checksum
How to use checksums
0cb931331fa0ab1c677318677aabed18c7c0e2a735f4de50b1b3ba3b8f3c8134
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 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 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