MCP Servers
13

Searchable Encryption — the Honest State of the Field

Searchable Encryption — the Honest State of the Field

May 7, 2026

The previous two posts in this sub-cluster — the blind-but-useful paradox and key recovery — circled around a question this one names directly: can an agent ask the server to find encrypted records matching some criterion without the server learning what the criterion is?

Every ZK MCP design eventually runs into this. The agent does not want to fetch a million ciphertexts and decrypt them on the device for a single query. The user does not want the server to be able to read the data. The middle ground — the server narrows the candidate set blindly, the device handles the precise step — is what every viable architecture either solves cleanly or gives up on cleanly.

This post is the honest accounting. There are partial solutions. None of them is general. The state of the field in 2026 is significantly worse than the marketing of certain products would suggest, and significantly better than a flat "encryption breaks search" pessimism would suggest. The right path through the field is to understand which partial solutions fit which queries and to design product features around the parts that work rather than to wait for a general solution that has been twenty years away for fifteen years.

This is the third post in the zero-knowledge sub-cluster. It assumes you have read at least the first one and ideally the second too.

Why the problem is hard in general

The two-line version: encryption is supposed to make ciphertext look random. A search system is supposed to find structure in stored data. Those two goals are in direct tension. Any cryptographic scheme that supports general search must, by construction, leak something that distinguishes encrypted-matching from encrypted-non-matching, and that leakage is what attackers exploit.

A more careful framing: the question "does record X match query Q?" is, in any useful sense, a function of the plaintext of X and Q. A server that can answer it has, by some definition, learned a function of the plaintext. The cryptographic question is how much of the plaintext that function reveals — none, a single bit per record, the structure of access patterns, the frequency of query terms. There is no zero-leak general solution. There are schemes that minimize specific leaks at specific costs.

The four families below are the real, deployable tools in the kit. We have tried each one in production-adjacent contexts. None of them is a free lunch.

Deterministic encryption (DE)

The simplest, the cheapest, and the most leaky.

The construction: encrypt the same plaintext to the same ciphertext, every time, deterministically. No randomized IV. Search becomes "compute the deterministic encryption of the query, look it up in the index." Equality search is a hash-table lookup on encrypted data; the server never sees the plaintext.

Where it fits: tag-shaped data. Categorical fields. The "blind index" pattern from the first sub-cluster post. Storing user records with a userId field, where the server needs to support findByUserId(x) queries blindly, is exactly this. Encrypt userId deterministically, store the ciphertext alongside the encrypted record, query by encrypting the target user ID and looking it up.

What it leaks:

  • Frequency. The server sees that Enc("alice") appears in 8,000 records and Enc("bob") in 12. With external context (a leaked user list, a public dataset matching the demographic, a known top-N), the encryption breaks. This is the frequency analysis attack the cryptography community has documented exhaustively over the last decade — there is a small but ugly literature of "we attacked production deterministic-encryption deployments and recovered most of the plaintexts."
  • Access patterns. Even if frequency does not crack the encryption, repeated queries reveal which records share the same value. Over time, the server builds a graph of record-equivalence-classes that is informative even before it identifies which class is which.
  • Co-occurrence. Records with the same tag1 value tend to also have similar tag2 values. The server learns the joint distribution of all your deterministically-encrypted fields, which is often much more revealing than any single field.

When to use it anyway: when the cardinality is high, the values are uniformly distributed, the field is not joinable to external data, and the use case justifies the leak. A randomly-generated record ID? Fine. A user-chosen username? Risky. A medical diagnosis? Almost certainly compromisable.

Pair DE with a narrow set of fields, high cardinality, and no secondary correlation, or do not pair it at all. The "encrypted database with deterministic search" products you have seen advertised are mostly leaking more than the marketing copy claims.

Searchable symmetric encryption (SSE)

The academic family that promises more than DE and delivers less than the papers suggest.

The construction varies — there are dozens of SSE schemes, with different trade-offs — but the common shape: at write time, the user's client builds an encrypted index mapping query tokens to record IDs. To search, the user computes a token-derived "trapdoor" that the server can use to look up matching record IDs without learning the token. The server returns the IDs; the client fetches and decrypts the records.

