Book a free call

Confidential AI: How to Run AI Without Exposing Your Data

Confidential AI runs models inside hardware-protected enclaves so data stays encrypted while it is used. Learn how it works, where it fits, and what to adopt first.

Hertiv engineering teamReviewed by a senior engineer
7 min read
Confidential AI: How to Run AI Without Exposing Your Data
On this page

Short answer

Confidential AI runs AI workloads inside hardware-protected enclaves, called trusted execution environments, where data stays encrypted while the model uses it. The enclave checks the code before it runs and produces a signed attestation report, so the data owner can verify what is running before sending anything. It fits health, finance and legal work where data must stay private even from the cloud provider.

What is confidential AI?

Confidential AI is a way of running AI workloads so that data stays encrypted and hidden from everyone except the code that is allowed to use it, including the cloud provider and the platform operator.

In a normal cloud setup, data is encrypted when it is stored and when it moves across a network, but it is decrypted inside memory while the model works on it. Anyone with access to that machine, from an administrator to an attacker who breaks in, can read it in plain text. Confidential AI closes that gap by running the model inside a hardware-protected area called a trusted execution environment, or TEE.

The enclave checks the code before it runs, encrypts memory so the host cannot read it, and produces a signed report, called attestation, that proves which code is running. If the code changes, the report changes, so a client can refuse to send data. This matters most when the data is sensitive: health records, financial details, legal documents or a company's own private documents.

How does confidential AI work?

Confidential AI works by running model code and data inside a trusted execution environment that the processor isolates from the rest of the system, including the operating system and the hypervisor.

A typical flow looks like this:

  1. The model owner builds the code and records a fingerprint of it, called a measurement.
  2. The cloud provider starts the enclave on a machine with TEE hardware.
  3. The enclave measures the loaded code and produces an attestation report signed by the hardware.
  4. The client checks the report against the expected fingerprint.
  5. Only then does the client send encrypted data, which the enclave decrypts inside the protected area.
  6. Results leave the enclave encrypted, so nothing sensitive appears in plain text outside it.

The key point is that trust moves from the provider to the hardware and the code. You do not need to believe that the cloud operator will behave well; you check the attestation report and the code fingerprint yourself. That is why regulated teams use confidential AI for workloads they would otherwise keep on their own servers, and why it pairs naturally with AI security reviews.

What are the main approaches to confidential AI?

The main approaches to confidential AI differ in what hardware they use and how much of the stack they protect, so the right choice depends on whether you run a small model or a large one.

Approach What it protects Best for Limit
CPU enclaves Code and data in processor memory Small models, agents, APIs Limited memory per enclave
Confidential virtual machines A whole virtual machine, including the guest system Lifting an existing workload with few code changes Broader code base to trust
GPU confidential computing Model weights and data on the graphics processor Large language models and training runs Needs recent GPU hardware
Confidential containers Container images and their data, managed by the platform Teams that already ship containers Depends on the platform's setup

Most teams start with confidential virtual machines, because they need the fewest code changes, then move sensitive model-serving work to GPU confidential computing when the model grows. CPU enclaves suit small, well-defined jobs such as key handling or scoring a single request. Whatever the approach, the attestation step is what makes it confidential AI rather than ordinary encryption, and it is the part to test first.

Where does confidential AI make sense?

Confidential AI makes sense wherever the data is too sensitive to expose to the infrastructure owner, yet the team still wants cloud scale, shared models or a partner's compute.

  • Health. Summarising patient notes or triaging referrals without letting the cloud provider read the records.
  • Finance. Scoring credit or fraud cases where customer details and model inputs must stay private.
  • Legal. Reviewing contracts or case files where privilege and client confidentiality apply.
  • Shared work. Two companies training or querying a joint model without revealing their own data to each other.
  • Personal data. Running assistants on user messages and documents where the user expects the provider not to read them.

It makes less sense for public data, open models with no private inputs, or early prototypes where the data is synthetic. In those cases the extra setup, hardware limits and slower debugging buy little. A good test is whether a data breach at the provider would cause real harm; if the answer is yes, confidential AI is worth a serious look, and a data security and compliance review can confirm the requirement.

How do you adopt confidential AI?

