Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

Neuro-Symbolic AI Guardrail System

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."

Core Architecture

1. Neural Intent Interpreter (LangChain + Gemini 2.5 Flash)

  • 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.

2. Symbolic Source of Truth (OpenCog MeTTa)

  • 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.

3. The Logic Bridge (Python)

  • 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.

Getting Started

Prerequisites

  • Python 3.10+
  • Hyperon MeTTa library

Installation

pip install -r requirements.txt

Configuration

Create 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

Usage

  • Web Interface (Recommended): streamlit run app.py
  • Terminal Interface: python3 main.py
  • Logic Validation: python3 test_metta.py

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages