Enable the Security Guardrail
The Security Guardrail detects security risks such as sensitive words, compliance violations, prompt poisoning, and brute-force attacks in content that you publish through MSE Nacos. Enable the Security Guardrail to check configurations and MCP services for security and compliance issues before they take effect.
Prerequisites
An MSE Nacos instance is created. For more information, see Create an MSE Nacos instance.
The Nacos instance runs Enterprise Edition with engine version
3.1.1.0or later. Developer Edition and Professional Edition instances do not support the Security Guardrail feature.For first-time use, you must complete service access authorization. Follow the on-screen instructions to authorize the
AliyunServiceRoleForMSEEngineServiceservice-linked role.
Features
The Security Guardrail provides the following detection capabilities:
| Protection dimension | Description | Protection level options |
| Malicious URL detection | Detects whether the content contains dangerous URLs, such as malicious links and phishing sites | Block None / Low-risk / Medium-risk / High-risk |
| Prompt attack detection | Detects malicious prompts, such as prompt injection attacks and jailbreak attacks | Block None / Low-risk / Medium-risk / High-risk |
| Content compliance detection | Detects whether the content meets regulatory requirements, including political, violent or terrorism-related, and prohibited content | Block None / Low-risk / Medium-risk / High-risk |
| Sensitive content detection | Detects whether the content contains private information leaks, sensitive data, or similar content | Block None / Low-risk / Medium-risk / High-risk |
Protection levels
The protection level determines how the system handles detected risks. The levels range from the strictest policy (blocks the most content) to the most tolerant policy (blocks only the highest-severity content):
Block None: Logs the event only. Does not block any content or affect the publishing workflow.
Low-risk: Blocks content classified as low-risk or above, including medium-risk and high-risk content. This is the strictest policy.
Medium-risk: Blocks content classified as medium-risk or above, including high-risk content. Low-risk content is logged but not blocked.
High-risk: Blocks only content classified as high-risk. This is the most tolerant policy.
Configure the Security Guardrail
Enable the Security Guardrail
Log on to the MSE console.
In the left-side navigation pane, choose Microservices Registry > Instances.
On the Instances page, click the name of the target instance to go to the instance details page.
In the left-side navigation pane, choose Security Protection > Content Moderation Guardrail.
NoteThe Security Guardrail feature is labeled as Content Moderation Guardrail in the MSE console navigation.
Click Enable to enable the Security Guardrail feature.
NoteAfter you enable the feature, the system checks published content for security and compliance risks, including private information leaks, malicious script injection, and non-compliant content.
First-time users must complete service access authorization. Follow the on-screen instructions to authorize the
AliyunServiceRoleForMSEEngineServicerole.
Configure the protection strategy
On the Protection Strategy Settings page, configure the Interception Policy for each protection dimension based on your business requirements.
For each of the four dimensions -- Malicious URL detection, Prompt attack detection, Content compliance detection, and Sensitive content detection -- select a protection level: Block None, Low-risk, Medium-risk, or High-risk. For more information about each level, see Protection levels.
Configure the Protection Scope and select the scenarios that require security checks:
Configuration item Description Configuration creation and change When selected, the system performs security checks when Nacos configurations are created or changed. MCP service creation and change When selected, the system performs security checks when MCP servers are created or changed. Click Save Changes.
ImportantThe Security Guardrail takes effect immediately after you save the configuration. All subsequent publishing operations are checked based on the configured policies.
Verify the Security Guardrail
After you configure the Security Guardrail, the following actions occur when you publish a configuration or an MCP service:
The system automatically checks the published content for security and compliance risks.
Based on the configured protection policies, the system logs or blocks the content.
You can go to the Security Guardrail console to view interception records.