Skip to main content

Cognitive Code Security Engine - Self-evolving, AI-powered threat detection

Project description

🧠 NeuralSpace – Cognitive Security Universe

Python 3.9+ License: MIT PyPI version CI/CD

NeuralSpace is the world's first self-organizing, zero-trust security universe for code. It doesn't just scan for known threats—it builds a living, evolving topology of your codebase where every branch has its own specialized "neural brain."

It combines a Covalent Tree (self-evolving topology), a Hive Mind (emergent intelligence), a Zero-Trust Mesh (cryptographic trust), and AST/CFG Taint Analysis (real data-flow tracking) into a single, ultra-lightweight (~8 KB) system.


🔥 The Problem We Solve

Current Tool Limitation NeuralSpace Advantage
Traditional AV Relies on known signatures. Blocks zero‑day obfuscated threats.
SAST (SonarQube) 99.5% false positives. Contextual detection + Taint Analysis (e.g., requests.get alone is safe; requests.get + exec is a threat).
Transformer Models Huge, slow, cloud‑dependent. Lightweight (~8 KB), runs instantly on CPU.
File Watchers React to files, don't understand content. Routes files dynamically into a living knowledge tree (the Covalent Tree).

✨ Key Features

  • 🧬 Self‑Evolving Topology (The Covalent Tree) – The tree spawns new branches anticipatorily when it detects structural drift (drift velocity > 0.5). It doesn't just classify code; it organizes your codebase into a living taxonomy.
  • 🧠 Distributed Neural Atoms – Each tree branch has its own PureNeuralAtom (512→4→4 network) initialized with a unique seed. This creates specialized "brains" for different code families.
  • 🤝 Hive Mind (Emergent Intelligence) – Multiple agents communicate and form a consensus on threats. The collective intelligence (consensus ≥ 0.7) can override individual node decisions.
  • 🛡️ Zero-Trust Security Mesh – All threat reports are cryptographically signed with RSA. Nodes earn trust over time; low-trust nodes (score < 0.3) are ignored.
  • 🔍 AST/CFG Taint Analysis – Tracks whether tainted data (user input, network data) reaches dangerous sinks (exec, eval, os.system). Real data-flow analysis, not just token matching.
  • 🌍 Polyglot – Scans Python, JavaScript, TypeScript, Go, and Rust (with Tree-Sitter AST parsing).
  • ⚡ Ultra‑Lightweight & Local – Trains in under 60 seconds on a standard CPU. No cloud. No GPU. (~8 KB model).
  • 🤖 GitHub App Integration – Auto‑scans Pull Requests and posts comments with detailed decision traces.
  • 🌐 Federated Intelligence – Global aggregator shares anonymized threat signatures across instances, creating a living immune system.
  • 🗣️ God User Interface – Natural language commands to shape the universe (health, spawn branch, show threats, evolve).

🏗️ How It Works

  1. Tokenization + Taint Analysis – Code is parsed via Tree-Sitter AST, and data-flow taint analysis tracks user input to dangerous sinks.
  2. Routing – The vector descends the Covalent Tree. If it matches a child node (cosine similarity > 0.85), it dives deeper. Otherwise, it stops.
  3. Hive Mind Consensus – All active nodes vote on the threat. The collective decision overrides individual errors.
  4. Judgment – The terminal node's PureNeuralAtom computes two scores:
    • Sentinel (S) – Threat probability (class 3).
    • Logic (L) – Safe probability (class 0).
  5. Enforcement – If S > 0.25 or L < 0.2, the file is quarantined and cryptographically reported.
  6. Evolution – If the file is allowed but deviates significantly (drift velocity > 0.5), the tree anticipatorily fractures and spawns a new child node.

🚀 Quick Start (Global Install)

Installation (One Command)

pip install neuralspace-ai

## Basic Usage

```bash

###  Scan a project folder
neuralspace scan ./your_project --quarantine rename

### Watch a folder in real-time
neuralspace watch ./your_project

###  Sync with the global threat intelligence network
neuralspace sync

### Advanced: Train the AI (Optional)
### The package comes pre-trained. But you can retrain it on your own dataset:

```bash
neuralspace generate
neuralspace train

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuralspace_ai-4.0.0.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuralspace_ai-4.0.0-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

Details for the file neuralspace_ai-4.0.0.tar.gz.

File metadata

  • Download URL: neuralspace_ai-4.0.0.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for neuralspace_ai-4.0.0.tar.gz
Algorithm Hash digest
SHA256 3cd679314d8a56eca5313c8bd0751508cb2738c183261901592870c24911baac
MD5 3b7b5670a4f999b6dc28d2ad3f6c3785
BLAKE2b-256 534baa984e058b925ff6160a69f08d27a7d334e5779fea8f735db1eb3b9233bd

See more details on using hashes here.

File details

Details for the file neuralspace_ai-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: neuralspace_ai-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 40.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for neuralspace_ai-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1059858d1f01ea139ab3981a7e17aed72bbe3a26f651e378db5cbde7d801f0e3
MD5 8d9a6648347e594d404aabecf0c7e4fd
BLAKE2b-256 3abc1ccfc10877ef408fd6aac6c39528c483ed7e762896cc9a4b6d49f11c7b35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page