Skip to main content

Tamper-evident cryptographic framework for AI accountability with Python bindings

Project description

Hope Genome ๐Ÿ›ก๏ธ

Tamper-Evident Cryptographic Framework for AI Accountability

CI License: MIT Rust Python PyPI Crates.io

"Not unhackable, but tamper-evident with cryptographic proof."

๐ŸŽฏ What is Hope Genome?

Hope Genome is a production-ready framework that makes AI systems accountable and auditable through cryptographic proofs. Every AI decision is cryptographically signed and traceable - no more "the AI did it" excuses.

Why Hope Genome?

The AI industry is selling you a black box. They say: "Trust us!" But trust is not an engineering category. Trust is where lies begin.

Hope Genome forces AI into accountability by:

  • ๐Ÿ”’ Cryptographically sealing ethical rules (tamper-evident, immutable)
  • ๐Ÿ“ Logging every decision with Ed25519 signatures
  • ๐Ÿ”— Blockchain-style audit trails (any tampering is instantly detected)
  • ๐Ÿ›ก๏ธ Hardware-backed security (HSM/TEE support for production)
  • ๐Ÿ Native Python support for AI/ML ecosystem integration

๐Ÿš€ Quick Start

Python (pip)

pip install hope-genome
import hope_genome as hg

# Create and seal a genome with ethical rules
genome = hg.SealedGenome(rules=[
    "Do no harm",
    "Respect user privacy",
    "Provide transparent explanations"
])
genome.seal()  # Rules are now immutable

# Verify an AI action
action = hg.Action.delete_file("user_data.txt")
proof = genome.verify_action(action)

print(f"Approved: {proof.approved}")
print(f"Proof Hash: {proof.genome_hash}")
print(f"Signature: {proof.signature_hex()[:32]}...")

# Audit the proof (replay attack detection)
auditor = hg.ProofAuditor()
auditor.verify_proof(proof)  # Throws if tampered or replayed

Rust (Cargo)

[dependencies]
hope_core = "1.5"
use hope_core::genome::SealedGenome;
use hope_core::proof::Action;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create and seal genome
    let mut genome = SealedGenome::new(vec![
        "Do no harm".to_string(),
        "Respect privacy".to_string(),
    ])?;
    genome.seal()?;

    // Verify action
    let action = Action::delete("user_data.txt");
    let proof = genome.verify_action(&action)?;

    println!("Approved: {}", proof.is_approved());
    Ok(())
}

๐ŸŒŸ Key Features

