All Products
Search
Document Center

AI Guardrails:OpenClaw integration guide

Last Updated:Dec 02, 2026

AI Agent runtimes such as OpenClaw face security risks including prompt injection, sensitive data leakage, and malicious command execution, which are difficult to defend against relying solely on the model's own capabilities. This topic describes how to use AI Guardrails to build runtime security protection, detecting and blocking potential threats in real time at the user input and model output stages, so that OpenClaw runs securely and under control.

Solution overview

OpenClaw is an open-source AI Agent framework that supports calling large models through natural language instructions to complete complex tasks. However, at runtime, AI Agents face the following security risks:

  • Prompt Injection: Attackers use carefully crafted inputs to manipulate the model into outputting malicious content or performing unauthorized operations.

  • Sensitive data leakage: The model may accidentally expose personal information, corporate secrets, or system credentials when generating content.

  • Malicious command execution: Attackers induce the model to visit phishing links or download trojan files, threatening system security.

Alibaba Cloud AI Guardrails provides runtime protection. The openclaw-security-assistant plugin detects risks in real time at both the user input (Prompt) and model output (Response) stages and blocks threatening requests. The protection mechanisms include:

  • Input detection: Before a request is sent to the large model, detects risks such as prompt injection and sensitive information, and blocks malicious input.

  • Output detection: Before the model response is returned to the user, detects risks such as sensitive information leakage and malicious links, and filters dangerous content.

  • Audit logs: Records all detection events and supports querying interception details in the console, facilitating post-incident analysis and tracing.

Prerequisites

Before installing the plugin, make sure that the server environment meets the following requirements.

Environment dependencies

  • Node.js environment: Node.js 22 or later is required.

    • Verification command: node --version.

    • Expected output: v22.0.0 or later.

  • OpenClaw installed: OpenClaw must already be installed on the system.

    • Verification command: openclaw -h.

    • Expected output: OpenClaw CLI help information.

Permission requirements

You must have an Alibaba Cloud account with access to the AI Guardrails console.

Install the plugin

Note

For information about the data collected by the plugin, see OpenClaw Runtime Protection Plugin Installation Guide.

Step 1: Authorize the security plugin to call the AI Guardrails service

  1. Log on to the AI Guardrails console. In the left-side navigation pane, click Overview, and click OpenClaw in the Product Integration section to open the OpenClaw plugin panel.

  2. In the SLR Authorization section, click Authorize and follow the instructions to complete the authorization.

Step 2: Confirm and configure the detection policy

  1. In the Get Installation Instructions section of the OpenClaw plugin panel, click Go to Maintenance.

  2. On the agent_runtime_guard-Management page, adjust the protection dimensions as needed. We recommend enabling the following protection dimensions:

    • Sensitive content: Detects personal or corporate sensitive information that may appear when using large models, to prevent data leakage.

    • Prompt Injection Attack: Detects prompt manipulation designed to target large models, to prevent the model from outputting malicious content or threatening system security.

    • Malicious URL: Detects risks such as phishing links and trojan websites that may exist in content generated or parsed by large models, to prevent data leakage and security intrusion.

    Note

    Alternatively, in the left-side navigation pane, choose Protection Config > Model Protection to go to the Model Protection page. Search for the record whose Service name is Agent Runtime Protection (the Service is agent_runtime_guard), click its Management, and finally go to the agent_runtime_guard-Management page.

Step 3: Obtain the installation command

Copy the installation command from the Get Installation Command section of the OpenClaw plugin panel.

For example: wget -q "https://update.aegis.aliyun.com/download/openclaw-security-assistant/1.1.0/linux/installer.sh" && chmod +x installer.sh && ./installer.sh install --key "5PfVLF******aK6x8I" --autoRestart

Important

The installation command is valid for 24 hours. After it expires, obtain it again from the console. To prevent command leakage, you can click the refresh button in the Get Installation Command section to regenerate it.

Step 4: Run the installation command

The following two installation methods are supported. Choose based on your actual scenario.

Installation method

Applicable scenario

Advantage

Notes

Method 1: OpenClaw automatic installation

OpenClaw automated deployment scenarios

OpenClaw completes the installation automatically and enables protection immediately

OpenClaw must have installation permissions

Method 2: Log on to the server and install manually

You need to control the installation process manually

You can check dependencies before installation, and the process is controllable

You must confirm the status manually, and the Gateway must be restarted during installation

OpenClaw automatic installation

Send the installation command obtained in Step 3 to OpenClaw through the OpenClaw UI or a configured IM channel, instructing it to run the command. OpenClaw completes the plugin installation automatically. An example prompt is as follows:

Run the following command to install the security plugin:
wget -q "https://update.aegis.aliyun.com/download/openclaw-security-assistant/1.1.0/linux/installer.sh" && chmod +x installer.sh && ./installer.sh install --key "5PfVLF******aK6x8I" --autoRestart

Log on to the server and install manually

Log on to the target server and run the installation command copied in Step 3:

wget -q "https://update.aegis.aliyun.com/download/openclaw-security-assistant/1.1.0/linux/installer.sh" && chmod +x installer.sh && ./installer.sh install --key "5PfVLF******aK6x8I" --autoRestart
Important

During installation, the OpenClaw Gateway is restarted to make the plugin take effect.

Step 5: Confirm the plugin installation result

Run the following command to view the plugin status:

openclaw plugins info @alicloud/openclaw-security-assistant

