Skip to main content

Adaptive proof-of-work defense for AI agents. Asymmetric thermodynamic cost: attackers dissipate, defenders verify in O(1).

Project description

maxwells-defense (Python)

Adaptive proof-of-work defense for AI agents. Asymmetric thermodynamic cost: attackers dissipate energy in O(2^d) expected work; defenders verify in O(1).

Reference implementation of T-IB-09 (Adversarial Dissipation Theorem) from the Intelligence Bound corpus — Aristotle-verified 2026-05-10.

Install

pip install git+https://github.com/viridis-security/maxwells-defense.git

Use

from fastapi import FastAPI
from maxwells_defense.middleware import FastAPIMaxwellMiddleware
from maxwells_defense.core import StaticDifficultyOracle
import secrets

app = FastAPI()
app.add_middleware(
    FastAPIMaxwellMiddleware,
    server_secret=secrets.token_bytes(32),
    difficulty_oracle=StaticDifficultyOracle(difficulty=18),
    protect_path_prefix="/api/",
)

@app.get("/api/hello")
def hello():
    return {"ok": True}

Full documentation, theorems, and the JavaScript client live in the parent reference SDK:

https://github.com/viridis-security/maxwells-defense

License

Apache-2.0. See LICENSE in the parent repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maxwells_defense-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maxwells_defense-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file maxwells_defense-0.1.0.tar.gz.

File metadata

  • Download URL: maxwells_defense-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for maxwells_defense-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e2e27646ceb64ffd1c9105ae7f53cb4a1dfaadd4e8dbb3ead564103c40ba3ba8
MD5 c8c4aac3c9c72250429b899530214bde
BLAKE2b-256 459a625c27a177a89cb165f462572fd1d1fd97a132e1e8813c1ba5c42bb70e42

See more details on using hashes here.

File details

Details for the file maxwells_defense-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for maxwells_defense-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d201ca74e3a35e8aef21a09ea2d5dbbc7cfd4b71261a1fdcd6b059aa83c8150d
MD5 5c38277c5f8ccb9b455113caee2a1a34
BLAKE2b-256 1b8f9a344ffe56b602e0a764dc624f1a43912d4cd61c0864d0d553275d04c240

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page