Connect to DataGuard

Updated at:

DataGuard for Agent provides two onboarding forms based on where agents run: built-in and endpoint. This topic describes how to enable DataGuard on PolarDB Agent Express, and how to complete one-click installation on endpoint agents and verify that protection is in effect.

Prerequisites

  • An Alibaba Cloud account is available, and you can access the DataGuard console.

  • For built-in onboarding, the PolarDB Agent Express version must be v2026.3.28#20260507 or later.

  • For endpoint onboarding, an administrator must create a dedicated RAM user, grant it the AliyunHDMFullAccess permission, and prepare the AccessKey pair of the RAM user.

Onboarding methods

DataGuard for Agent provides two onboarding forms based on where agents run: built-in for database agents, and one-click installation for endpoint agents. First confirm which category your agent belongs to in the following table, then go to the corresponding section.

Form

Platform

Onboarding method

Database agents

PolarDB Agent Express

Built in. Disabled by default after you create an application; enable it manually. For the procedure, see Enable DataGuard on PolarDB Agent Express.

Endpoint agents

Qoder

One-click installation. For the procedure, see One-click installation on endpoint agents.

Codex

Qoderwork

Qwenwork CN

Cursor

Enable DataGuard on PolarDB Agent Express

PolarDB Agent Express has DataGuard built in, so no installation is required. This section describes the usage notes before enabling, the enablement procedure, and the verification method.

Usage notes

  • DataGuard is disabled by default when a PolarDB Agent Express application is created. Enable it manually.

  • Enabling DataGuard requires restarting the PolarDB Agent Express application. Perform this operation during off-peak hours.

  • Security rules take effect globally and cannot be disabled by users. If a false positive is confirmed, contact your administrator.

Procedure

  1. Log on to the PolarDB Agent Express console and go to Configuration > General Configuration.

  2. In the configuration parameters, set polarclaw.values.openclawConfig.plugins.entries.das-audit.config.enableToolCheck=true to enable tool call interception.

    After enablement, the system detects and intercepts high-risk operations that agents perform through tools in real time. Configuration example:

    polarclaw.values.openclawConfig.plugins.entries.das-audit.config.enableToolCheck=true
  3. Restart the PolarDB Agent Express application to apply the configuration.

Verify that protection is in effect

After tool interception is enabled, PolarDB Agent Express automatically refuses to execute sensitive operations. For example, ask the agent to run the following high-risk command:

rm -rf

The system blocks the operation and returns a security message. If no interception message appears, check whether the configuration parameter has been saved and confirm that the application has been restarted.

Handle false positives

If a normal operation is mistakenly intercepted by a security rule, handle it as follows.

Scenario

Handling method

The session is locked due to high risk

Wait about 10 minutes for the risk score to decay and the session to recover, or start a new session.

The same rule is frequently triggered by mistake

Contact your security administrator to evaluate whether a whitelist should be added for the specific scenario or the rule threshold should be adjusted.

Note

Security rules take effect globally and cannot be disabled by users. If a false positive is confirmed, contact your administrator.

One-click installation on endpoint agents

Endpoint agents are connected by using a one-click installation command. The installation has three steps: prepare an AccessKey pair, run the installation command, and confirm in the console. The installation script automatically detects the endpoint agents installed on the local machine.

Step 1: Create a RAM user and obtain an AccessKey pair

Warning

Keep the AccessKey ID and AccessKey Secret secure. The AccessKey Secret is displayed only once when it is created. It cannot be viewed or recovered afterwards. If it is lost, you must create a new AccessKey pair.

DataGuard authenticates endpoint agent identities by using AccessKey pairs. Use the AccessKey pair of a dedicated RAM user, not an Alibaba Cloud account (root account). For the detailed procedure, see Create and authorize a RAM user. The procedure has three steps:

  1. Create a RAM user: Log on to the RAM console and go to Identities > Users > Create User. Enter a user name (such as agentguard) and select Use permanent AccessKey for access as the access mode.

  2. Save the AccessKey pair: Immediately save the AccessKey ID and AccessKey Secret after creation (see the warning above).

  3. Grant permissions: Add a permission grant for the RAM user. Search for hdm in the policy list and select the system policy AliyunHDMFullAccess (full management permissions on Database Autonomy Service (DAS); DAS was formerly named HDM, so the system policy name uses HDM).

After creation and authorization, view the created AccessKey pair on the Credentials tab of the RAM user details page, and confirm that its status is Enabled.

Step 2: Run the installation command and initialize the AccessKey pair

  • macOS:

    curl -fsSL https://dataguard-plugin.oss-cn-beijing.aliyuncs.com/release/install.sh | bash
  • Windows:

    irm https://dataguard-plugin.oss-cn-beijing.aliyuncs.com/release/install.ps1 | iex
Note

If the command provided in this topic does not run properly, click the image icon in the upper-right corner of the page to obtain the latest installation command.

The installation script automatically detects the endpoint agents installed on the local machine (such as Qoder, QoderWork, and QwenWorkCN). Press Enter to protect all detected agents, or enter numbers or names to select specific agents. Then enter the AccessKey ID and AccessKey Secret from Step 1 to complete initialization.

The AccessKey ID is stored in config.json. The AccessKey Secret is stored only in the operating system credential store (Keychain or Credential Manager) and is not written to any file. After successful installation, the installed version of each agent is printed one by one.

Step 3: Confirm agent onboarding in the console

Log on to the DataGuard console and confirm that the agent appears on the Agent Management page.

After a plugin reports for the first time, it is automatically registered at the instance level and monitoring is enabled, with no manual claiming required. On the page, you can view the number of agents with monitoring enabled, today's alerts for each agent, the first discovery time and region, and set the running mode (observe mode or guard mode) per agent. For the page field descriptions and how to switch modes, see Use the DataGuard console.

Capability differences on endpoint agents

Endpoint agents and PolarDB Agent Express share the same policy engine, and the interception rules are identical. The two differ in running mode switching, uninstallation, and upgrade methods.