Metadata-Version: 2.4
Name: nexus-gate
Version: 0.1.0
Summary: Mathematical verification gate for AI agent actions
License: MIT
Project-URL: Homepage, https://github.com/nexus-gate/nexus
Project-URL: Documentation, https://github.com/nexus-gate/nexus#readme
Project-URL: Repository, https://github.com/nexus-gate/nexus
Keywords: ai,agents,verification,proof,safety,llm,mcp
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: ollama
Requires-Dist: requests>=2.28; extra == "ollama"
Provides-Extra: api
Requires-Dist: fastapi>=0.100; extra == "api"
Requires-Dist: uvicorn>=0.20; extra == "api"
Dynamic: license-file

# ⬡ Nexus Gate

**Mathematical verification layer for AI agent actions.**

The LLM decides *what* to do. Nexus proves *why* it's safe. Not statistics. Derivation paths.

## Install

```bash
pip install nexus-gate
```

## Quick Start

```python
from nexus_gate_pkg import NexusFullGate

gate = NexusFullGate()
gate.build_knowledge()  # ~17 seconds, once

decision = gate.check("merge inbox with archive")
print(decision.verdict)      # VERIFIED
print(decision.confidence)   # 100

decision = gate.check("launch nuclear missiles")
print(decision.verdict)      # NO_MATCH — no proof exists
```

## 16 Operations · 19 Properties · 100% Proven

| Category | Operation | Proof | Steps |
|----------|-----------|-------|-------|
| CRUD | read | read(A) = A | 4 |
| CRUD | create | count + 1 | 6 |
| CRUD | update | count preserved | 5 |
| CRUD | delete | count → 0 | 4 |
| Data | send | count − 1 | 1 |
| Data | merge | count(A) + count(B) | 6 |
| Data | copy | copy(A) = A | 4 |
| Data | move | total preserved | 6 |
| Transform | transform | count preserved | 5 |
| Transform | filter | count ≤ input | 5 |
| Transform | sort | count preserved | 5 |
| Transform | aggregate | processes all | 6 |
| Auth | grant | access + 1 | 6 |
| Auth | revoke | access → 0 | 4 |
| Workflow | schedule | queue + 1 | 6 |
| Workflow | execute | queue − 1 | 1 |

## Use with Ollama

```bash
pip install nexus-gate[ollama]
ollama serve
python -m nexus_gate_pkg.nexus_ollama --model llama3.2
```

## Use with LangChain / CrewAI / MCP

```python
from nexus_gate_pkg import NexusFullGate

gate = NexusFullGate()
gate.build_knowledge()

# In your agent's tool handler:
decision = gate.check("delete expired sessions")
if decision.verdict == "VERIFIED":
    execute()
else:
    ask_human()
```

## License

MIT
