Skip to main content

Confidential inference

Model Studio confidential inference service is built on hardware-based confidential computing technology for high-security scenarios. Data remains encrypted during transmission, computation, and storage, protecting the privacy and security of user prompts during cloud-based inference.

1 Confidential inference overview

Confidential inference is built on TEE (Trusted Execution Environment) hardware-level confidential computing technology, which effectively defends against multi-layer security threats including privileged attacks. Its core security features include:
  • End-to-end encryption: Establishes a business-layer encrypted channel on top of HTTPS, covering the full link from the client to the confidential inference node. Each node randomly generates a root private key for session key negotiation, and each session independently derives an ephemeral key. All keys reside only in encrypted volatile storage; they are never written to disk or persisted and are destroyed when the session ends.
  • Security hardening and measurement: Relies on the dual mechanism of chip-level hardware isolation and software hardening to perform full-chain measurement of the boot chain and runtime environment. At the block storage level, the root partition relies on the Merkle Tree mechanism to ensure integrity, and the data partition is encrypted with one-time keys to ensure confidentiality.
  • Hardware/software transparency: The client directly accesses the TEE vendor to verify the authenticity of the remote attestation report generated by the verified hardware and checks the transparency log service to confirm the integrity of the server-side software artifacts.
For supported models and pricing, see Billing. Target audience: enterprise scenarios with high data security requirements. Typical industries are listed in Application scenarios. Workflow:
Activate the service (sign the Special Rules)
  │
  ▼
Create a deployment (one deployment for each model you want to use)
  │
  ▼
Invoke via the SDK (the model parameter = the Model Code in the deployment list)

2 Confidential inference advantages

  • Defense-in-depth security: From chip-level hardware isolation and end-to-end encrypted transmission to client-verifiable remote attestation, it builds a multi-layer protection system covering hardware, transmission, and software. The platform does not retain plaintext prompts, model outputs, or encryption keys; the keys and content are controlled by the user.
  • Low-intrusion access: Compatible with existing calling methods, no need to refactor business code. Only the call entry point and client SDK need to be replaced, and confidential and non-confidential paths can coexist under the same account. For calling methods, see Post-deployment invocation.

3 Billing

Confidential inference deployment is billed based on the Token list price, divided into three items: input, output, and context cache (implicit) hits. Supported models: cmaas-qwen3.8-flash, cmaas-glm-5.3, cmaas-glm-5.2 (to be deprecated soon), cmaas-deepseek-v4.1-flash, cmaas-deepseek-v4-flash-0731, cmaas-deepseek-v4-pro-0813.
  • North China 2 (Beijing)
  • Qwen
  • GLM
  • DeepSeek

Model code

Input

CNY per million tokens

Output

CNY per million tokens

Cache hit

CNY per million tokens

cmaas-qwen3.8-flash

3.2

10

0.4

Billing formula:
Total cost = ((input tokens - implicit cache hit tokens) × input unit price + cache hit tokens × cache hit unit price + output tokens × output unit price) ÷ 1,000,000

4 Activation and deployment

To activate confidential inference, meet the following prerequisites:
  1. Activation: Contact Alibaba Cloud business team to apply for access.
  2. Region: The China North 2 (Beijing) region is currently supported.
  3. Compliance agreement: Before deployment, you must sign the Alibaba Cloud Model Studio Confidential Inference Service Special Rules.
If the confidential inference page displays a message indicating that the confidential inference (pay-as-you-go) service has not been activated, follow the on-screen instructions to read the Special Rules and click "Confirm activation and use" to activate the service.

Create a deployment

Before deployment, confirm that the business side uses models supported by confidential inference (see Billing). Deployment steps:
  1. Log in to the Model Studio console, and in the left navigation pane, choose Model Inference > Confidential inference to enter the confidential inference page (the page displays the existing deployment list, including model Code, billing method, rate limit details, creation time, and operation), and click Create Confidential Inference.
  2. In the dialog box, configure the deployment parameters: select a model from the Select Model drop-down list (models with existing deployments are marked as "Deployed"); the Billing Method is fixed to "Pay by Token"; in Rate Limit Configuration, TPM/RPM is automatically set to the upper limit after a model is selected and requires no editing.
  3. Click Confirm Create. After the deployment is complete, a new record is added to the list.
Each model requires a separate deployment before it can be invoked. The model code used for invocation is the one shown in the "Model Code" column of the deployment list.
Deployment parameters are described in the table below. Billing is based on the Token list price (see Billing); TPM/RPM is configured to the upper limit by default and requires no editing.
ParameterDescription and value
Select modelFor supported models, see Billing
Billing methodBilled by Token list price (input/output/cache hit)
TPM (tokens per minute)Token rate limit per minute, configured to the upper limit by default (default 500000 when no increase has been requested); requests approaching the limit will be throttled.
RPM (requests per minute)
Key negotiation requests are also counted toward the RPM quota, so the actual available inference RPM may be slightly lower than the configured value.
Request rate limit per minute, configured to the upper limit by default (default 300 when no increase has been requested).
Post-deployment monitoring metrics are shown in the table below. Use them to determine whether scaling or prompt optimization is needed.

