Back to Projects
BooleanSetGates: A Set-Theoretic Neuro-Symbolic Orchestrator for Deterministic Policy Gating and Privacy-Preserving Agentic Workflows
Agent Building
5 min read
PythonNeuro-Symbolic AIAgent GovernanceSet TheoryPrivacy-Preserving

BooleanSetGates: A Set-Theoretic Neuro-Symbolic Orchestrator for Deterministic Policy Gating and Privacy-Preserving Agentic Workflows

Project Overview

BooleanSetGates: Set-Theoretic Neuro-Symbolic Orchestrator

1. Executive Summary

As Large Language Models (LLMs) and autonomous agents are increasingly deployed in high-stakes enterprise, legal, and clinical settings, organizations face a critical barrier: the fundamental conflict between the probabilistic nature of transformer architectures and the deterministic demands of business and regulatory compliance.

Purely neural systems struggle with several systemic failure modes:

  • Logical and Semantic Hallucinations: Autoregressive models are designed for next-token prediction, not strict logical calculation. This leads to "operational drift," "scope laundering" (generating plausible-sounding reasoning without actually applying constraints), and logical contradictions.
  • Security and Excess Agency Vulnerabilities: Standard prompts and runtime system instructions are inherently vulnerable to adversarial manipulation, prompt injection, and jailbreaks. Under adversarial pressure, models routinely bypass their own internal constraints, triggering unauthorized actions or data exposures.
  • Data Privacy and Leakage Risks: Integrating LLMs directly into workflows containing sensitive information—such as protected health information (PHI) or proprietary research—requires sending raw data to external cloud APIs, violating regulatory frameworks like GDPR or HIPAA.
  • Latent Operational Costs: Processing hundreds of dense policy pages within an LLM’s context window for every decision scales token consumption quadratically, inflating inference costs and introducing unacceptable operational latency.
  • Existing runtime guardrail frameworks (such as NVIDIA NeMo Guardrails or Guardrails AI) rely on probabilistic classifiers or keyword filters that are easily bypassed and fail to guarantee absolute regulatory compliance.

    2. Idea but not re-inventing the wheel: The Neuro-Symbolic Middleware Orchestrator

    BooleanSetGates addresses these challenges by introducing a neuro-symbolic "sandwich" architecture that completely decouples natural language processing from logical policy execution. Instead of relying on the LLM to understand and enforce policy rules dynamically, BooleanSetGates compiles human-readable policies offline into an immutable, deterministic execution layer composed of strict Boolean algebraic gates (such as AND, OR, NOR, and MUTUALLY EXCLUSIVE / XOR).

    BooleanSetGates Architecture Workflow

    The system operates in three distinct phases managed by a central Orchestrator:

    Phase A: Forward Compilation & Round-Trip Validation

    An offline, high-capacity model acts as a semantic parser, decomposing complex natural language regulations into structured Abstract Syntax Trees (ASTs). To guarantee that the compiler itself has not hallucinated or altered the logic, BooleanSetGates runs a Round-Trip Reconstruction with Self-Refinement loop:

  • The logical code is immediately translated back into English ($NL_{recon}$) by an independent, constrained logic-to-text prompt.
  • A deterministic validator compares $NL_{recon}$ with the original policy text using semantic embedding similarity and entities-constraint alignment.
  • If semantic similarity falls below a threshold ($ au < 90%$), a structured JSON critique of the logical deviation is returned to the compiler for iterative refinement.
  • Phase B: On-Premises, Zero-Exposure Fact Extraction

    During online execution, raw sensitive text is processed entirely locally. The orchestrator uses lightweight on-premises tools (such as regex-based templates or specialized spaCy Named Entity Recognition models) to extract key operational values. For instance, a patient’s record is parsed to determine if Age >= 18 ($X_1$) and Has_Cardiovascular_History ($X_2$).

    Phase C: Local Symbolic Evaluation

    The instantiated boolean variables are evaluated using a deterministic local solver (such as PySAT or an offline SMT-solver). The cloud-based orchestrating LLM never sees the raw sensitive text or variables. It only receives a sanitized, abstract boolean outcome and corresponding compliance flags (e.g., Refuse_Action: True or Safety_Alert: 4), using the model purely for final linguistic coordination and response formatting.

    3. Added Set-Theoretic Optimizations

    To scale this system to handle thousands of complex, overlapping, and potentially conflicting regulatory rules across enterprise databases, BooleanSetGates integrates mathematical Set Theory to optimize both reasoning accuracy and computational processing speed.

    1. Global Conflict Resolution via Formal Concept Analysis (FCA)

    When hundreds of business or clinical rules are ingested, BooleanSetGates structures them as a Formal Context—a binary mathematical matrix ($K = (G, M, I)$) where $G$ represents the set of policy rules, $M$ represents the set of extracted semantic variables, and $I$ defines the incidence relation (which rules require which variables).

    FCA computes a complete, hierarchical Concept Lattice:

  • Structural Consistency: The lattice organizes rules in a strict topological order of generality and specificity.
  • Pre-deployment Verification: By analyzing the intersections of rule intents, the orchestrator mathematically identifies and flags overlapping rules, circular logic, or outright contradictions (e.g., if the intersection of two active constraints collapses into an impossible empty set $emptyset$) before the rules are ever deployed.
  • 2. Logic Minimization & Factorization

    Overlapping policies frequently contain redundant logical conditions. For example, multiple medical protocols might independently check for age, fasting state, and blood pressure. BooleanSetGates uses heuristic logic minimization algorithms (such as the Espresso heuristic minimizer) to optimize multi-level logic:

  • It factors out common logical subsets (e.g., if multiple rules share a sub-clause $P = A land B$, the orchestrator calculates $P$ once and caches it). This eliminates redundant evaluations, reducing computation steps exponentially.
  • 3. High-Speed Bitwise State Vector Execution

    Rather than interpreting nested conditional loops or running continuous logical deductions at runtime, BooleanSetGates maps the compiled rules into compact State Vectors—mathematical sets representing all valid truth-table assignments for a given policy.

  • At runtime, the local extraction engine populates a binary state bitset (e.g., [1, 1, 0]) for the incoming document.
  • Evaluating compliance is reduced to a simple, deterministic bitwise intersection (AND operation) between the document's state vector and the compiled rule vector masks.
  • Because bitwise operations execute directly on the CPU registers in fractions of a microsecond, the engine achieves database-level execution speeds, dropping latency and eliminating the massive token overhead associated with running text-heavy rules through an LLM.
  • Specifications

    Tech Stack

    PythonNeuro-Symbolic AIAgent GovernanceSet TheoryPrivacy-Preserving
    DomainAgent Building
    StatusActive Production
    Date Released2026
    Hardware BaseCUDA GPU Nodes

    Need help in research integration?

    Get in touch to discuss specialized development and consulting opportunities.