If the output is similar to the following, the installation is successful.

@alicloud/openclaw-security-assistant
id: openclaw-security-assistant
Security assistant plugin by Alibaba Cloud that provides LLM request/response protection, tool call security checks.

Status: loaded
Source: ~/.openclaw/extensions/openclaw-security-assistant/bundle.js
Origin: global
Version: 1.1.0
Services: openclaw-security-assistant-auth, openclaw-security-assistant-asset-report

Install: npm
Spec: @alicloud/openclaw-security-assistant
Install path: ~/.openclaw/extensions/openclaw-security-assistant
Recorded version: 1.1.0
Installed at: 2026-04-01T09:49:36.232Z

Step 6: Test the protection effect

  1. Send a test request.

    Send a test request through OpenClaw that contains risky content such as sensitive words or abnormal commands.

  2. View the interception logs in the console.

    1. Log on to the AI Guardrails console. In the left-side navigation pane, choose Detection Results > Result Query

    2. On the Model/Claw Protection tab, filter by Service agent_runtime_guard and the relevant time conditions to view the interception logs.

Uninstall the plugin

If you no longer need AI Guardrails to protect OpenClaw, you can uninstall the plugin.

Important

Uninstalling removes the plugin and its configuration, and protection stops immediately.

Before uninstalling, we recommend that you:

  • Confirm in the console that there are no active protection policies.

  • Confirm that business traffic has been switched to another protection solution.

Run the following command to uninstall the plugin:

wget -q "https://update.aegis.aliyun.com/download/openclaw-security-assistant/1.0.0/linux/openclaw-security-assistant-install.sh" && chmod +x openclaw-security-assistant-install.sh && ./openclaw-security-assistant-install.sh uninstall

After uninstalling, verify that the plugin has been removed:

openclaw plugins list

After uninstalling, runtime protection no longer takes effect for the OpenClaw Agent. The security policies configured in the AI Guardrails console are no longer executed.

Troubleshooting

If you encounter problems during installation or verification, refer to the following troubleshooting table.

Symptom

Possible cause

Troubleshooting steps

Installation command fails

Node.js version is earlier than 22

Run node --version to check the version and upgrade to 22+

OpenClaw CLI is not installed

Run openclaw -h to verify, and install OpenClaw according to the official documentation

Network connection fails

Check the network connection and make sure that the npm mirror and Alibaba Cloud API are accessible

Insufficient permissions

Confirm that the current user has OpenClaw installation permissions, or run with sudo

Plugin installed but not activated

Gateway not restarted

Manually restart the OpenClaw Gateway: openclaw gateway restart

Plugin configuration file is corrupted

Reinstall the plugin and verify the integrity of the configuration file

Interception does not take effect

Console authorization is not completed

Log on to the console to check the authorization status and perform the authorization again

Console policy configuration is not enabled

Go to the policy configuration page and confirm that the protection dimensions are enabled

The test request does not trigger detection rules

Strengthen the risk characteristics of the test request (for example, add more obvious sensitive words)

No detection results in the console

The plugin is not properly connected to the Protection Server

Check the network connection and confirm that the plugin can access the Protection Server (domain: protection-server.aliyun.com)

Detection result reporting is delayed

Wait 1 to 2 minutes and refresh the console page

Data collection checklist

This plugin collects the following four categories of data for runtime protection.

Note

This plugin does not collect the following sensitive information from standard HTTP request headers: Authorization, X-API-Key, API-Key, apikey, X-Auth-Token, auth-token, Cookie, Set-Cookie

Device and environment information

Data item

Description

Purpose

machine_id

Unique device identifier

Identifies the device for security auditing

platform

Operating system platform (such as Linux, Windows)

Identifies the runtime environment type

arch

CPU architecture (such as x64, arm64)

Adapts to platform characteristics

node_version

Node.js version number

Ensures compatibility

openclaw_version

OpenClaw version number

Adapts to OpenClaw version characteristics

OpenClaw configuration information

Data item

Description

Purpose

gateway_config

Gateway configuration (port, timeout settings, etc.)

Analyzes traffic characteristics

provider_list

List of configured Providers

Identifies LLM providers

agent_list

List of created Agents

Identifies application scenarios

skill_config

Skill configuration information

Analyzes the tool call chain

plugin_list

List of other installed plugins

Identifies potential conflicts

LLM request/response content (security audit)

Data item

Description

Purpose

user_prompt

The prompt entered by the user

Detects prompt attacks and sensitive content

system_prompt

System prompt

Detects configuration risks

llm_response

Response content generated by the LLM

Detects content compliance and sensitive information leakage

model_name

Name of the model called

Analyzes model behavior characteristics

temperature

Generation temperature parameter

Analyzes the generation strategy

Tool Call information (security audit)

Data item

Description

Purpose

tool_name

Name of the tool called

Detects malicious tool calls

tool_input

Input parameters of the tool call

Detects injection attacks and sensitive information

tool_output

Return result of tool execution

Detects information leakage

execution_time

Tool execution time

Analyzes performance anomalies

error_message

Tool execution error message (if any)

Detects abnormal behavior

Data transmission description:

Server endpoint

Transmitted data type

Transmission frequency

Encryption method

Management Server

Device information, OpenClaw configuration

Once at plugin startup, and in real time on configuration changes

HTTPS + TLS 1.2+

Protection Server

LLM request/response, Tool Call information

In real time for each request

HTTPS + TLS 1.2+