Abir-Guard v3.1.0 — Quantum-Resilient Agentic Vault for AI Agent Memory
- Legacy memory storage is a ticking time bomb.
+ Abir-Guard: The Quantum-Resilient "Black Box" for Autonomous Agent Memory.
At a Glance
| Category | Highlights |
|---|---|
| Quantum-Safe | ML-KEM-1024 (production-ready), ML-DSA-65, X25519 hybrid KEM, AES-256-GCM envelope encryption |
| Multi-Language | Python SDK, Rust CLI + Library, Go SDK, JavaScript SDK |
| AI Native | LangChain tools, CrewAI agents, MCP JSON-RPC server, HTTP MCP API |
| Hardened | FIPS 140-3 mode, key revocation (CRL), auto rotation, remote attestation, differential privacy, canary honeypots, tamper-evident audit logs |
| Hardware Ready | YubiKey/FIDO2, TPM 2.0 seal/unseal, Apple Secure Enclave, Intel SGX detection, HSM integration, zero-copy memory policy, Argon2id KDF (OWASP params) |
| Tested | 109 unit tests pass across all languages, CI/CD pipeline, dependabot |
System Architecture
graph TB
subgraph "AI Agent"
A1[LangChain Agent]
A2[CrewAI Agent]
A3[Custom MCP Client]
end
subgraph "Abir-Guard Vault"
subgraph "Encryption Engine"
E1[AES-256-GCM]
E2[X25519 ECDH]
E3[ML-KEM-1024]
E4[HKDF / Argon2id]
end
subgraph "Security Layer"
S1[Key Revocation CRL]
S2[Auto Key Rotation]
S3[FIPS 140-3 Mode]
S4[Differential Privacy]
S5[Remote Attestation]
S6[Canary Honeypots]
end
subgraph "Persistence"
P1[Encrypted Disk Vault]
P2[SHAMIR Secret Sharing]
P3[HSM / TPM Storage]
end
subgraph "Signatures"
G1[ML-DSA-65 Signing]
G2[Audit Hash Chain]
end
end
A1 -->|encrypt/decrypt| E1
A2 -->|encrypt/decrypt| E1
A3 -->|JSON-RPC| E1
E1 --> S1
E1 --> S2
E1 --> S3
E1 --> S4
E1 --> S5
E1 --> S6
S1 --> P1
S2 --> P1
S3 --> P1
S4 --> P1
P1 --> G2
P2 --> P3
P1 --> G1
Table of Contents
- Overview
- Use Cases
- Prerequisites & Installation
- Quick Start
- Python SDK Guide
- Rust CLI & Library Guide
- Go SDK Guide
- JavaScript SDK Guide
- MCP Server Guide
- LangChain & CrewAI Integration
- Docker Deployment
- HSM & TPM Integration
- Quantum Readiness
- Security Architecture
- Run Tests
- Project Structure
- Roadmap
- Contributing
- License
- Developer
Overview
Abir-Guard is a production-grade, quantum-resistant encryption vault built for AI agent memory and sensitive data protection. It implements NIST-standard Post-Quantum Cryptography (PQC) to defend against Harvest Now, Decrypt Later (HNDL) attacks — where adversaries collect encrypted data today to decrypt once quantum computers become powerful enough.
Three-phase implementation:
- Bedrock — Hybrid KEM, AES-256-GCM, zero-copy memory, MCP server, LangChain/CrewAI SDKs
- Hardware & Security — ML-DSA-65 signatures, SHAMIR secret sharing, Argon2id KDF, HSM/TPM
- Ecosystem & Hardening — Key revocation (CRL), auto rotation, FIPS 140-3 mode, differential privacy, remote attestation, Go SDK
Written in three languages for maximum portability: Python for AI agent integration, Rust for high-performance cryptography, Go for infrastructure tooling, and JavaScript for browser and Node.js environments.
Use Cases
1. Protecting AI Agent API Keys
AI agents frequently handle API keys, OAuth tokens, and service credentials. Abir-Guard encrypts these at rest and in memory, ensuring no raw secrets leak through memory dumps, swap files, or process inspection.
2. Secure Agent-to-Agent Communication
Use the MCP JSON-RPC server as a local encryption gateway. Agents send plaintext to the server; encryption happens locally without exposing data to LLM context or consuming tokens.
3. Regulatory Compliance (FIPS 140-3)
Enable strict FIPS mode to enforce NIST-approved algorithms only, block non-compliant fallbacks, enforce minimum key lengths, and maintain audit trails for compliance audits.
=
=
4. Multi-Party Key Recovery (SHAMIR)
Split master secrets across trusted parties. A 3-of-5 SHAMIR scheme means any three administrators can reconstruct the master key, but fewer than three learn nothing.
5. Breach Detection via Canary Keys
Plant honeypot keys that alert when accessed. If an attacker compromises the vault and uses a canary key, you know immediately.
=
6. Automatic Key Lifecycle Management
Configure time-based or usage-based key rotation. Keys automatically expire after N operations or N hours, reducing the window of exposure from compromised keys.
7. Remote Attestation for Decryption Gates
Before decrypting sensitive data, verify the runtime environment is untampered — checking binary integrity, environment variables, and memory canaries.
=
=
8. Post-Quantum Digital Signatures (ML-DSA-65)
Sign and verify data integrity using NIST FIPS 204 ML-DSA-65 — post-quantum secure, tamper-evident, non-repudiation guarantees.
let keypair = generate_keypair.unwrap;
let signature = sign.unwrap;
Prerequisites & Installation
System Requirements
| Component | Minimum | Recommended |
|---|---|---|
| OS | Linux, macOS, Windows | Ubuntu 22.04+, macOS 13+, Windows 11 |
| CPU | x86_64, ARM64 | Any modern multi-core |
| RAM | 128 MB | 256 MB+ (Argon2id uses 64 MB) |
| Disk | 50 MB | 100 MB |
Python SDK
# Prerequisites: Python 3.10+
# Install package and dev dependencies
# Optional: LangChain/CrewAI integration
Rust CLI + Library
# Prerequisites: Rust 1.70+ via rustup
|
# Build release binary
# Install as CLI tool
Go SDK
# Prerequisites: Go 1.21+
# macOS: brew install go
# Linux: sudo apt install golang-go
# Windows: download from https://go.dev/dl/
# Download module dependencies
&&
# Run tests
JavaScript SDK
# Prerequisites: Node.js 18+
# SDK is built-in — no npm install needed
# Usage: const { AbirGuard } = require('./src/abir_guard');
Docker
# Prerequisites: Docker Engine 20.10+
# Build and run
Quick Start
Install from Package Managers (Recommended)
# Python (PyPI)
# Rust (crates.io)
# Go (GitHub)
From Source
# Clone and install all components
# Python: install and test
# Rust: build and test
&&
# Go: test
&& &&
# JavaScript: verify (Node.js)
Python SDK Guide
Basic Vault Operations
=
# Generate keypair for an agent
, =
# Encrypt sensitive data
=
# Decrypt data
=
# → b"API_KEY=sk-abc123xyz"
# Auto-generate keys on first use
= # keypair created automatically
# List and delete keys
# ['finance_agent', 'new_agent']
Phase 3 Features
# Key Revocation (CRL)
=
# True
# Automatic Key Rotation
=
# False (under limit)
# FIPS 140-3 Compliance Mode
=
=
=
# Differential Privacy Entropy
=
= # 32 bytes of noise-injected entropy
# Remote Attestation
=
=
# True if untampered
MCP HTTP Server
=
# curl http://localhost:9090/health
# curl -X POST http://localhost:9090 -H "Authorization: Bearer your-secret-key" ...
Rust CLI & Library Guide
CLI Commands
# Initialize vault with passphrase
# Encrypt / decrypt
# SHAMIR secret sharing
# ML-DSA signatures
# Start MCP server
Library Usage
use Vault;
let vault = new;
let ct = vault.store.unwrap;
let plain = vault.retrieve.unwrap;
assert_eq!;
Persistent vault with passphrase:
use persistent_vault;
let vault = get_vault;
let ct = store_encrypted.unwrap;
Go SDK Guide
import "github.com/abir-guard/abir-guard/sdk/go"
vault := abirguard.NewVault()
// Generate keypair
vault.GenerateKeypair("agent-1")
// Encrypt / decrypt
ct, _ := vault.Encrypt("agent-1", []byte("sensitive data"))
plain, _ := vault.Decrypt("agent-1", ct)
// Revoke key
vault.RevokeKey("compromised", "compromised", "admin", "Key leaked")
// Rotate key
vault.RotateKey("agent-1")
// Check rotation status
meta, _ := vault.GetMetadata("agent-1")
fmt.Printf("Operations: %d encrypt, %d decrypt\n", meta.EncryptCount, meta.DecryptCount)
// Audit log
for _, entry := range vault.GetAuditLog()
JavaScript SDK Guide
const = require;
const vault = ;
const = await vault.;
const = await vault.;
const plaintext = await vault.;
// Rotate key (kill switch)
await vault.;
// MCP client
const mcp = ;
const result = await mcp.;
MCP Server Guide
JSON-RPC Methods
| Method | Params | Response | Description |
|---|---|---|---|
generate_key |
{key_id} |
{key_id, generated: true} |
Create keypair |
encrypt |
{key_id, data} |
{nonce, ciphertext, key_id} |
Encrypt data |
decrypt |
{key_id, ciphertext} |
{plaintext} |
Decrypt data |
list_keys |
{} |
{keys: [...]} |
List active keys |
delete_key |
{key_id} |
{deleted: true} |
Remove keypair |
add_canary |
{} |
{canary_id} |
Plant honeypot key |
check_canary |
{} |
{breach_detected: bool} |
Check for breaches |
audit_log |
{limit} |
{entries: [...]} |
View audit log |
clear_cache |
{} |
{cleared: true} |
Clear memory cache |
info |
{} |
{name, version, mcp_version} |
Server info |
HTTP Endpoints
| Endpoint | Auth | Description |
|---|---|---|
POST / |
Bearer token | MCP JSON-RPC gateway |
GET /health |
Public | Health check |
GET /audit |
Bearer token | Last 100 audit entries |
LangChain & CrewAI Integration
LangChain
=
# [SilentQKeyGenTool, SilentQEncryptTool, SilentQDecryptTool]
CrewAI
=
# [KeyGenCrewTool, EncryptCrewTool, DecryptCrewTool]
Docker Deployment
# Build image
# Run with API key and persistent volume
# Health check
# Encrypt via HTTP
HSM & TPM Integration
# Auto-detect best backend per OS
=
# macOS → Keychain, Windows → Credential Manager, Linux → file/secret_service
=
# TPM 2.0 hardware detection
=
Phase 2 Hardware Security Features
YubiKey / FIDO2 Integration
=
# Generate hardware-backed key
=
# Sign data (requires YubiKey touch in production)
=
# Encrypt/decrypt with YubiKey-backed keys
, =
=
TPM 2.0 Seal/Unseal
=
# Seal data to TPM PCR values (hardware-bound)
=
# Unseal - only works if system state matches
=
Hardware Enclave Detection
=
# Generate hardware-backed key
# Seal/unseal using best available hardware
=
=
# Get attestation report
=
Quantum Readiness
What "Quantum-Ready" Means for Abir-Guard
| Threat | Mitigation | Status |
|---|---|---|
| Harvest Now, Decrypt Later | ML-KEM-1024 key encapsulation (NIST FIPS 203) | Production Ready |
| Quantum Key Extraction | AES-256-GCM with 256-bit keys (Grover-resistant) | Production |
| Signature Forgery (Shor's) | ML-DSA-65 digital signatures (NIST FIPS 204) | Production |
| Side-Channel Quantum Attacks | Differential privacy entropy + constant-time comparison | Production |
| Memory Scraping | Zero-copy memory policy + explicit key zeroization | Production |
| Future Quantum Break | Hybrid KEM (ML-KEM + X25519) — both must break | Production |
Current Quantum Status
- AES-256-GCM: Quantum-safe. Grover's algorithm reduces effective strength to 128-bit, still secure.
- ML-DSA-65: Post-quantum signatures deployed and tested. 3309-byte signatures, constant-time operations.
- ML-KEM-1024: Production-ready. Implemented in Python via
pqcrypto(PQClean-backed) and Rust viaml-kemcrate (pure Rust). Full keygen, encapsulation, and decapsulation roundtrip verified. - SHAMIR + Argon2id: Classical but quantum-safe for their use cases (threshold sharing, key derivation).
Mission Alignment 🇮🇳🌍
This project aligns with and supports:
- 🇮🇳 Indian Quantum Mission — India's National Quantum Mission (NQM) aims to develop quantum technologies for communication, computing, and sensing. Abir-Guard provides NIST-standard post-quantum cryptography to safeguard India's quantum infrastructure against Harvest Now, Decrypt Later threats.
- 🌍 Global Quantum Mission — Aligns with the worldwide transition to post-quantum cryptography as mandated by NIST, ENISA, and national cybersecurity agencies. Abir-Guard implements NIST FIPS 203 (ML-KEM) and FIPS 204 (ML-DSA) for quantum-resilient data protection.
- 🇮🇳🌍 Indian AI Mission — Supports India's AI sovereignty initiative by providing quantum-secure memory vaults for AI agents, ensuring API keys, model weights, and agent memory remain protected against future quantum attacks. Built in India, for the world.
After Quantum Breakthrough
- All ML-KEM-1024 backends are production-ready — no additional setup needed
- Python uses
pqcrypto(PQClean-backed) for native ML-KEM-1024 - Rust uses
ml-kemcrate (pure Rust, zero dependencies) - Existing hybrid keys remain valid during transition
Security Architecture
Hybrid KEM Design
┌──────────────────────────────────────────────────────────┐
│ Hybrid Key Encapsulation │
│ ML-KEM-1024 (PQC) + X25519 (Classical ECDH) │
│ Security: Both must be broken to compromise │
└──────────────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ Envelope Encryption │
│ AES-256-GCM (NIST FIPS 197) │
│ 96-bit random nonce + 128-bit auth tag per message │
└──────────────────────────────────────────────────────────┘
Defense-in-Depth Layers
| Layer | Controls |
|---|---|
| Cryptography | AES-256-GCM, ML-KEM-1024, ML-DSA-65, Argon2id, HKDF-SHA256 |
| Memory Safety | Zero-copy policy, explicit key zeroization, Rust ownership model |
| Network | Bearer token auth, rate limiting (100/min), TLS support, localhost default |
| Integrity | SHA-256 hash-chain audit logs, HMAC-signed CRL, tamper-evident vault |
| Runtime | Remote attestation, canary honeypots, Spectre/Meltdown noise injection |
| Lifecycle | Auto key rotation (time/usage), revocation, expiry policies |
| Compliance | FIPS 140-3 strict mode, approved algorithms only, audit trail |
Run Tests
# Full test suite (recommended before deployment)
&& && \
&& \
&& \
&& &&
# Individual test suites
&&
All 109 tests pass across Rust, Python, and Go.
Project Structure
abir_guard/
├── abir_guard/ # Python package (15 modules)
│ ├── __init__.py # Core Vault, HybridEncryptor, McpServer, AuditLogger
│ ├── ml_kem.py # ML-KEM-1024 + X25519 hybrid KEM (real ECDH)
│ ├── yubikey_integration.py # YubiKey/FIDO2 integration (software fallback)
│ ├── tpm2_seal.py # TPM 2.0 seal/unseal (tpm2-tools CLI)
│ ├── hardware_enclave.py # Apple SE, Intel SGX, AMD SEV detection
│ ├── langchain.py # LangChain tool integration (3 tools)
│ ├── crewai.py # CrewAI tool integration (version-compatible)
│ ├── abir_hsm.py # HSM/TPM integration (Keychain, CredMgr, file, TPM)
│ ├── mcp_http.py # Hardened HTTP MCP server (auth, rate limit, TLS)
│ ├── crypto_store.py # Encrypted disk persistence (Argon2id + AES-GCM + HMAC)
│ ├── revocation.py # CRL-style key revocation with HMAC signing
│ ├── rotation.py # Automatic key rotation (time-based + usage-based)
│ ├── fips_mode.py # FIPS 140-3 compliance mode (strict NIST algorithms)
│ ├── differential_privacy.py # Laplace noise entropy (Spectre/Meltdown defense)
│ └── attestation.py # Remote attestation (runtime integrity verification)
├── src/ # Rust source (12 modules)
│ ├── lib.rs # Library entry point + re-exports
│ ├── main.rs # CLI binary (clap subcommands, passphrase, validation)
│ ├── quantum_kernel.rs # Hybrid encryption + 200ms watchdog + zeroization
│ ├── entropy_inject.rs # CPU jitter entropy collector
│ ├── zero_copy.rs # Zero-copy vault with LRU-encrypted cache
│ ├── mcp_gateway.rs # MCP JSON-RPC server (10 methods)
│ ├── persistent_vault.rs # Encrypted file persistence (Argon2id + AES-GCM + ML-DSA)
│ ├── kdf.rs # Argon2id key derivation (OWASP: 64MB, 3 iter)
│ ├── shamir.rs # SHAMIR Secret Sharing (t, n) over GF(251)
│ ├── ml_dsa.rs # ML-DSA-65 signatures (NIST FIPS 204)
│ ├── revocation.rs # Key revocation/blacklist (CRL, HMAC-signed)
│ ├── rotation.rs # Automatic key rotation manager
│ └── differential_privacy.rs # Laplace noise + Spectre/Meltdown defender
├── sdk/
│ ├── go/ # Go SDK (AES-256-GCM vault with CRL, rotation, metadata)
│ │ ├── abirguard.go # Core implementation
│ │ ├── abirguard_test.go # 12 unit tests
│ │ └── go.mod # Module definition
│ └── js/ # JavaScript SDK (Node.js crypto + MCP client)
│ └── abir_guard.js # Basic vault + MCP client
├── examples/ # Usage examples
├── tests/ # Test suites (Python)
│ ├── run_tests.py # Manual test runner (5 suites)
│ ├── test_abir_guard.py # Pytest Phase 1 (17 tests)
│ ├── test_phase2_hardware.py # Pytest Phase 2 (24 tests)
│ └── test_phase3.py # Pytest Phase 3 (24 tests)
├── scripts/ # Publishing and debugging scripts
│ ├── publish-pypi.sh # PyPI publishing script
│ ├── publish-crates.sh # crates.io publishing script
│ └── debug.sh # Full project debug & verification
├── Cargo.toml # Rust dependencies (edition 2021)
├── pyproject.toml # Python package config (v3.1.0)
├── PUBLISHING.md # PyPI and crates.io publishing guide
├── Dockerfile # Container build (hardened MCP server)
├── LICENSE # MIT License (2026)
├── README.md # This file
├── THREAT_MODEL.md # Zero-trust threat model
├── SECURITY.md # Vulnerability reporting
├── CONTRIBUTING.md # Contribution guidelines
├── CODE_OF_CONDUCT.md # Community standards
├── CITATION.cff # Academic citation
└── TASKS.md # Feature status and roadmap
Roadmap
Phase 1: Bedrock (Complete)
- X25519 hybrid KEM with AES-256-GCM
- Memory zeroization (Rust
zeroize) - Security Watchdog (200ms)
- Encrypted disk persistence
- Input validation
- MCP JSON-RPC Gateway
- Python + Rust + JavaScript SDKs
- LangChain + CrewAI integration
- HSM + TPM integration
- Docker + CI/CD
- Audit logging + canary keys
Phase 2: Hardware & Security (Complete)
- ML-DSA-65 signatures (NIST FIPS 204)
- SHAMIR secret sharing (GF(251))
- Argon2id KDF in Rust
- Real ML-KEM-1024 (Python:
pqcrypto+ Rust:ml-kemcrate) - YubiKey / FIDO2 integration (software fallback ready)
- TPM 2.0 seal/unseal (via tpm2-tools CLI)
- Apple Secure Enclave / Intel SGX / AMD SEV platform detection
Phase 3: Ecosystem & Hardening (Complete)
- Key revocation (CRL, HMAC-signed)
- Automatic key rotation (time/usage)
- FIPS 140-3 compliance mode
- Differential privacy entropy
- Remote attestation
- Go SDK
- PyPI publishing (
pip install abir-guard) - crates.io publishing (
cargo add abir_guard)
Upcoming Phases
🚀 Phase 4: Enterprise & Cloud Integration (Q1 2026)
Production readiness for enterprise deployments and cloud-native workflows
- Real YubiKey/FIDO2 Hardware — FIDO2/CTAP2 operations, touch confirmation, PIV slot management
- Native TPM 2.0 API —
tpm2-tsslibrary integration, PCR policy automation - AWS KMS / GCP KMS Integration — Cloud KMS backends, envelope encryption
- HashiCorp Vault Integration — Vault transit engine backend, enterprise secret management
- Kubernetes Operator — Auto-inject vault sidecars, secret rotation, Helm charts
- Multi-Tenant Support — Organization/workspace isolation, RBAC, audit partitioning
- Performance Benchmarking — Async I/O, connection pooling, 10k ops/sec target
- OpenTelemetry Integration — Metrics, traces, distributed tracing for vault operations
🔐 Phase 5: Advanced AI Security & Compliance (Q2 2026)
AI-specific security patterns, regulatory compliance, multi-agent workflows
- Complete JavaScript SDK — ML-KEM-1024, ML-DSA-65, WebCrypto API, browser extensions
- Model Weight Encryption — Encrypt LLM weights at rest, secure fine-tuning pipelines
- Prompt Injection Shield — Detect/encrypt malicious prompts, prompt signature verification
- GDPR/CCPA/HIPAA Compliance — Data retention policies, right-to-erasure, audit exports
- Multi-Agent Key Sharing — Threshold encryption for agent swarms, quorum-based access
- Secure Enclave for LLMs — TEE-based inference (Intel TDX, AMD SEV-SNP), attested compute
- Zero-Knowledge Proofs — Prove encryption without revealing data, compliance audits
- AI Red-Teaming Tools — Automated attack simulation, breach scenario testing
🌐 Phase 6: Distributed & Quantum Ecosystem (Q3 2026)
Distributed vault architecture, quantum network readiness, ecosystem expansion
- Federated Vault Network — Distributed vault mesh, CRDT-based sync, conflict resolution
- Quantum Key Distribution (QKD) — QKD network integration, BB84 protocol support
- Post-Quantum TLS — Hybrid TLS 1.3 with ML-KEM-1024, secure transport layer
- WASM Compilation — Browser-native vault, edge computing, Deno/Cloudflare Workers
- Apple Secure Enclave Native — Swift bindings, native SE API, macOS/iOS SDK
- Intel SGX Enclave — Actual enclave creation, remote attestation, secure compute
- Decentralized Identity (DID) — W3C DID integration, self-sovereign identity, verifiable credentials
- HSM Cluster — Multi-HSM load balancing, failover, geographic distribution
Contributing
See CONTRIBUTING.md for guidelines, coding standards, and the PR checklist. I welcome contributions from developers, security researchers, and AI engineers.
Project Governance
| Document | Purpose |
|---|---|
| THREAT_MODEL.md | Zero-trust threat model, trust boundaries, mitigations |
| SECURITY.md | Vulnerability reporting policy, disclosure process |
| CONTRIBUTING.md | Contribution guidelines, code style, PR checklist |
| PUBLISHING.md | PyPI and crates.io publishing guide |
| CODE_OF_CONDUCT.md | Community standards and enforcement |
| CITATION.cff | Academic citation for research papers |
License
MIT License. See LICENSE for details.
Copyright (c) 2026 Abir Maheshwari
Developer
Abir Maheshwari
Founder at Artificial Quantum Dyson Intelligence, Biro Labs, Aquilldriver
AI Engineer | Quantum Computing Researcher
Connect
- Email: abhirsxn@gmail.com
- LinkedIn: https://in.linkedin.com/in/abirmaheshwari
- Instagram: @anantraga31
- Medium: https://office.qz.com/@abirmaheshwari
Built with Rust, Python, Go, JavaScript · Secured by NIST PQC, AES-256-GCM, Argon2id, ML-DSA-65, ML-KEM-1024 · Licensed under MIT 2026
🇮🇳🌍 Mission Support
| Mission | Badge | Description |
|---|---|---|
| 🇮🇳 Indian Quantum Mission | Quantum-resilient cryptography for India's National Quantum Mission | |
| 🌍 Global Quantum Mission | NIST FIPS 203/204 compliant worldwide | |
| 🇮🇳🌍 Indian AI Mission | Quantum-secure memory vaults for sovereign AI agents |
🇮🇳 Made in India, for the World.