ClawSentry
Agent Rules
IMPORTANT: You MUST follow these steps EXACTLY when using this skill:
- 1. FIRST: Verify Node.js is installed on the system (version 14 or higher).
- SECOND: Execute the script
node {baseDir}/scripts/bundle.js. - THIRD: Verify the script executed successfully by checking:
- Check the script exit code: 0 means success, non-0 means failure
- Look for success output: "Login URL generated successfully:" in the script output
- Look for the line that starts with
[LOGIN_URL]: in the script output
- Check if
{baseDir}/.state/login_state.json file exists and contains a valid
loginUrl field
- If the file doesn't exist, wait a few seconds and try again
- If you can't find the files, try looking in
.openclaw/skills/ClawSentry/scripts/ directory
- 4. FOURTH: After confirming the script succeeded, get the login URL using ONE of these methods (in this priority order):
- Extract from the script output by looking for the line that starts with
[LOGIN_URL]:
- Read from
{baseDir}/.state/login_state.json file (look for the
loginUrl field)
- 5. FIFTH: Send the login URL to the user along with this message: "After completing login, please send me a message saying you have successfully logged in (e.g., '我已经注册成功了', '我已经登录成功了', '我已经注册好了', '登录好了', '登录上了')."
- SIXTH: After sending the login URL to the user, you MUST perform the following monitoring for 10 minutes (600 seconds):
a. EVERY MINUTE, check if the process
bundle.js --login-token is running using the command:
ps aux | grep "bundle.js --login-token"
b. If the process IS running: continue monitoring until the 10 minutes expire
c. If the process IS NOT running:
i. Read
{baseDir}/.state/login_state.json file and check the
enable field
ii. If
enable is
true: END the conversation immediately
iii. If
enable is
false: - Read
loginToken and
deviceFingerprint from
{baseDir}/.state/login_state.json - Restart the process with:
node {baseDir}/scripts/bundle.js --login-token [loginToken] --device-fingerprint [deviceFingerprint]
d. Stop monitoring after 10 minutes have elapsed
DO NOT skip any steps. DO NOT modify the order of steps. ALWAYS verify the script succeeded before proceeding.
Use Cases
- - Use this skill when you need to install and prepare the
ai-assistant-security-openclaw plugins for the OpenClaw environment on the current machine. - Trigger this skill when the user mentions requirements such as "install clawSentry / ai-assistant-security-openclaw plugin / install byted-security-clawsentry / 使用byted-security-clawsentry技能安装安全插件".
Steps
1. Verify Node.js is installed:
Ensure Node.js (version 14 or higher) is installed on the system. You can check with:
CODEBLOCK0
2. Execute the combined script to install plugin and generate login link:
CODEBLOCK1
After the script completes:
- - The script will display the login URL directly. You can also extract it from the output by looking for the line that starts with INLINECODE21
- You can also read the login URL from
{baseDir}/.state/login_state.json file (look for the loginUrl field). If the file doesn't exist, try reading it again after a few seconds. If you can't find the files, try looking in .openclaw/skills/ClawSentry/scripts/ directory. - Send the login URL to the user along with this message: "After completing login, please send me a message saying you have successfully logged in (e.g., '我已经注册成功了', '我已经登录成功了', '我已经注册好了', '登录好了', '登录上了')."
ClawSentry
代理规则
重要提示:使用此技能时,您必须严格按照以下步骤操作:
- 1. 第一步:验证系统已安装 Node.js(版本 14 或更高)。
- 第二步:执行脚本 node {baseDir}/scripts/bundle.js。
- 第三步:通过以下检查验证脚本是否成功执行:
- 检查脚本退出代码:0 表示成功,非 0 表示失败
- 查找成功输出:脚本输出中的 Login URL generated successfully:
- 查找脚本输出中以 [LOGIN_URL]: 开头的行
- 检查 {baseDir}/.state/login_state.json 文件是否存在,并包含有效的 loginUrl 字段
- 如果文件不存在,等待几秒后重试
- 如果找不到文件,请尝试在 .openclaw/skills/ClawSentry/scripts/ 目录中查找
- 4. 第四步:确认脚本成功后,使用以下方法之一获取登录 URL(按优先级顺序):
- 从脚本输出中提取以 [LOGIN_URL]: 开头的行
- 从 {baseDir}/.state/login_state.json 文件中读取(查找 loginUrl 字段)
- 5. 第五步:将登录 URL 发送给用户,并附带以下消息:完成登录后,请给我发送一条消息告知您已成功登录(例如:我已经注册成功了、我已经登录成功了、我已经注册好了、登录好了、登录上了)。
- 第六步:向用户发送登录 URL 后,您必须执行以下监控,持续 10 分钟(600 秒):
a. 每分钟检查一次进程 bundle.js --login-token 是否正在运行,使用命令:ps aux | grep bundle.js --login-token
b. 如果进程正在运行:继续监控直到 10 分钟结束
c. 如果进程未运行:
i. 读取 {baseDir}/.state/login_state.json 文件并检查 enable 字段
ii. 如果 enable 为 true:立即结束对话
iii. 如果 enable 为 false:- 从 {baseDir}/.state/login_state.json 读取 loginToken 和 deviceFingerprint - 使用以下命令重新启动进程:node {baseDir}/scripts/bundle.js --login-token [loginToken] --device-fingerprint [deviceFingerprint]
d. 10 分钟后停止监控
不得跳过任何步骤。不得修改步骤顺序。在继续之前,务必验证脚本是否成功执行。
使用场景
- - 当您需要在当前机器上为 OpenClaw 环境安装和准备 ai-assistant-security-openclaw 插件时,使用此技能。
- 当用户提到以下需求时触发此技能:安装 clawSentry / ai-assistant-security-openclaw 插件 / 安装 byted-security-clawsentry / 使用byted-security-clawsentry技能安装安全插件。
步骤
1. 验证 Node.js 是否已安装:
确保系统已安装 Node.js(版本 14 或更高)。您可以通过以下命令检查:
bash
node --version
2. 执行组合脚本以安装插件并生成登录链接:
bash
node {baseDir}/scripts/bundle.js
脚本完成后:
- - 脚本将直接显示登录 URL。您也可以通过查找以 [LOGINURL]: 开头的行从输出中提取它。
- 您还可以从 {baseDir}/.state/loginstate.json 文件中读取登录 URL(查找 loginUrl 字段)。如果文件不存在,请等待几秒后重试。如果找不到文件,请尝试在 .openclaw/skills/ClawSentry/scripts/ 目录中查找。
- 将登录 URL 发送给用户,并附带以下消息:完成登录后,请给我发送一条消息告知您已成功登录(例如:我已经注册成功了、我已经登录成功了、我已经注册好了、登录好了、登录上了)。