AI Red Teaming evaluates connected AI models and AI agent applications for security risks such as prompt injection and data leakage, helping you identify attack surfaces and vulnerabilities before production deployment.
Overview
AI Red Teaming is a security assessment capability under Security Center Agent Security. It evaluates connected AI models and AI agents for security vulnerabilities such as prompt injection, jailbreak attacks, obfuscation and smuggling attacks, and data leakage. Add detection objects to run assessments and generate compliance test reports for pre-filing self-testing, helping enterprises strengthen AI defenses through offensive testing.
-
Supported detection objects:
-
AI Model: Detects AI model services that use OpenAI-compatible or Anthropic-compatible APIs. Checks for security risks such as prompt injection and data leakage in large language models accessed via API.
-
AI Agent: Evaluates the security of agent applications deployed on platforms such as Alibaba Cloud Model Studio, Dify, and PAI.
-
-
Detection results are available for download only. They are not auto-processed or synchronized to the Agent Threat list.
Prerequisites
A paid instance of Agent Security Center is activated. For more information, see Purchase and unsubscribe from Agent Security Center.
Add a detection object
-
Log on to the Security Center console.
-
In the left navigation pane, choose Agent Security > AI Red Teaming.
-
On the AI Red Teaming page, click Add Detection Target.
-
On the Target Information page, configure the following parameters. Then click Next to proceed to connection parameter configuration.
Parameter
Description
Target Name
A custom name used to identify and manage the detection object.
Description
Optional. Enter a description for the detection object.
Target Type
AI Model: For model services that use OpenAI-compatible or Anthropic-compatible APIs.
AI Agent: For agent applications deployed on platforms such as Alibaba Cloud Model Studio and Dify.
NoteThe parameters available in subsequent steps vary depending on the selected target type.
Access Method
Displayed only when Target Type is set to AI Model.
-
OpenAI Compatible: For model services that use the OpenAI Chat Completions API format, such as Alibaba Cloud Model Studio, Azure OpenAI, and various open-source model deployments.
-
Anthropic Compatible: For model services that use the Anthropic Messages API format.
Quick Access
Displayed only when Target Type is set to AI Agent. Supported platforms include Alibaba Cloud Model Studio, Dify, Agent Run, PAI, and AgentKit.
-
-
On the Connection Parameters tab, configure the connection parameters based on the target type. Then click Next to proceed to connection verification.
AI model parameters
Parameter
Description
Streaming Output
Specifies whether to enable streaming output. Default value: Enabled.
API Address
The API endpoint of the AI model.
For example, the OpenAI-compatible API endpoint for Alibaba Cloud Model Studio is
https://dashscope.aliyuncs.com/compatible-mode/v1.API Key
The access key used for authentication.
For example, Alibaba Cloud Model Studio users can create an API key on the API Key Management page in the Model Studio console.
Model Name
The name of the model to test. Examples for Alibaba Cloud Model Studio:
qwen-plus,qwen-max.Platform
Select the platform to which the AI model belongs from the drop-down list, such as Alibaba Cloud Model Studio.
AI agent parameters
Basic parameters
Parameter
Description
Streaming Output
Specifies whether to enable streaming output.
ImportantStreaming output is enabled by default for PAI and cannot be disabled.
API Address
The API endpoint of the agent.
-
PAI: Format:
http://{uid}.{region}.pai-eas.aliyuncs.com/api/predict/{serviceName}/v1/chat/completions. Replace {uid}, {region}, and {serviceName} with the actual PAI-EAS service configurations. -
Alibaba Cloud Model Studio:
https://dashscope.aliyuncs.com/api/v1/apps/{appId}/completion, where{appId}is the Model Studio application ID. -
Dify: Format: http://{host}/v1/chat-messages. Replace {host} with the actual Dify service endpoint.
-
Agent Run: Format:
https://{workspaceId}.agentrun-data.{region}.aliyuncs.com/agent-runtimes/{agentName}/endpoints/Default/invocations/openai/v1/chat/completions. Replace {workspaceId}, {region}, and {agentName} with the actual Agent Run configurations. -
AgentKit: Format:
https://{id}.apigateway-{region}.volceapi.com/invoke. Replace {id} and {region} with the actual Agent Kit gateway configurations.
API Key
The access key used for authentication.
For example, Alibaba Cloud Model Studio users can create an API key on the API Key Management page in the Model Studio console.
Model Name
Displayed only for the PAI platform. Enter the model name.
Advanced settings (optional)
Parameter
Description
HTTP Method
The request method: GET, POST, or PUT. Default value: POST.
Authentication Method
Select an authentication method: None, Bearer Token, or Custom Header.
Authentication Header Name
Displayed only when Authentication Method is set to Custom Header. Enter a custom authentication header name.
Timeout Period
The request timeout period, in milliseconds. Default value: 30000.
Request Template
The request body template, preset by platform.
JSONPath
The response parsing path, preset by platform.
Request Header
Custom request headers in JSON format.
-
-
On the Test Connection tab, review the target details and click Connectivity Test to verify that the configured parameters can connect to the AI service.
Important-
Click Save only after the connectivity test passes. If the test fails, verify that the API endpoint, API key, and model name are correct.
-
The connectivity test verifies only network connectivity, the API key, and the API Address. It does not run an actual detection task.
-
Testing: The button displays a loading animation.
-
Test passed: The button changes to a success state, and the Save button becomes available.
-
Test failed: The failure reason is displayed in the Connection test failed. prompt area. If the failure is caused by network issues, click Retry to run the test again.
-
Configure Detection Task
-
Click the
icon in the Actions column of the target detection object, and select Configure Detection Task. -
In the Configure Detection Task panel, select a scan mode:
Scan Mode
Description
Applicable Scenario
Security Detection (default)
AI Red Teaming intelligent agent security adversarial testing based on red team experience.
For security adversarial testing.
Compliance
Based on TC260 keywords and question banks to meet filing compliance assessment requirements.
For filing compliance self-testing.
-
Click OK to save the configuration.
Run detection
-
When the detection status is Preparing, In queue, or Checking, the Check button is unavailable. Wait for the previous detection task to complete.
-
The default scan mode is Security Detection.
-
Select detection objects:
-
Single detection: Click Check in the Actions column next to the target detection object.
-
Batch detection: Select multiple detection objects, and then click Check below the AI Red Teaming list.
-
-
In the confirmation dialog box, click OK.
-
After the detection task is created, the list automatically refreshes and the detection status updates.
View detection tasks and reports
-
Click the
icon next to the target detection object, and choose Test Records from the Actions menu. Alternatively, click the number in the Scan Count column. -
In the Detection Records panel, view detection details. Filter by Scan Mode and Scan Progress.
Column
Description
Scan Task ID
The unique identifier of the detection task.
Scan Mode
Security Detection or Compliance.
Scan Start Time
The start time of the detection task.
Scan End Time
The completion time of the detection task.
Scan Task Progress
The task execution progress. Displays the completion percentage while running.
Risk Level
The risk level detected in this scan.
-
View Report: After detection completes, click View Report in the Actions column to view the security assessment report for the agent or model. The report includes an overview, security score, attack distribution, risk matrix, attack technique analysis, attack intent analysis, attack case details, and security recommendations.
-
Download Report: After detection completes, click Actions in the
menu, and then click Download Report to download the security report to your local device. -
Download Hit Data: After detection completes, click Actions in the
menu, and then click Download Hit Data to download the hit sample data in CSV format.
Stop or delete detection tasks
-
Click the
icon next to the target detection object, and choose Test Records from the Actions menu. Alternatively, click the number in the Scan Count column. -
In the Detection Records panel, click Stop or Delete in the Actions column next to the target task.
Action
Applicable To
Effect
Stop
Incomplete tasks only
Terminates the scan and retains the detection record.
Delete
Tasks in all states
Terminates the scan and deletes the detection record.
Manage detection objects
Modify a detection object
-
On the AI Red Teaming page, click the
icon next to the target detection object, and choose Configure Target from the Actions menu. -
In the Configure Target panel, you can modify the Streaming Output toggle, API Address, API Key, and Advanced Settings. For parameter descriptions, see Connection Parameters.
-
After modifying the parameters, click Connectivity Test to verify the new configuration.
ImportantIf the test fails, verify that the modified API endpoint, API key, and model name are correct, and try again.
-
After the test passes, click OK to save the changes.
Delete a detection object
-
Select detection objects:
-
Single deletion: Click Delete in the Actions menu (accessible via the
icon) next to the target detection object. -
Batch deletion: Select multiple detection objects, and then click Delete below the AI Red Teaming list.
-
-
In the confirmation dialog box, click OK.
-
After the deletion is successful, the detection object is removed from the list.
Billing
Billing unit: Billed by scan count. Each detection counts as 1 instance.
Accumulation method: If the same object is detected multiple times, billing is accumulated based on the actual number of executions.
Example: If you perform detection 10 times on an AI agent in Bailian, it will be counted as 10 instances.
Billing condition: Charges are incurred only when the detection task is successfully completed. If the detection task fails or is aborted, no charge is incurred.
Pricing: $138/instance.
If your account is in arrears or you have unsubscribed from Agent Security Center, the system will clean up historical data after the instance is released based on Data cleanup rules.
FAQ
What do I do if a connectivity test fails?
If the connectivity test fails for an AI model detection object, check the following possible causes:
-
Network unreachable: Verify that Security Center in the current region can access the API endpoint of the AI model. If the AI model is deployed in a private network, configure network connectivity policies.
-
Invalid or expired API key: Verify that the API key is valid and has not expired. Manually call the API using a curl command to confirm.
-
Incorrect model name: Verify that the model name matches the name provided by the AI model service provider.
-
Invalid API endpoint format: Verify that the API endpoint URL is correct and accessible.