A professional-grade security framework that bridges neural agency with symbolic formal logic. This system uses Gemini 2.5 Flash to interpret human intent and OpenCog Hyperon (MeTTa) to enforce a verifiable hierarchical "Law."
- Intent Planning: Decomposes complex human requests into atomic security intents.
- API Resilience: Implements a rotation mechanism across multiple Gemini API keys to handle rate limits and suspensions.
- Mock Fallback: Includes a robust rule-based mock extractor for environments without API access.
- Hierarchical AtomSpace: Defines a Directed Acyclic Graph (DAG) of roles (Admin > Manager > Developer > Intern).
- Recursive Logic: Uses recursive graph traversal to deduce permissions through inheritance, proving authority rather than just looking it up.
- Zero-Trust Validation: Cross-references every extracted identity against ground-truth atoms.
- Atomic Rollbacks: Ensures that multi-step requests are executed only if all steps are authorized.
- Explainable Proofs: Provides both formal symbolic traces and human-readable reasoning for every decision.
- Pre-flight Security: Validates resource existence before logical execution to prevent resource injection attacks.
- Python 3.10+
- Hyperon MeTTa library
pip install -r requirements.txtCreate a .env file with your Gemini API keys:
GEMINI_API_KEY_1=your_key_here
GEMINI_API_KEY_2=your_key_here
GEMINI_API_KEY_3=your_key_here- Web Interface (Recommended):
streamlit run app.py - Terminal Interface:
python3 main.py - Logic Validation:
python3 test_metta.py