You adopt confidential AI by picking one sensitive workload, proving the attestation flow end to end, and only then widening coverage to more models and teams.

  1. Pick the workload. Choose one job with sensitive data and a clear owner, such as document review or fraud scoring.
  2. Map the data flow. List every place the data travels, who can see it, and where it is decrypted today.
  3. Choose the approach. Match the model size and the team's skills to one row of the table above.
  4. Build the attestation check. Record the code fingerprint, verify the report before sending data, and refuse to proceed on mismatch.
  5. Test with realistic data. Run the workload in the enclave, measure speed and accuracy, and check the logs for anything leaking outside.
  6. Write the operating rules. Decide who approves code changes, how keys are handled, and how often the fingerprint is reviewed.

Keep the first pilot small and time-boxed. The goal is to prove that the enclave runs, the attestation check works and the performance is acceptable, not to rebuild the whole platform. A governance review of the pilot is a sensible gate before the second workload.

Example (hypothetical): a clinic summarises patient notes

Example (hypothetical): a clinic with 40 doctors wants an AI summary of each patient visit, but patient notes must not be readable by the cloud provider that hosts the model.

The clinic picks one job: summarising visit notes for 5,000 patients a month. Today a nurse reads each note and writes a summary, taking about 5 minutes per note. That is 5,000 x 5 minutes, or 25,000 minutes, which is about 417 hours a month of manual work.

With confidential AI, the notes are sent encrypted to an enclave running the summary model. The clinic checks the attestation report first, so it knows exactly which code will see the notes. The model drafts every summary, and a nurse spot-checks 10 percent of them, or 500 summaries, at 5 minutes each. That is 500 x 5 minutes, or 2,500 minutes, which is about 42 hours a month.

The team saves about 375 hours a month while the notes stay encrypted outside the enclave. The clinic still reviews the drafts, because the model can miss details, but the privacy risk no longer depends on trusting the provider's staff or admins.

What are the common mistakes?

The most common confidential AI mistakes are treating encryption as the whole answer, skipping the attestation check, and trusting a large code base inside the enclave.

  • Encrypting without attestation. Data encrypted in transit is not confidential AI. Without checking the report, you cannot know what code received it.
  • Putting too much code in the enclave. A large trusted code base is hard to review and easier to get wrong. Keep the enclave small and the rest outside.
  • Ignoring the model itself. Model outputs can leak training data, and prompts can leak through logs. Check outputs and logging, not just the enclave.
  • Forgetting key handling. If the keys that protect the data are stored where the host can read them, the enclave adds little.
  • Skipping performance tests. Enclaves can be slower and memory-limited, so test with realistic data before promising a launch date.

Before scaling up, it also helps to know how the model will be judged in production, which is where evaluating an LLM application comes in.

Key takeaways

  • Confidential AI runs models inside hardware-protected enclaves so data stays encrypted while it is used
  • Attestation proves which code is running, and the client should check it before sending any data
  • CPU enclaves, confidential VMs and GPU confidential computing fit different model sizes
  • It fits health, finance, legal and shared-data work where a provider breach would cause real harm
  • Keep the enclave small, handle keys carefully, and test performance with realistic data

Frequently asked questions

What is the difference between confidential AI and ordinary encryption?

Ordinary encryption protects data at rest and in transit, but data is decrypted in memory while the model works on it. Confidential AI keeps data encrypted inside a hardware-protected enclave during use, so even the cloud provider cannot read it.

What is a trusted execution environment?

A trusted execution environment, or TEE, is a hardware-protected area of a processor that isolates code and data from the rest of the system, including the operating system. It encrypts memory, measures the code it runs and produces a signed attestation report.

Do I need special hardware for confidential AI?

Yes, the cloud machines must support TEE hardware, such as Intel SGX or TDX, AMD SEV-SNP, or NVIDIA confidential computing GPUs. Most large cloud providers now offer such machines, so the work is usually choosing the right instance type rather than buying hardware.

Does confidential AI slow the model down?

It can, because enclaves add checks and have memory limits, and moving data in and out takes extra steps. The impact varies by workload, so measure speed and accuracy with realistic data during the pilot before committing to a launch date.

Can confidential AI protect model weights as well as data?

Yes. Model weights can be loaded into the enclave encrypted and decrypted only inside it, so the host cannot copy them. This matters when the model itself is valuable or when the weights were trained on private data.

Is confidential AI enough for compliance on its own?

No. It is one control among several. You still need access rules, key handling, logging, data retention policies and contracts with providers. Confidential AI strengthens the privacy side, but it does not replace governance, audits or legal review.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Need AI that keeps sensitive data private? Talk to Hertiv.

A senior engineer replies within one business day. Or see our AI Security service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call