Skip to main content

Confidential inference

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

1 Introduction to confidential inference

Confidential inference is built on TEE (Trusted Execution Environment) hardware-based confidential computing technology and can effectively defend against multi-layer security threats, including privileged attacks. Its core security features include:
  • End-to-end encryption: An application-layer encrypted channel is established on top of HTTPS, covering the entire path 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 ephemeral keys; all keys reside only in encrypted volatile memory, are never written to disk or persisted, and are destroyed when the session ends.
  • Hardening and measurement: With both chip-level hardware isolation and software hardening, the boot chain and runtime environment are measured end to end; at the block storage level, the root partition relies on a Merkle Tree mechanism for integrity, and data partitions are encrypted with one-time keys for confidentiality.
  • Software and hardware transparency: The client directly accesses the TEE vendor to verify the authenticity of the remote attestation report generated by the hardware, and checks the transparency log service to confirm the integrity of the server-side software artifacts.
For supported models and pricing, see Billing. Intended users: enterprise scenarios with high data security requirements. For typical industries, see Application scenarios. Workflow:
Activate the service (sign the Special Terms)
  │
  ▼
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 Advantages of confidential inference

  • Defense in depth: From chip-level hardware isolation and end-to-end encrypted transmission to client-verifiable remote attestation, a multi-layer protection system spanning hardware, transmission, and software is established. The platform does not retain plaintext prompts, model outputs, or encryption keys; keys and content remain in the hands of the user.
  • Low-intrusion integration: Compatible with existing invocation methods; no business code refactoring is required—only replace the invocation endpoint and the client SDK. Confidential and non-confidential paths can coexist under the same account. For invocation details, see Invoke after deployment.

3 Billing

Confidential inference deployments are billed at the token list price, covering three items: input, output, and context cache (implicit) hits. Supported models: cmaas-qwen3.8-flash, cmaas-glm-5.3, cmaas-deepseek-v4.1-flash, cmaas-deepseek-v4-pro-0813.
  • North China 2 (Beijing)
  • Qwen
  • GLM
  • DeepSeek

Model code

Input

$ per million tokens

Output

$ per million tokens

Cache hit

$ per million tokens

cmaas-qwen3.8-flash

0.452

1.413

0.057

4 Activation and deployment

To activate confidential inference, you must meet the following prerequisites:
  1. Activation: Contact Alibaba Cloud sales to apply for access.
  2. Region: The China (Beijing) region is currently supported.
  3. Compliance agreement: Before deployment, you must sign the Alibaba Cloud Model Studio Confidential Inference Service Special Terms.
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 Terms and click "Confirm activation and use" to activate the service.

Create a deployment

Before deployment, confirm that the models used on the business side are supported by confidential inference (see Billing). Deployment steps:
  1. Log on to the Model Studio console. In the left-side navigation pane, choose Model inference > Confidential inference to go to the confidential inference page (this page displays a list of existing deployments, including information such as model code, billing method, rate limit details, creation time, and operations), 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 that have been deployed are marked as "Deployed"); the Billing Method is fixed to "Pay by Token"; in Rate Limit Configuration, TPM/RPM are automatically set to the upper limit values after you select a model and require 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.
The following table describes the deployment parameters. Billing is at the token list price (see Billing); TPM/RPM are set to the upper limit values by default and require no editing.
ParameterDescription and value
Select modelFor supported models, see Billing
Billing methodBilled at the token list price (three items: input/output/cache hit)
TPM (tokens per minute)Upper limit of the token rate limit per minute. It is set to the upper limit value by default (500000 if no increase has been requested); requests are throttled as the limit is approached;
RPM (requests per minute)
Key negotiation requests are also counted toward the RPM quota, so the inference RPM actually available may be slightly lower than the configured value.
Upper limit of the request rate limit per minute. It is set to the upper limit value by default (300 if no increase has been requested);
After deployment, monitor the metrics in the following table to determine whether to scale up or optimize prompts.

Metric name

Description

Normal range

Recommended action on anomaly

Token usage

Input, output, and cache hit token consumption per unit of time

Below the configured TPM rate limit

If usage spikes, check the business request volume and prompt length; evaluate scaling up or optimizing the prompt structure if necessary

Cache hit rate

Proportion of requests served from cache out of the total requests

The higher, the more cost saved (no fixed threshold)

If the hit rate is low, optimize the prompt structure to improve reuse and increase the per-unit overall cost advantage

Resource pool usage

Capacity utilization of the dedicated resource pool

No overflow (the dedicated resource pool never overflows)

No action required

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

5 Invoke after deployment

After the model is deployed, 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 the confidential inference SDK is installed, run the make command in the SDK root directory to build the confidential inference sample CLI program cmaas-client and the local API conversion proxy tools openai-proxy/anthropic-proxy in the bin directory. You can also refer to the README in the SDK directory to develop and build confidential inference tools that fit your business scenarios.
  • Using the confidential inference CLI tool cmaas-client
  • openai-proxy (OpenAI-compatible interface)
  • anthropic-proxy (Anthropic-compatible Messages interface)
# MacOS/Linux
# Set 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 "简短介绍大语言模型" --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 "简短介绍大语言模型" --stream

Viewing 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 CLI tool for offline security audits 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 the feature is disabled, other audit materials such as remote attestation are still retained. For authentication methods and error codes, see the SDK call responses.

6 Application scenarios

Confidential inference targets scenarios where the business needs to call cloud-based large models, but at least one of customer data, business data, or model weights is subject to a hard constraint that "the plaintext must not be exposed to the other party". Financial risk control and anti-fraud inference
  • Applicable to: credit review, fraud detection, and risk control decision support
  • Advantages: data/model double blindness; aligned with the JR/T 0197 C3/C4 requirements for financial data encryption and access control
Large model applications in government and state-owned enterprises
  • Applicable to: internal knowledge retrieval, decision support, and intelligent Q&A
  • Advantages: sensitive documents uploaded as ciphertext, inference in hardware-protected areas, and encrypted return transmission
Other typical scenarios:
  • AI diagnosis of medical images/records (subject to the Personal Information Protection Law and HIPAA)
  • Intelligent legal/contract review (contract plaintext processed in a secure environment)
  • Smart cockpits and in-vehicle assistants (compliant with the Several Provisions on Automotive Data Security Management)
  • Intelligent customer service and after-sales tickets (involving sensitive information such as ID card numbers and partial bank card numbers)
Two common characteristics:
  • Restricted data egress (typical in finance, healthcare, government, and automotive)
  • Data/model double blindness (typical in finance and legal)
Confidential inference deployments run on dedicated resource pools and are billed at the token list price, targeting high-security confidential inference scenarios. For the concepts, see Introduction to confidential inference and Billing. Insurance (underwriting/claims anti-fraud), HR (resume screening/interview minutes), and cross-border business (multilingual customer service that must comply with GDPR) also share the characteristics above. When selecting a solution, evaluate whether confidential inference applies based on your data protection needs and dedicated capacity requirements.