Metadata-Version: 2.4
Name: maxwells-defense
Version: 0.1.0
Summary: Adaptive proof-of-work defense for AI agents. Asymmetric thermodynamic cost: attackers dissipate, defenders verify in O(1).
Author-email: Viridis Security <viridissecurity1@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/viridis-security/maxwells-defense
Project-URL: Issues, https://github.com/viridis-security/maxwells-defense/issues
Project-URL: Source, https://github.com/viridis-security/maxwells-defense
Keywords: proof-of-work,ai-agents,rate-limiting,captcha,ddos,agent-security,thermodynamics,landauer,viridis-security
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.21; extra == "test"
Provides-Extra: fastapi
Requires-Dist: starlette>=0.27; extra == "fastapi"

# 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

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

## Use

```python
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.