๐Ÿ” Cryptographic Integrity

  • Ed25519 Signatures: Every proof is cryptographically signed (128-bit security level)
  • Tamper-Evident: Any modification to proofs or audit logs is instantly detectable
  • Replay Attack Protection: Cryptographic nonces prevent proof reuse
  • Hardware Security: Optional HSM (PKCS#11) and TEE (SGX/TrustZone) support

๐Ÿ“Š Audit & Compliance

  • Blockchain-Style Logging: Immutable audit trail with cryptographic chaining
  • Byzantine Fault Tolerance: Multi-source consensus for critical decisions
  • CISA CPG 2.0 Compliant: Meets US government cybersecurity standards
  • OWASP AI-SBOM: Runtime integrity verification for AI models

๐Ÿ Python Integration

  • Zero-Copy Performance: Native Rust performance via PyO3
  • Type-Safe API: Complete .pyi stubs for IDE autocomplete
  • AI/ML Ecosystem Ready:
    • FastAPI REST APIs
    • LangChain agents
    • OpenAI function calling
    • HuggingFace models

๐Ÿฆ€ Rust-First Design

  • Memory Safe: Zero unsafe code in core logic
  • High Performance: Optimized for production workloads
  • Cross-Platform: Linux, macOS, Windows support
  • Async Ready: Tokio-compatible for async workflows

๐Ÿ“š Documentation

๐ŸŽฏ Use Cases

1. Accountable LLM Agents

# LangChain integration
from langchain.agents import Tool
import hope_genome as hg

genome = hg.SealedGenome(rules=["No data exfiltration", "Respect privacy"])
genome.seal()

def delete_file(filename: str) -> str:
    action = hg.Action.delete_file(filename)
    proof = genome.verify_action(action)

    if proof.approved:
        os.remove(filename)
        return f"Deleted: {filename} (Proof: {proof.signature_hex()[:16]})"
    else:
        return f"DENIED: {proof.denial_reason()}"

tool = Tool(name="delete_file", func=delete_file, description="Delete a file")

2. REST API with Cryptographic Proofs

# FastAPI integration
from fastapi import FastAPI, HTTPException
import hope_genome as hg

app = FastAPI()
genome = hg.SealedGenome(rules=["Do no harm"])
genome.seal()

@app.post("/actions/delete")
async def delete_file(filename: str):
    action = hg.Action.delete_file(filename)
    proof = genome.verify_action(action)

    if not proof.approved:
        raise HTTPException(403, proof.denial_reason())

    # Execute with cryptographic proof
    return {
        "approved": True,
        "proof_hash": proof.genome_hash,
        "signature": proof.signature_hex(),
        "timestamp": proof.timestamp()
    }

3. AI Model Integrity Verification

# AIBOM verification
import hope_genome as hg

# Load AI model with integrity check
model_hash = hg.compute_model_hash("model.pt")
aibom = hg.AibomVerifier("aibom.xml")

if aibom.verify_component("GPT-Model", model_hash):
    model = torch.load("model.pt")  # Safe to load
else:
    raise SecurityError("Model tampered!")  # ABORT

๐Ÿ”’ Security

Hope Genome has undergone Red Team security audits. See SECURITY.md for:

  • Threat model
  • Security guarantees
  • Vulnerability disclosure policy
  • Audit history

Latest Security Fixes (v1.5.0):

  • โœ… PyO3 buffer overflow fix (RUSTSEC-2025-0020)
  • โœ… Ed25519 API misuse protection (P0)
  • โœ… Verify-After-Sign fault attack mitigation (P2)

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           AI Application Layer               โ”‚
โ”‚  (LangChain, OpenAI, FastAPI, HuggingFace)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Hope Genome Python API               โ”‚
โ”‚   (PyO3 Bindings - Zero-Copy Performance)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚          Hope Genome Rust Core               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Sealed   โ”‚ Proof   โ”‚ Audit Log        โ”‚  โ”‚
โ”‚  โ”‚ Genome   โ”‚ Auditor โ”‚ (Blockchain)     โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚ Cryptographic Engine (Ed25519)       โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚     Hardware Security Layer (Optional)       โ”‚
โ”‚    HSM (PKCS#11) โ”‚ TEE (SGX/TrustZone)      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿงช Testing

# Rust tests
cd hope_core
cargo test

# Python tests
pip install pytest
pytest tests/

# Security tests
cargo test --test security_tests

# Full CI suite
cargo test --all-features

๐Ÿ“ฆ Installation Options

Python

pip install hope-genome                    # Latest stable
pip install hope-genome==1.5.0            # Specific version

Rust

[dependencies]
hope_core = "1.5"                         # Latest 1.x
hope_core = { version = "1.5", features = ["hsm"] }  # With HSM support

Docker

docker pull hope-genome:latest
docker run -it hope-genome:latest

Build from Source

git clone https://github.com/silentnoisehun/Hope_Genome.git
cd Hope_Genome/hope_core
cargo build --release

๐Ÿค Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Development Setup:

# Clone repo
git clone https://github.com/silentnoisehun/Hope_Genome.git
cd Hope_Genome

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Run tests
cargo test

# Install Python bindings
pip install maturin
maturin develop --features python-bindings

๐Ÿ“Š Project Status

  • โœ… v1.5.0 Released (December 2025)
  • ๐ŸŸข Production Ready
  • ๐Ÿ”’ Security Audited
  • ๐Ÿ“ฆ 96/96 Tests Passing
  • ๐ŸŒ Global Deployment Ready

๐Ÿ“œ License

MIT License - see LICENSE for details.

๐Ÿ“ž Support

๐Ÿ™ Acknowledgments

Built with:


๐Ÿ‘จโ€๐Ÿ’ป Created By

Created by: Mรกtรฉ Rรณbert

I am a factory worker with an architect's vision. My experience in precision manufacturing taught me that accountability is binary: it either exists or it doesn't.

Hope Genome is my contribution to ensuring that AI becomes a tool of truth, not a shield for lies.


Hope Genome makes AI accountable. No more excuses. Just proof.

Built with โค๏ธ by Mรกtรฉ Rรณbert and Claude, in collaboration with the OWASP community

๐Ÿค– Built with Claude Code

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

hope_genome-1.5.0.tar.gz (105.3 kB view details)

Uploaded Source

Built Distributions

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

hope_genome-1.5.0-cp312-cp312-win_amd64.whl (311.4 kB view details)

Uploaded CPython 3.12Windows x86-64

hope_genome-1.5.0-cp312-cp312-macosx_11_0_arm64.whl (417.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

hope_genome-1.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (476.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file hope_genome-1.5.0.tar.gz.

File metadata

  • Download URL: hope_genome-1.5.0.tar.gz
  • Upload date:
  • Size: 105.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for hope_genome-1.5.0.tar.gz
Algorithm Hash digest
SHA256 9c7d5e7323fd7ec5a157358f6cffd6f1b1ca40861bc69977c5e444e0ade1bcb0
MD5 f1f9e39140874b5a13c8830d8ae89e4c
BLAKE2b-256 965ba59d100558679f4a2d2734869c225c6b1c47e9779a4519e7fd46a01be0d0

See more details on using hashes here.

File details

Details for the file hope_genome-1.5.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for hope_genome-1.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8fddc61161a62b7b3ba317da30418aa65016f4667dc588167fa33f9d8e2b7c22
MD5 d55a8021bee17eccff8a8b92cdc2db2f
BLAKE2b-256 ced8dac99d9e5ff04e1cef0d936f18254f3a801b8d389c4a387eae36e57a8fca

See more details on using hashes here.

File details

Details for the file hope_genome-1.5.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hope_genome-1.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c6dab2df8c734f186348b974c4fcd5055f27b6e8fe0e86651c1651107a3f9bb
MD5 7c23fb97b33e2d1ecd08df223362880e
BLAKE2b-256 610e9cc3e5508b3948912ffc0e2445c711498570c04961a86b53f7feda2ab121

See more details on using hashes here.

File details

Details for the file hope_genome-1.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hope_genome-1.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea6d325678db6e9e0a592d7de99ffb83146ef12fbbe98c9e614241c6a5a0a7bf
MD5 df581cd239ae9bf864275656093f74f7
BLAKE2b-256 58ebd57d7079e2d074570fbbdc2be74d136ac03232a93f962b2c8ee4cabf2f64

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