Metric name

Meaning

Normal range

Recommendation for anomalies

Token usage

Consumption of input, output, and cache hit tokens per unit time

Below the configured TPM rate limit

When usage spikes, check business request volume and prompt length; evaluate scaling or prompt structure optimization as needed.

Cache hit rate

Ratio of cache-hit requests to total requests

The higher, the more cost-effective (no fixed threshold)

When the hit rate is low, optimize the prompt structure to improve reuse and increase unit cost efficiency.

Resource pool usage

Capacity usage of the dedicated resource pool

No overflow (the dedicated resource pool never overflows)

No action needed

After deployment, you can view details, scale, or release the deployment. Deletion/release is usually irreversible; proceed with caution.

5 Post-deployment invocation

After the model is deployed successfully, you can invoke it through the confidential inference SDK. {WorkspaceId} in the invocation examples is the workspace ID: click the current workspace (such as "Default Workspace") in the top bar of the console to expand the drop-down list, click "Manage Workspaces", and view the ID (in the format ws-xxxxxxxxxxxxxxx) in the "Workspace ID" column on the workspace management page. The public endpoint in the "API Host" column is the domain name used for invocation.

SDK installation and build

Prerequisites:
  • The Go development environment is installed. For more information, see Install Go.
  • The make build tool is installed.
After installing the confidential inference SDK, run the make command in the SDK root directory. The confidential inference sample command-line program cmaas-client and the local API conversion proxy tools openai-proxy/anthropic-proxy are built in the bin directory. You can also refer to the README in the SDK directory to develop and build confidential inference tools tailored to your business scenario.
  • Using the confidential inference command-line tool cmaas-client
  • openai-proxy (OpenAI-compatible interface)
  • anthropic-proxy (Anthropic-compatible Messages interface)
# MacOS/Linux
# Configure your Model Studio API Key in the environment variable
export DASHSCOPE_API_KEY="sk-xxx"
# Replace the argument after --model with the actual model code
./cmaas-client --endpoint https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services --model <code> --prompt "Briefly introduce large language models" --stream

# Windows Powershell
$env:DASHSCOPE_API_KEY = "sk-xxx"
.\cmaas-client.exe --endpoint https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services --model <code> --prompt "Briefly introduce large language models" --stream

View local transparency reports

You can view the transparency reports of confidential inference requests in the following local directories:
  • macOS
  • Linux
  • Windows
~/Library/Application\ Support/dashscope-confidential-maas/transparency-reports
The SDK also provides the cmaas-audit command-line tool for offline security auditing of local transparency reports. For details, see the corresponding documentation in the SDK. By default, local transparency reports record request prompts for auditing. To disable prompt recording, add the --no-prompt-in-transparency-report parameter when starting openai-proxy or anthropic-proxy. After disabling, other audit materials such as remote attestation are still retained. For authentication methods and error codes, see the SDK invocation response.

6 Application scenarios

Confidential inference targets scenarios where a business needs to call cloud-based large models, but at least one party among customer data, business data, or model weights has a hard constraint that "the plaintext must not be visible to the other party." Financial risk control and anti-fraud inference
  • Applicable to: credit approval, fraud detection, risk-assisted decision-making
  • Advantages: dual-blind data/model; aligned with JR/T 0197 C3/C4 level financial data encryption and access control requirements
Government and central/state-owned enterprise large model applications
  • Applicable to: internal knowledge retrieval, decision support, intelligent Q&A
  • Advantages: sensitive documents uploaded in ciphertext, inference in hardware-protected zones, encrypted return
Other typical scenarios:
  • Medical imaging/medical record AI diagnosis (subject to the Personal Information Protection Law and HIPAA)
  • Legal/contract intelligent review (process contract plaintext in a secure environment)
  • Smart cockpit and in-vehicle assistant (compliant with the Several Provisions on Automotive Data Security Management)
  • Intelligent customer service and after-sales work orders (containing sensitive information such as ID card numbers and bank card fragments)
Two common traits:
  • Restricted cross-border data transfer (typical in finance, healthcare, government, and automotive)
  • Dual-blind data/model (typical in finance and legal)
Confidential inference deployment is based on a dedicated resource pool and billed by Token list price, targeting high-security confidential inference scenarios. For concepts, see Confidential inference overview and Billing. Insurance (underwriting/claim anti-fraud), HR (resume screening/interview minutes), cross-border business (multilingual customer service subject to GDPR), and other fields share the same characteristics. When selecting, evaluate whether confidential inference is applicable based on data-protection scenarios and dedicated capacity needs.