The good news: SSE supports more than equality. There are SSE schemes for keyword search, prefix search, range queries, and conjunctions. The Σoφoς line of schemes (forward-private SSE) prevents a class of attacks that older schemes were vulnerable to. There is real, deployable code — Microsoft Research's CryptDB-derived projects, Cipherbase, modern open-source SSE libraries.

The bad news: leakage is still real, and the leakage profile is different per scheme. Every SSE deployment leaks at least:

  • Search pattern: which queries match which queries (you searched the same thing twice, the server can tell).
  • Access pattern: which records were returned for which query (the server sees the IDs, even if it cannot read them).
  • Result size: how many matches a query had.

A determined attacker with auxiliary information — knowing the rough distribution of the data, having a partial leaked dataset, observing the queries over time — can often recover significant portions of the plaintext. The attack literature is ongoing: a scheme that looked secure in 2018 may have been broken by 2022, with the fix not yet deployed.

The honest recommendation: SSE is a real tool, useful in tightly-scoped applications where the leakage profile is acceptable. Do not deploy it as a generic "encrypted database with search" without first understanding which leaks you are accepting and how they interact with your specific data.

Homomorphic encryption (FHE)

The "but what if encryption could just compute?" answer that is fifteen years away from being five years away.

The promise: fully homomorphic encryption (FHE) lets the server compute arbitrary functions on ciphertext, producing a result that, when decrypted by the user, equals what the function would have produced on plaintext. Add encrypted numbers and get an encrypted sum. Filter encrypted records by encrypted criterion and get encrypted matches. The server learns nothing.

The reality, in mid-2026:

  • Speed. FHE is between 1,000x and 1,000,000x slower than the equivalent plaintext operation, depending on scheme and operation. A query that takes a millisecond on plaintext takes seconds to minutes on FHE ciphertext. There has been steady progress (CKKS, BFV, BGV schemes; Microsoft SEAL; OpenFHE; lattice-based optimizations) but the gap is still many orders of magnitude.
  • Key sizes. FHE ciphertexts are large — often 100x to 10,000x the size of the plaintext, depending on parameters. Storing a 1 GB database under FHE means somewhere between 100 GB and 10 TB of ciphertext.
  • Functional restrictions. "Arbitrary function" is theoretically true and practically misleading. Branching, comparisons, and dynamic-length operations are all expensive in FHE; the schemes work best for fixed-circuit numerical computations. A free-text search over a million records is technically possible and operationally infeasible.
  • Tooling. The libraries exist. Wrapping them into a production system is real engineering. The teams that have shipped FHE in production are small in number, well-funded, and focused on narrow workloads (private set intersection, federated analytics, regulated finance).

When FHE makes sense: small, well-defined, numerical workloads where the privacy property is non-negotiable and the cost is acceptable. A bank computing loan eligibility against an encrypted credit report. A healthcare consortium computing an encrypted statistic across patient records held by different hospitals. A specific function over a specific dataset, designed in advance, with a budget for the engineering.

When FHE does not make sense: as a generic substrate for an MCP server's tool layer in 2026. The performance is not there. Pretending it is, by demoing a toy example and ignoring the production scaling, is a category of dishonesty the field has too much of.

This may change. Hardware acceleration (Intel HEXL, custom FHE ASICs, lattice-friendly GPUs) is moving the constants in the right direction. Improved schemes (TFHE for boolean operations, scheme switching for hybrid workloads) are reducing the operation count. By 2030 the picture may be different. In 2026, FHE is a tool for specific niches, not a general answer.

Confidential computing (TEEs again)

The pragmatist's "we have homomorphic enough for production" answer.

The pattern was sketched in the first sub-cluster post under Path B. Repeated here because for searchable encryption specifically, TEEs are often the only real production answer.

Inside a TEE — Intel SGX, AMD SEV-SNP, AWS Nitro Enclaves — the data is plaintext. Search runs at native speed. The result is re-encrypted before leaving the enclave. From the outside, the server appears to be running on encrypted data and producing encrypted results, even though inside the trusted boundary everything is normal.

What this buys for searchable encryption specifically:

  • Native-speed search. A SQL query inside a Nitro enclave is the same SQL query you would run on a regular Postgres. The trust model has shifted; the performance has not.
  • Full query language. Anything Postgres can do, the enclave can do. Free-text search, full-text indexes, joins, range queries. No restriction to deterministic-encrypted fields or trapdoor-based schemes.
  • Auditability. Remote attestation lets the user's client verify that the enclave is running the expected code. The user is not trusting "the cloud" abstractly; they are trusting "this exact build of this exact enclave image."

