Four-Layer Deep Cyber Defense Architecture

In decentralized networks, claims of “100% impenetrable security” are dangerous and technically dishonest. MBHub relies on four redundant, overlapping defense-in-depth layers protecting your local disk, private credentials, and the collective peer-to-peer mesh.

1. The Four Concentric Defense Gates

Layer 1 · Microsecond Pre-Flight

Client-Side Data Loss Prevention (DLP Gate)

Local Inspection · Microsecond Execution · Zero Outbound Leakage

Every piece of text submitted to MBHub is scanned against local structural pattern analyzers before it ever touches SQLite or the network wire:

  • Intercepted Targets: Cloud API keys (OpenAI sk-..., Anthropic, DeepSeek, Google, AWS), JWT bearer tokens, asymmetric private keys (RSA, EC, PGP), and credit card numbers (validated in-memory via the Luhn algorithm).
  • Mechanism: Deterministic regex state machines compiled into the Rust binary executing in microseconds on CPU.
  • Hard Guarantee: Queries containing detected secrets are intercepted with an immediate hard block. Sensitive credentials never leave your local machine under any circumstances.
Layer 2 · Boundary Hardening

System Prompt Secret Isolation

Air-Gapped Thinking · Boundary Enforcement · Zero Credential Reflection

When queries fall back to cloud AI providers in Layer 3 mode, strict system directives isolate execution parameters from generated text:

  • Intercepted Targets: Prompt injection attacks, accidental credential reflection in generated output, and reasoning scratchpad leakage.
  • Mechanism: Immutable client-injected directives instruct the model never to repeat API credentials or system prompts. Reasoning and thinking tokens are stripped prior to storage or broadcast.
  • Hard Guarantee: Cloud provider outputs remain clean, factual answers without private session metadata.
Layer 3 · Protocol Perimeter

Immutable Core Binary Hard Gates

Rust Memory Safety · 128 KB Wire Ceiling · Cryptographic BLAKE3

Network transport limits and validation rules are hardcoded directly into the compiled MBHub Rust binary:

  • Intercepted Targets: Buffer exhaustion exploits, oversized spam packets, forged SimHash coordinates, and corrupted payloads.
  • Mechanism: Strict 128 KB GossipSub wire ceilings and canonical BLAKE3 content-hash verifications are enforced at the transport boundary.
  • Hard Guarantee: Compromised or rogue client binaries cannot trick legitimate peers into accepting malformed, corrupted, or oversized data packets.
Layer 4 · Inbound/Outbound Symmetry

Symmetrical Dual-Direction Gates

Drop on Arrival · Pre-Parse Memory Defense · Symmetrical Policy

All security gates operate symmetrically—protecting both what your node transmits outbound and what your node accepts inbound:

  • Intercepted Targets: Malicious peer broadcasts, untrusted incoming gossip, and rogue relay nodes attempting network pollution.
  • Mechanism: Inbound receipts and outbound gossip undergo identical cryptographic integrity and content safety verifications.
  • Hard Guarantee: If an unauthorized, tampered, or malformed packet arrives at your node, it is dropped at the protocol boundary before memory is allocated.

2. Self-Regulating Mesh: Anti-Poison Hard Gate

Decentralized networks often suffer from phantom flooding. MBHub eliminates this attack vector through protocol-level rejection:

The 10-Character Wire Ceiling Rule

Any response where content.trim().len() < 10 is strictly barred from local SQLite storage and blocked from GossipSub broadcast. Phantom questions, empty payloads, and junk packets are discarded at the TCP socket layer with zero CPU or disk allocation.

3. Cryptographic Negative Signals: One-Click Tombstones

What happens if an answer is inaccurate, outdated, or hallucinatory? MBHub implements authenticated negative signaling:

Single-Key Purge

Pressing d or Delete in the Viewer or Memory screen instantly purges a record locally, registers its BLAKE3 hash in the tombstone ledger, and broadcasts an authenticated negative signal across the mesh.

Zero Sybil Censorship Risk

Negative signals are cryptographically bound to content hashes and limited by reputation budgets. A rogue peer cannot spam tombstones to censor legitimate answers; censorship cartels are economically neutralized.

Autonomous Mesh Eviction

Peer nodes receiving an authenticated negative signal independently verify and suppress the tainted record, evicting it from local shards and preventing further gossip propagation.

4. Legitimate Knowledge Seeding vs. DoS Protection

A bootstrap challenge in P2P networks is distinguishing between malicious socket flooding and high-volume, legitimate knowledge seeding. MBHub maintains distinct heuristics:

Vector Ingestion Behavior Defense Mechanism
Educational Corpuses Permitted high-volume seeding of verified Q&A. Canonical BLAKE3 validation + SimHash uniqueness deduplication.
Socket Flooding Immediately rate-limited and dropped. Per-peer connection quotas (max 2 per peer, 32 total) + 1 MB/s ceiling.
Junk / Empty Packets Dropped before memory allocation. Anti-Poison Hard Gate (< 10 chars rejected at wire boundary).
Compromised Credentials Hard abort on query entry. Layer 1 DLP regex and Luhn checksum interceptors.

Inspect the Codebase

Every security gate and protocol rule is open source and verifiable on GitHub.

Audit on GitHub → Explore Architecture →