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.
Metadata
Release files for neuroguard 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| neuroguard-0.1.0.tar.gz | 53.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| neuroguard-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 101.5 kB
Release files / neuroguard-0.1.0.tar.gz
| Download URL | neuroguard-0.1.0.tar.gz |
|---|---|
| Size | 53.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
583116fee650666dd9aed2d154e14577868926d4231513293098a24efbaf0374
|
|
BLAKE2b-256 checksum How to use checksums |
5724b1d57255b3f00322df1b8a83956f2115bb1afa0a10baefe934998bd38913
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / neuroguard-0.1.0-py3-none-any.whl
| Download URL | neuroguard-0.1.0-py3-none-any.whl |
|---|---|
| Size | 47.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c715ba00c940c255e6dc7ac79cf24d9d7dce623e8e05501e95410dbf6727b304
|
|
BLAKE2b-256 checksum How to use checksums |
450a8cea47a42b256f2399c0847e1afb0ed769ceea743469165dc5b03633df1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|