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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2e27646ceb64ffd1c9105ae7f53cb4a1dfaadd4e8dbb3ead564103c40ba3ba8
|
|
| MD5 |
c8c4aac3c9c72250429b899530214bde
|
|
| BLAKE2b-256 |
459a625c27a177a89cb165f462572fd1d1fd97a132e1e8813c1ba5c42bb70e42
|
File details
Details for the file maxwells_defense-0.1.0-py3-none-any.whl.
File metadata
- Download URL: maxwells_defense-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d201ca74e3a35e8aef21a09ea2d5dbbc7cfd4b71261a1fdcd6b059aa83c8150d
|
|
| MD5 |
5c38277c5f8ccb9b455113caee2a1a34
|
|
| BLAKE2b-256 |
1b8f9a344ffe56b602e0a764dc624f1a43912d4cd61c0864d0d553275d04c240
|