PrivAgents

Agents utilising Privacy Enhancement Techniques tools for secure interaction with MCP servers

Date: April 2025
Client: Personal Project
Role: Creator & Developer
LLMPrivacyHomomorphic EncryptionSecure Computation

Overview

Take Homomorphic Encryption for example. Agents can offload compute to MCP servers that are equipped to work with encrypted data. This not only allows us to build MCP servers for private data in general but also paves the way for on-device AI. Lightweight agentic frameworks can rely on MCP servers for computationally expensive tasks by sharing data in encrypted form, leading to highly functional, privacy-preserving on-device AI systems.

Why PrivAgent

FeatureDescription
Agent FlexibilityOn-device or cloud-based agents to suit your compute and trust needs
Data PrivacyHomomorphic encryption ensures data remains private during processing
Modular BackendModular MCP server performs encrypted similarity calculations on the backend
Secure PipelineEnd-to-end encrypted pipeline for secure data interaction

Supported Agents

AgentDescription
Ollama AgentFor on-device reasoning using local models
OpenAI AgentFor cloud-based intelligence via API

Architecture Overview

Project image

The architecture involves a user device handling agent and encryption tasks, communicating over a secure channel with an MCP server for encrypted similarity calculations, and returning encrypted results to the user device for decryption.

Movie Preference Matching

The Movie Preference Matching use case is a practical demonstration of a privacy-preserving recommendation system powered by homomorphic encryption. It allows users to receive personalized movie recommendations without exposing their preferences in plaintext, ensuring complete data confidentiality throughout the process. The workflow involves encrypting user preferences on their device, performing secure computations on the MCP server, and decrypting results locally to deliver tailored recommendations.

StepDescription
User InputThe user provides a movie interest vector, rating genres like Action, Romance, and Sci-Fi (e.g., [8, 2, 9] for high preference in Action and Sci-Fi, low in Romance).
EncryptionThe agent (Ollama or OpenAI) uses the TenSEAL library with the BFV homomorphic encryption scheme to encrypt the interest vector into an unreadable tensor.
Server ProcessingThe MCP server, holding plaintext movie profiles (e.g., Inception: [9, 1, 8]), computes encrypted similarity scores using dot products between the encrypted user vector and each movie profile, without ever decrypting the user data.
Result StorageEncrypted similarity scores for all movies are saved to a file (e.g., data/interest_results) and sent back to the user device.
DecryptionThe agent decrypts the similarity scores locally using the original encryption context and keys, revealing how closely each movie matches the user's preferences.
RecommendationThe agent sorts the decrypted scores and presents the top movie recommendations, ensuring the entire process is secure and private.

This use case highlights the power of homomorphic encryption in enabling secure, personalized recommendations. By keeping user data encrypted during server-side computations, PrivAgents ensures zero trust is required from the server, making it ideal for sensitive applications like movie recommendations, where user preferences could reveal personal tastes or behaviors.

Benefits

BenefitDescription
Zero TrustServer never sees user data
Agent AgnosticWorks with both on-device and cloud-based agents
ExtendableCan support more complex user profiles or additional domains (like music, shopping, healthcare)
EducationalDemonstrates how homomorphic encryption works in a practical context