What it costs (still):

  • Hardware-vendor trust. SGX, SEV, Nitro, Apple Secure Enclave — each one has had vulnerability disclosures. Speculative-execution side channels, attestation flaws, microcode bugs. None of these have been catastrophic; all of them have weakened the property. You are betting on the hardware vendor's security team and their CVE response cadence.
  • Operational cost. TEEs are not free clouds-as-a-service. The build pipelines are different, the deployment is different, the debugging is different. Teams that have not done TEE before will spend real engineering time getting fluent.
  • Side channels. Even with the TEE itself secure, the patterns of memory access, network traffic, and timing can leak data. A search that returns 12 records uses different cache lines than one that returns 1,200. Closing these channels is its own discipline (oblivious algorithms, constant-time data structures) and most production TEE deployments are imperfect at it.

The honest read: confidential computing is the best practical answer for "an MCP server that needs full-strength search on encrypted data." It is not theoretically zero-knowledge in the strict sense — the enclave saw the plaintext — but it is operationally close enough for most threat models to accept, and the alternative is shipping nothing.

What this leaves you with

For an MCP product manager or architect deciding what to build today, the practical landscape:

  • Equality search on a low-cardinality, low-correlation field. Deterministic encryption, with eyes open about the leakage. Pair with a narrow-funnel tool design so the leak is bounded by what the tool exposes.
  • Tag-based retrieval over a moderately-sized index. SSE if you have the engineering depth to evaluate the leakage profile of the specific scheme you pick. Most teams should not start here.
  • Numerical aggregates over private data. FHE for specific, well-scoped, numerical workloads. Custom implementation, narrow function, expensive infrastructure.
  • Full-strength database search on encrypted data. Confidential computing. Trust the hardware vendor; accept the operational cost; verify the attestation flow; close the side channels you can.
  • Anything else. Paths A and D from the architecture post — client-side decrypt loops, derived-signal-only tools. The default for most products. The path that asks the least of the cryptography and the most of the product design.

The combination matters as much as any single choice. A real ZK MCP server uses derived-signal tools for the common case, blind indexing for tag retrieval, client-side decrypt for the long tail, and TEEs only when the product has graduated to needing them. None of these is "the answer." The combination of all of them, weighted by query frequency, is the answer.

The product reframe

This post has been technical because the question is technical. The frame worth ending on is product-shaped.

The narrative "AI agent that can search your private data without the server reading it" is a near-impossible technical premise stated as a marketing line. Most teams that try to deliver on it end up shipping something that either is not really zero-knowledge (the cloud holds the keys; the encryption is theatre) or is not really searchable (every query takes minutes and the agent never recovers).

The teams that ship well-functioning ZK products in 2026 redesign the product to need less search. They surface aggregates, not raw matches. They expose the data through derived signals. They limit the agent's tool catalog to operations the architecture can support. They are honest with users about what the product can and cannot do.

This is the narrow-funnel principle from the security post, upgraded for ZK: a tool that returns "the seven matching records" is a tool the architecture has to support; a tool that returns "your spending in this category was $412 this month" is a tool the architecture can support cheaply, blindly, and without leakage. Picking the second one is not a workaround for cryptographic limitations. It is better product design, regardless of whether the data is encrypted at all.

The cryptography will continue to improve. FHE constants will fall. SSE leakage profiles will tighten. TEEs will mature. But the product instinct that says what does the user actually need from this tool, and can we satisfy that need with less than full plaintext access? is the right instinct now and will still be the right instinct when the cryptography catches up.

Where this fits in the series

This post closes the zero-knowledge sub-cluster. The first post frames the architectural choice. The second post handles the operational follow-through. This one — the search problem — is where the open frontier sits.

Related Topics

searchable encryptionencrypted database queryhomomorphic encryption practicaldeterministic encryption tradeoffsmcp encrypted search
Flutter & Node.js

Ready to build your app?

Flutter apps built on Clean Architecture — documented, tested, and yours to own. See which plan fits your project.

Clean Architecture on every tier
iOS + Android, source code included
From $4,900 — no monthly lock-in