ChainSafe/rag-privacy

Rust

0

327 commits

updated Jul 14, 2026

See the code

README

private-rag

Rust workspace for a working retrieval-only private RAG stack: a regulated client outsources a confidential corpus to an untrusted cloud, queries it interactively, and gets ranked results back — without the cloud seeing plaintext text, plaintext embeddings, or which document matched.

The stack composes an attested SEV-SNP CVM, a per-forward orthogonal-mask split-inference protocol (GELO) against a commodity Vulkan GPU, and distance-preserving ciphertext (CAPRISE) at rest. Extends end-to-end to private LightRAG retrieval over Ring-ORAM + XorMM volume-hiding multimaps.

Design and measurement docs: https://nulltea.github.io/rag-privacy/

Workspace layout

craterole
crates/coreshared types, CAPRISE / AES-GCM, two-party HKDF, in-memory encrypted index
crates/gelo-protocolTrustedExecutor / GpuOffloadEngine traits + per-forward mask · shield · U-Verify · HD₃
crates/gelo-gpu-wgpuVulkan offload engine (WgpuVulkanEngine)
crates/gelo-embeddermasked BERT / Qwen3 embedder + decoder substrate
crates/gelo-rerankercross-encoder & causal-LM-discriminator reranker under the same mask
crates/gelo-ragorchestration · GeloRagTwoPartyService · LightRagTwoPartyService
crates/gelo-tee-sev-snpSEV-SNP attestation issuer + verifier · RATLS plumbing
crates/gelo-snp-runneraxum service binding all of the above
crates/ring-oramRing-ORAM semi-honest baseline + treetop cache
crates/compass-indexCompass over Ring-ORAM + Directional Filter (HNSW-ORAM)
crates/xormm-emmXorMM volume-hiding encrypted multi-map
crates/compass-rest-backendaxum + sled untrusted storage server for Compass
crates/light-kg-storeLightRAG-shaped storage facade · 3× CompassIndex + 2× XorMM + AES chunks
crates/lightrag-privateRust port of LightRAG kg_query (Local + Hybrid modes)
crates/graphrag-benchend-to-end stage-timed bench harness
evals/aloepri-attacksstatic-weight obfuscation attack-resistance harness (see below)

Commands

cargo test
cargo test -- --ignored        # downloads embedding model via fastembed

AloePri attack harness

evals/aloepri-attacks/ ports the AloePri attack suite from vendor/aloepri-py/src/security_qwen/ and runs it against an obfuscated Qwen3-1.7B GGUF served by a patched llama-server. Captures observables, runs prompt-inversion attacks against them. Measured results in docs/prototype/aloepri-llm.html; operator runbook in evals/aloepri-attacks/README.md.

The patched llama-server builds from the vendor/llama.cpp submodule, pinned at github.com/nulltea/llama.cpp branch m2_7-tensor-dump (upstream ggml-org/llama.cpp master + one commit adding --tensor-filter REGEX and --tensor-dump-path FILE):

git submodule update --init --recursive vendor/llama.cpp
docker build \
    -f evals/aloepri-attacks/m2_7/vulkan-m2_7.Dockerfile \
    -t aloepri-llama-server:latest \
    vendor/llama.cpp

Fresh clones get the patched source directly — no manual patch-apply step. Rebase recipe for bumping the fork onto newer upstream is in the eval's README.

Contributors

nulltea

327 commits

ChainSafe/rag-privacy

Rust

0

327 commits

updated Jul 14, 2026

See the code

README

private-rag

Rust workspace for a working retrieval-only private RAG stack: a regulated client outsources a confidential corpus to an untrusted cloud, queries it interactively, and gets ranked results back — without the cloud seeing plaintext text, plaintext embeddings, or which document matched.

The stack composes an attested SEV-SNP CVM, a per-forward orthogonal-mask split-inference protocol (GELO) against a commodity Vulkan GPU, and distance-preserving ciphertext (CAPRISE) at rest. Extends end-to-end to private LightRAG retrieval over Ring-ORAM + XorMM volume-hiding multimaps.

Design and measurement docs: https://nulltea.github.io/rag-privacy/

Workspace layout

craterole
crates/coreshared types, CAPRISE / AES-GCM, two-party HKDF, in-memory encrypted index
crates/gelo-protocolTrustedExecutor / GpuOffloadEngine traits + per-forward mask · shield · U-Verify · HD₃
crates/gelo-gpu-wgpuVulkan offload engine (WgpuVulkanEngine)
crates/gelo-embeddermasked BERT / Qwen3 embedder + decoder substrate
crates/gelo-rerankercross-encoder & causal-LM-discriminator reranker under the same mask
crates/gelo-ragorchestration · GeloRagTwoPartyService · LightRagTwoPartyService
crates/gelo-tee-sev-snpSEV-SNP attestation issuer + verifier · RATLS plumbing
crates/gelo-snp-runneraxum service binding all of the above
crates/ring-oramRing-ORAM semi-honest baseline + treetop cache
crates/compass-indexCompass over Ring-ORAM + Directional Filter (HNSW-ORAM)
crates/xormm-emmXorMM volume-hiding encrypted multi-map
crates/compass-rest-backendaxum + sled untrusted storage server for Compass
crates/light-kg-storeLightRAG-shaped storage facade · 3× CompassIndex + 2× XorMM + AES chunks
crates/lightrag-privateRust port of LightRAG kg_query (Local + Hybrid modes)
crates/graphrag-benchend-to-end stage-timed bench harness
evals/aloepri-attacksstatic-weight obfuscation attack-resistance harness (see below)

Commands

cargo test
cargo test -- --ignored        # downloads embedding model via fastembed

AloePri attack harness

evals/aloepri-attacks/ ports the AloePri attack suite from vendor/aloepri-py/src/security_qwen/ and runs it against an obfuscated Qwen3-1.7B GGUF served by a patched llama-server. Captures observables, runs prompt-inversion attacks against them. Measured results in docs/prototype/aloepri-llm.html; operator runbook in evals/aloepri-attacks/README.md.

The patched llama-server builds from the vendor/llama.cpp submodule, pinned at github.com/nulltea/llama.cpp branch m2_7-tensor-dump (upstream ggml-org/llama.cpp master + one commit adding --tensor-filter REGEX and --tensor-dump-path FILE):

git submodule update --init --recursive vendor/llama.cpp
docker build \
    -f evals/aloepri-attacks/m2_7/vulkan-m2_7.Dockerfile \
    -t aloepri-llama-server:latest \
    vendor/llama.cpp

Fresh clones get the patched source directly — no manual patch-apply step. Rebase recipe for bumping the fork onto newer upstream is in the eval's README.

Contributors

nulltea

327 commits

Languages

Rust

73.4%

Python

25.4%