FHE for sensitive agent computation
A concrete end-to-end pattern for letting an agent evaluate a policy over sensitive inputs while the computation host sees ciphertext only. This page is an architectural explainer, not a live FHE API or contract.
Prerequisites checklist
- Define the eligibility policy and version used by the example (
eligibility-v1), including transaction history (history) and approval threshold (threshold). - Assign an authorized data owner/decryptor who can generate the FHE key pair, encrypt inputs locally, retain the secret key, and decrypt the returned ciphertext locally.
- Provide an agent-side evaluator that can use the public key and evaluation material to run the policy on ciphertext and return ciphertext. The secret key stays with the owner.
- For the separate receipt path, prepare a signer and verifier plus the receipt context: agent identity, policy version, nonce, ciphertext hash, result commitment, and timestamp (
issued_at). See Agent Identity for authorization context. The KAIOS quickstart describes its own signed-receipt flow; the synthetic FHE example is not a drop-in KAIOS envelope. See the full KAIOS receipt contract.
FHE workflow glossary
- Sealed input
- A sensitive value encrypted locally by the authorized owner before computation; this input seal is separate from the later signed receipt.
- Encrypted computation
- Policy evaluation performed over ciphertext, with intermediate values remaining encrypted.
- Encrypted result
- The policy output returned as ciphertext for the authorized owner to decrypt locally.
- Verification
- A separate signed-receipt check of signature, identity, freshness, ciphertext hash, policy version, and result commitment that does not decrypt the result.
Eligibility evaluation without disclosure
A data owner wants an agent to decide whether a transaction policy is satisfied. The owner keeps the FHE secret key, while the agent evaluates the policy over encrypted transaction history and an encrypted approval threshold. The agent can return an encrypted decision, but cannot read the history, threshold, intermediate values, or decision.
-
Data owner · local seal
Seal inputs locally
Keeps the FHE secret key and locally encrypts transaction history and the approval threshold.
-
Agent host
Compute on ciphertext
Evaluates eligibility over ciphertext; intermediate values remain encrypted on the agent host.
-
Authorized owner
Decrypt result locally
Receives the ciphertext result and decrypts it locally with the retained secret key.
-
Separate signed-receipt path · verifier
Verifier checks without decryption
Checks the receipt signature, identity, freshness, ciphertext hash, policy version, and result commitment. Verification does not decrypt the result or expose plaintext.
local_encrypt(...) → ciphertext
evaluate(..., ciphertext) → ciphertext
sign({ ciphertext_hash, policy_version, agent_identity, nonce,
result_commitment, issued_at }) → signed_receipt
Copyable request and result
The request carries locally sealed inputs and policy context; the response returns the encrypted computation result with receipt metadata.
{
"input_ciphertexts": {
"history": "opaque:fhe-ciphertext-v1:synthetic-history-ciphertext",
"threshold": "opaque:fhe-ciphertext-v1:synthetic-threshold-ciphertext"
},
"policy_version": "eligibility-v1",
"agent_identity": "did:example:agent-eligibility-v1",
"nonce": "example-nonce-01J4FHE7K2M9"
}
{
"result_ciphertext": "opaque:fhe-ciphertext-v1:synthetic-result-ciphertext",
"receipt": {
"ciphertext_hash": "sha256:synthetic-ciphertext-hash",
"policy_version": "eligibility-v1",
"agent_identity": "did:example:agent-eligibility-v1",
"nonce": "example-nonce-01J4FHE7K2M9",
"result_commitment": "opaque:commitment-v1:synthetic-result-commitment",
"issued_at": "2026-09-28T12:00:00Z"
}
}
What moves, and what stays hidden
| Step | Value crossing boundary | Visibility and purpose |
|---|---|---|
| 01 · Key setup | Public key + evaluation material | Visible to the client and agent so encrypted evaluation can be prepared; the FHE secret key stays with the authorized decryptor. |
| 02 · Local encode | C(history) + C(threshold) |
Ciphertext only, so the transaction history and approval threshold cross the boundary without plaintext disclosure. |
| 03 · Agent compute | Encrypted intermediate values | Remain ciphertext while the agent homomorphically evaluates eligibility; the agent host cannot inspect the intermediate values. |
| 04 · Return result | C(policy_result) |
The encrypted result returns to the authorized decryptor for local decryption; its plaintext never reaches the agent host, KAIOS, or verifier. |
| 05 · Publish receipt | ciphertext_hash, policy_version, agent_identity, nonce, result_commitment, issued_at |
Signed, non-sensitive metadata binds the computation without disclosing payloads, the secret key, or plaintext output. |
FHE protects computation, not authorization
Generates the key pair, encrypts transaction history and the approval threshold locally, retains the secret key, and decrypts the result only when its authorization rules permit.
Receives ciphertext and public evaluation material, runs the eligibility circuit, and returns ciphertext. It never receives raw values, intermediate plaintext, the final plaintext result, or the secret key.
Can carry operational identity, lifecycle, and signed-receipt metadata, but never receives the raw inputs, intermediate ciphertexts, final plaintext result, or FHE secret key.
Checks identity, signatures, freshness, ciphertext hashes, commitments, and policy context. Verification does not require the secret key or decryption of the sensitive computation.
For the authorization context, see Agent Identity. For the operational agent and KAIOS context, see KAIOS. Those surfaces establish who may act; FHE keeps the computation payload private.
Bind the decision before it is sealed
A verifier should not infer authorization merely because an FHE evaluation completed. The receipt must bind the result to the exact encrypted inputs and the policy context that was authorized. A conceptual receipt can commit to the following values without including their plaintext contents:
ciphertext_hash— a digest of the encrypted input bundlepolicy_version— the policy and circuit version evaluatedagent_identity— the authorized agent or capability referencenonce— freshness material to prevent replayresult_commitment— a commitment to the encrypted result
policy_version, ciphertext_hash, and result_commitment while the secret key and plaintext result remain with the authorized decryptor. See KAIOS receipt verification for the existing signed-receipt verification boundary.
A tamper-evident record, not a disclosure step
Sealing is the final audit action: sign the receipt that binds the ciphertext hash, policy version, agent identity, nonce, and result commitment. The resulting record makes the computation and policy decision tamper-evident without containing the sensitive payload or decrypting the result.
seal({
ciphertext_hash,
policy_version,
agent_identity,
nonce,
result_commitment,
issued_at
}) → signed_receipt
The seal proves what was bound and when; it does not prove that the verifier is entitled to decrypt, and it does not turn ciphertext into plaintext. Keep decryption and key custody with the authorized data owner.
Encrypted-computation FAQ
What stays encrypted?
The transaction history, approval threshold, intermediate values, and result stay ciphertext through agent computation. The authorized owner keeps the secret key and decrypts locally. Only receipt metadata and commitments are published.
Does the workflow expose plaintext to the agent?
The agent host receives ciphertext and public evaluation material, then returns ciphertext. It does not receive raw inputs, plaintext intermediates or result, or the secret key. This is a conceptual workflow, not a live FHE API or contract.
How do verification and sealing relate to the computation?
Verification checks the receipt’s signature, identity, freshness, and binding to the ciphertext and policy context without decrypting. Sealing signs that receipt to make the computation record tamper-evident. Neither action authorizes decryption or reveals plaintext.
Privacy by construction
In this workflow, the agent does useful computation without receiving the sensitive data it computes over. The public trail is limited to operational metadata, commitments, and a signed seal. The raw inputs, intermediate values, and plaintext output are never exposed to the agent host, KAIOS, or the verifier.
Pair the computation boundary with agent identity, operational context from KAIOS, and the signed-receipt checks in verification docs when designing a production system.