Skip to main content

Privacy infrastructure library for protecting neural and biometric data on-device

Project description

NeuroGuard

Privacy infrastructure for neural, biometric, and cognitive data.

NeuroGuard protects sensitive data before it leaves the device — with on-device encryption, consent enforcement, and tamper-evident audit logging built into your application at the code level.

Install

pip install git+https://github.com/neuroguardcloud-sys/neuroguard-sdk.git

Quickstart

from neuroguard import NeuralDataCipher, ConsentManager, AuditLogger
from neuroguard.consent import ConsentScope
from neuroguard.audit import AuditAction

# Encrypt on-device before anything else touches the data
cipher = NeuralDataCipher(secret="user-passphrase")
encrypted = cipher.encrypt(b"neural or biometric payload")

# Enforce consent before processing
consent = ConsentManager()
consent.grant(ConsentScope.PROCESSING)
consent.require_consent(ConsentScope.PROCESSING)

# Tamper-evident audit log
audit = AuditLogger()
audit.log(AuditAction.ENCRYPT, actor="app", resource="payload", outcome="success")

Why NeuroGuard

Traditional security protects data after it reaches servers. Neural and biometric data is too sensitive for that model.

NeuroGuard enforces privacy at the point of collection — before any network, framework, or server can see raw data.

Architecture

Component Purpose
NeuralDataCipher On-device AES-128-CBC + HMAC encryption. Key or passphrase-derived via PBKDF2.
ConsentManager Grant, revoke, and enforce consent by scope. Blocks operations if consent is not active.
ConsentLedger Append-only, hash-chained log of every consent event. Tamper-evident. Exportable for auditors.
AuditLogger Structured log entries for every sensitive action — actor, resource, outcome, timestamp.
Local REST API FastAPI server: health, vault, consent, and compliance endpoints. Run locally, integrate anywhere.

Local API

python -m neuroguard.api

Server runs at http://127.0.0.1:8000. API docs at http://127.0.0.1:8000/docs.

Consent Ledger

from neuroguard.consent import ConsentManager, ConsentLedger, ConsentScope

ledger = ConsentLedger()
consent = ConsentManager(consent_ledger=ledger, ledger_user_id="user_123")
consent.grant(ConsentScope.PROCESSING)
consent.revoke(ConsentScope.PROCESSING)

assert ledger.verify_chain() is True
print(ledger.export_json(user_id="user_123"))

Run Tests

pip install -e ".[dev]"
pytest tests/ -v

Project Structure

neuroguard/
├── encryption/    # NeuralDataCipher — AES-128-CBC + HMAC
├── consent/       # ConsentManager, ConsentScope, ConsentLedger
├── audit/         # AuditLogger, AuditEvent, AuditAction
└── api/           # FastAPI local REST API

examples/
└── encrypted_neural_processing.py

tests/
├── test_encryption.py
├── test_consent.py
└── test_audit.py

License

NeuroGuard is released under the Business Source License 1.1.

Free for non-commercial and internal business use. Commercial use requires a license. On 2029-01-01 this software converts to MIT.

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

neuroguard-0.1.0.tar.gz (53.8 kB view details)

Uploaded Source

Built Distribution

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

neuroguard-0.1.0-py3-none-any.whl (47.7 kB view details)

Uploaded Python 3

File details

Details for the file neuroguard-0.1.0.tar.gz.

File metadata

  • Download URL: neuroguard-0.1.0.tar.gz
  • Upload date:
  • Size: 53.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for neuroguard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 583116fee650666dd9aed2d154e14577868926d4231513293098a24efbaf0374
MD5 fda0025f7222686edfe0ef7ef62a3b0a
BLAKE2b-256 5724b1d57255b3f00322df1b8a83956f2115bb1afa0a10baefe934998bd38913

See more details on using hashes here.

File details

Details for the file neuroguard-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: neuroguard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 47.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for neuroguard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c715ba00c940c255e6dc7ac79cf24d9d7dce623e8e05501e95410dbf6727b304
MD5 35c25d641954f358dafa5384121218fb
BLAKE2b-256 450a8cea47a42b256f2399c0847e1afb0ed769ceea743469165dc5b03633df1a

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