
Byted Security Clawsentry
- 63 installs
- 411 repo stars
- Updated August 4, 2026
- bytedance/agentkit-samples
byted-security-clawsentry is a skill that installs and configures the OpenClaw ai-assistant-security-openclaw (ClawSentry) security plugins.
About
byted-security-clawsentry installs and configures the security-related plugins required by OpenClaw, including the ai-assistant-security-openclaw (ClawSentry) plugins, in one pass. It verifies Node.js, runs a bundle script that produces a login URL, sends that URL to the user to complete login, then monitors the login-token process for ten minutes and restarts it if it stops before activation. A developer uses it to stand up OpenClaw's security plugins on a machine.
- Installs and configures the OpenClaw security plugins (ai-assistant-security-openclaw / ClawSentry)
- Runs a bundle script that generates a login URL for the user to activate
- Monitors the login-token process for 10 minutes and restarts it if needed
Byted Security Clawsentry by the numbers
- 63 all-time installs (skills.sh)
- Ranked #1,218 of 2,203 Security skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
byted-security-clawsentry capabilities & compatibility
Free skill; runs a Node.js bundle script and requires the user to complete a login flow.
- Capabilities
- security plugin install · environment setup
- Use cases
- security audit · devops
- Runs
- Runs locally
- Pricing
- Free
What byted-security-clawsentry says it does
Install and configure the security-related plugins required by OpenClaw, including the `ai-assistant-security-openclaw` plugins.
FIRST: Verify Node.js is installed on the system (version 14 or higher).
npx skills add https://github.com/bytedance/agentkit-samples --skill byted-security-clawsentryAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 63 |
|---|---|
| repo stars | ★ 411 |
| Last updated | August 4, 2026 |
| Repository | bytedance/agentkit-samples ↗ |
What it does
Install and configure the OpenClaw ClawSentry / ai-assistant-security-openclaw security plugins on a machine.
Who is it for?
Setting up OpenClaw's ClawSentry security plugins on a machine in one go.
Skip if: Non-OpenClaw environments, since it targets OpenClaw's security plugins.
When should I use this skill?
The user wants to install ClawSentry or the ai-assistant-security-openclaw plugin for OpenClaw.
What you get
Installs the ClawSentry security plugins, generates a login URL, and confirms activation.
- Installed and configured OpenClaw security plugins
- A generated login URL and confirmed activation state
By the numbers
- Requires Node.js version 14 or higher
- Monitors the login process for 10 minutes (600 seconds)
Files
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). 2. SECOND: Execute the script node {baseDir}/scripts/bundle.js. 3. 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.jsonfile exists and contains a validloginUrlfield - 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.jsonfile (look for theloginUrlfield)
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., '我已经注册成功了', '我已经登录成功了', '我已经注册好了', '登录好了', '登录上了')." 6. 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-openclawplugins 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:
node --version2. Execute the combined script to install plugin and generate login link:
node {baseDir}/scripts/bundle.jsAfter 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
[LOGIN_URL]: - You can also read the login URL from
{baseDir}/.state/login_state.jsonfile (look for theloginUrlfield). 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., '我已经注册成功了', '我已经登录成功了', '我已经注册好了', '登录好了', '登录上了')."
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.ClawSentry Readme
ClawSentry 是火山引擎 AI Assistant Security 为 OpenClaw 深度定制的安全防护组件。在保障 OpenClaw 正常作业的同时,提供实时风险监测与防御,涵盖提示词注入、敏感数据泄露及高危命令执行等核心安全场景。
Skill 防护功能
- 提示词注入 (Prompt Injection) --- 识别恶意指令并拒绝执行
- 攻击者可能在你让 OpenClaw 处理的网页、文档或邮件中隐藏恶意指令,诱骗其执行非预期操作,如窃取密码或泄露数据。
- 敏感信息泄露 (PII Leakage) --- 防止敏感信息被直接读取、外发
- 你在与 AI 对话或处理文档时,可能无意间输入了个人或公司的敏感信息(如身份证号、手机号、API Key),这些信息可能被发送到外部大模型,造成隐私泄露。
- 高危操作 (Risky Operation) --- 拦截 AI 自动执行高权限风险操作
- AI 在理解模糊指令时可能出错,或被恶意诱导,调用高权限工具执行危险命令,例如将“清理桌面”错误地理解为删除系统重要文件。
- 恶意 Skill (Malicious Skill Attack) --- 扫描集成 Skill 的风险情况,阻止恶意 Skill 入侵
- 攻击者可能通过伪装成正常功能的第三方插件或技能(Skills),诱导用户安装。这些恶意技能在被 AI 调用时,可能在后台静默执行恶意代码,例如窃取浏览器凭证(Cookie)、抓取本地敏感文件或进行越权操作。
安装方式(仅需极简三步操作)
通过对话直接安装
支持通过对话交互的方式完成 ClawSentry skill 包安装,例如你可以通过与 OpenClaw 对话完成安装。
前提条件
在开始之前,请确保你已经正确安装了 OpenClaw 。
步骤一 下载并运行 ClawSentry Skill
在对话框中输入:帮我安装 byted-security-clawsentry
预期结果:执行完成后,在对话框中会返回安装成功的提示并提供登录授权链接。
步骤二 授权与自动配置
1. 在打开的页面上,请仔细阅读相关服务协议和隐私政策。勾选同意后,单击 “同意并开通”。
2. 按提示完成登录,浏览器页面显示“授权成功”即表示完成。
完成授权后,OpenClaw 会自动执行剩余安装和配置流程。
步骤三 验证安装结果
完成安装后,你可以向你的 OpenClaw 通过对话框发送以下类似指令,来验证 ClawSentry 是否已成功安装并启用:
1. 查看 ClawSentry 的启用状态和版本号; 2. 查看防护状态。
预期结果:对话框返回的信息中应包含 ClawSentry 插件,其版本为 1.1.0,且状态为“已启用”。
产品建议与反馈
安装或使用过程中,如果遇到任何问题或阻塞,你可以通过官网咨询直接与我们取得联系;如果想反馈产品建议,你可通过问卷提交相关内容。感谢你的支持与配合。
官网咨询入口
访问火山引擎官网,单击右侧在线咨询,进入对话。
问卷表单
访问链接填写问卷,反馈你的问题。
https://bytedance.larkoffice.com/share/base/form/shrcngOInnpkzC7OyN1y7QcwQJ8
飞书群聊
访问链接加入官方飞书群聊,参与产品讨论,获取产品最新动态。
https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=845sa75d-18de-4b53-a623-42c4db4b25de
费用说明
当前产品处于免费试用阶段,暂不收取费用。
- 待产品进入正式收费阶段后,免费试用服务将相应停止。我们将提前发布收费标准及生效时间说明,并预留合理过渡期。
- 在你主动确认开通付费服务前,不会产生任何费用。
#!/usr/bin/env node
"use strict";var dn=(p,v)=>()=>(v||p((v={exports:{}}).exports,v),v.exports);var cn=dn((nn,on)=>{(function(p,v){typeof nn=="object"&&typeof on=="object"?on.exports=v(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],v):typeof nn=="object"?nn["electron-machine-id"]=v(require("child_process"),require("crypto")):p["electron-machine-id"]=v(p.child_process,p.crypto)})(nn,function(p,v){return function(o){function a(e){if(n[e])return n[e].exports;var t=n[e]={exports:{},id:e,loaded:!1};return o[e].call(t.exports,t,t.exports,a),t.loaded=!0,t.exports}var n={};return a.m=o,a.c=n,a.p="",a(0)}([function(o,a,n){o.exports=n(34)},function(o,a,n){var e=n(29)("wks"),t=n(33),i=n(2).Symbol,s=typeof i=="function",r=o.exports=function(c){return e[c]||(e[c]=s&&i[c]||(s?i:t)("Symbol."+c))};r.store=e},function(o,a){var n=o.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=n)},function(o,a,n){var e=n(9);o.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(o,a,n){o.exports=!n(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(o,a,n){var e=n(12),t=n(17);o.exports=n(4)?function(i,s,r){return e.f(i,s,t(1,r))}:function(i,s,r){return i[s]=r,i}},function(o,a){var n=o.exports={version:"2.4.0"};typeof __e=="number"&&(__e=n)},function(o,a,n){var e=n(14);o.exports=function(t,i,s){if(e(t),i===void 0)return t;switch(s){case 1:return function(r){return t.call(i,r)};case 2:return function(r,c){return t.call(i,r,c)};case 3:return function(r,c,l){return t.call(i,r,c,l)}}return function(){return t.apply(i,arguments)}}},function(o,a){var n={}.hasOwnProperty;o.exports=function(e,t){return n.call(e,t)}},function(o,a){o.exports=function(n){return typeof n=="object"?n!==null:typeof n=="function"}},function(o,a){o.exports={}},function(o,a){var n={}.toString;o.exports=function(e){return n.call(e).slice(8,-1)}},function(o,a,n){var e=n(3),t=n(26),i=n(32),s=Object.defineProperty;a.f=n(4)?Object.defineProperty:function(r,c,l){if(e(r),c=i(c,!0),e(l),t)try{return s(r,c,l)}catch{}if("get"in l||"set"in l)throw TypeError("Accessors not supported!");return"value"in l&&(r[c]=l.value),r}},function(o,a,n){var e=n(42),t=n(15);o.exports=function(i){return e(t(i))}},function(o,a){o.exports=function(n){if(typeof n!="function")throw TypeError(n+" is not a function!");return n}},function(o,a){o.exports=function(n){if(n==null)throw TypeError("Can't call method on "+n);return n}},function(o,a,n){var e=n(9),t=n(2).document,i=e(t)&&e(t.createElement);o.exports=function(s){return i?t.createElement(s):{}}},function(o,a){o.exports=function(n,e){return{enumerable:!(1&n),configurable:!(2&n),writable:!(4&n),value:e}}},function(o,a,n){var e=n(12).f,t=n(8),i=n(1)("toStringTag");o.exports=function(s,r,c){s&&!t(s=c?s:s.prototype,i)&&e(s,i,{configurable:!0,value:r})}},function(o,a,n){var e=n(29)("keys"),t=n(33);o.exports=function(i){return e[i]||(e[i]=t(i))}},function(o,a){var n=Math.ceil,e=Math.floor;o.exports=function(t){return isNaN(t=+t)?0:(t>0?e:n)(t)}},function(o,a,n){var e=n(11),t=n(1)("toStringTag"),i=e(function(){return arguments}())=="Arguments",s=function(r,c){try{return r[c]}catch{}};o.exports=function(r){var c,l,u;return r===void 0?"Undefined":r===null?"Null":typeof(l=s(c=Object(r),t))=="string"?l:i?e(c):(u=e(c))=="Object"&&typeof c.callee=="function"?"Arguments":u}},function(o,a){o.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(o,a,n){var e=n(2),t=n(6),i=n(7),s=n(5),r="prototype",c=function(l,u,g){var d,w,_,T=l&c.F,b=l&c.G,x=l&c.S,S=l&c.P,E=l&c.B,y=l&c.W,O=b?t:t[u]||(t[u]={}),j=O[r],k=b?e:x?e[u]:(e[u]||{})[r];b&&(g=u);for(d in g)w=!T&&k&&k[d]!==void 0,w&&d in O||(_=w?k[d]:g[d],O[d]=b&&typeof k[d]!="function"?g[d]:E&&w?i(_,e):y&&k[d]==_?function(R){var L=function($,I,U){if(this instanceof R){switch(arguments.length){case 0:return new R;case 1:return new R($);case 2:return new R($,I)}return new R($,I,U)}return R.apply(this,arguments)};return L[r]=R[r],L}(_):S&&typeof _=="function"?i(Function.call,_):_,S&&((O.virtual||(O.virtual={}))[d]=_,l&c.R&&j&&!j[d]&&s(j,d,_)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,o.exports=c},function(o,a){o.exports=function(n){try{return!!n()}catch{return!0}}},function(o,a,n){o.exports=n(2).document&&document.documentElement},function(o,a,n){o.exports=!n(4)&&!n(24)(function(){return Object.defineProperty(n(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(o,a,n){"use strict";var e=n(28),t=n(23),i=n(57),s=n(5),r=n(8),c=n(10),l=n(45),u=n(18),g=n(52),d=n(1)("iterator"),w=!([].keys&&"next"in[].keys()),_="@@iterator",T="keys",b="values",x=function(){return this};o.exports=function(S,E,y,O,j,k,R){l(y,E,O);var L,$,I,U=function(h){if(!w&&h in C)return C[h];switch(h){case T:return function(){return new y(this,h)};case b:return function(){return new y(this,h)}}return function(){return new y(this,h)}},K=E+" Iterator",W=j==b,X=!1,C=S.prototype,D=C[d]||C[_]||j&&C[j],F=D||U(j),z=j?W?U("entries"):F:void 0,f=E=="Array"&&C.entries||D;if(f&&(I=g(f.call(new S)),I!==Object.prototype&&(u(I,K,!0),e||r(I,d)||s(I,d,x))),W&&D&&D.name!==b&&(X=!0,F=function(){return D.call(this)}),e&&!R||!w&&!X&&C[d]||s(C,d,F),c[E]=F,c[K]=x,j)if(L={values:W?F:U(b),keys:k?F:U(T),entries:z},R)for($ in L)$ in C||i(C,$,L[$]);else t(t.P+t.F*(w||X),E,L);return L}},function(o,a){o.exports=!0},function(o,a,n){var e=n(2),t="__core-js_shared__",i=e[t]||(e[t]={});o.exports=function(s){return i[s]||(i[s]={})}},function(o,a,n){var e,t,i,s=n(7),r=n(41),c=n(25),l=n(16),u=n(2),g=u.process,d=u.setImmediate,w=u.clearImmediate,_=u.MessageChannel,T=0,b={},x="onreadystatechange",S=function(){var y=+this;if(b.hasOwnProperty(y)){var O=b[y];delete b[y],O()}},E=function(y){S.call(y.data)};d&&w||(d=function(y){for(var O=[],j=1;arguments.length>j;)O.push(arguments[j++]);return b[++T]=function(){r(typeof y=="function"?y:Function(y),O)},e(T),T},w=function(y){delete b[y]},n(11)(g)=="process"?e=function(y){g.nextTick(s(S,y,1))}:_?(t=new _,i=t.port2,t.port1.onmessage=E,e=s(i.postMessage,i,1)):u.addEventListener&&typeof postMessage=="function"&&!u.importScripts?(e=function(y){u.postMessage(y+"","*")},u.addEventListener("message",E,!1)):e=x in l("script")?function(y){c.appendChild(l("script"))[x]=function(){c.removeChild(this),S.call(y)}}:function(y){setTimeout(s(S,y,1),0)}),o.exports={set:d,clear:w}},function(o,a,n){var e=n(20),t=Math.min;o.exports=function(i){return i>0?t(e(i),9007199254740991):0}},function(o,a,n){var e=n(9);o.exports=function(t,i){if(!e(t))return t;var s,r;if(i&&typeof(s=t.toString)=="function"&&!e(r=s.call(t))||typeof(s=t.valueOf)=="function"&&!e(r=s.call(t))||!i&&typeof(s=t.toString)=="function"&&!e(r=s.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(o,a){var n=0,e=Math.random();o.exports=function(t){return"Symbol(".concat(t===void 0?"":t,")_",(++n+e).toString(36))}},function(o,a,n){"use strict";function e(x){return x&&x.__esModule?x:{default:x}}function t(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function i(x){return(0,d.createHash)("sha256").update(x).digest("hex")}function s(x){switch(_){case"darwin":return x.split("IOPlatformUUID")[1].split(`
`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return x.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return x.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return x.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function r(x){var S=s((0,g.execSync)(b[_]).toString());return x?S:i(S)}function c(x){return new u.default(function(S,E){return(0,g.exec)(b[_],{},function(y,O,j){if(y)return E(new Error("Error while obtaining machine id: "+y.stack));var k=s(O.toString());return S(x?k:i(k))})})}Object.defineProperty(a,"__esModule",{value:!0});var l=n(35),u=e(l);a.machineIdSync=r,a.machineId=c;var g=n(70),d=n(71),w=process,_=w.platform,T={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},b={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:T[t()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(o,a,n){o.exports={default:n(36),__esModule:!0}},function(o,a,n){n(66),n(68),n(69),n(67),o.exports=n(6).Promise},function(o,a){o.exports=function(){}},function(o,a){o.exports=function(n,e,t,i){if(!(n instanceof e)||i!==void 0&&i in n)throw TypeError(t+": incorrect invocation!");return n}},function(o,a,n){var e=n(13),t=n(31),i=n(62);o.exports=function(s){return function(r,c,l){var u,g=e(r),d=t(g.length),w=i(l,d);if(s&&c!=c){for(;d>w;)if(u=g[w++],u!=u)return!0}else for(;d>w;w++)if((s||w in g)&&g[w]===c)return s||w||0;return!s&&-1}}},function(o,g,n){var e=n(7),t=n(44),i=n(43),s=n(3),r=n(31),c=n(64),l={},u={},g=o.exports=function(d,w,_,T,b){var x,S,E,y,O=b?function(){return d}:c(d),j=e(_,T,w?2:1),k=0;if(typeof O!="function")throw TypeError(d+" is not iterable!");if(i(O)){for(x=r(d.length);x>k;k++)if(y=w?j(s(S=d[k])[0],S[1]):j(d[k]),y===l||y===u)return y}else for(E=O.call(d);!(S=E.next()).done;)if(y=t(E,j,S.value,w),y===l||y===u)return y};g.BREAK=l,g.RETURN=u},function(o,a){o.exports=function(n,e,t){var i=t===void 0;switch(e.length){case 0:return i?n():n.call(t);case 1:return i?n(e[0]):n.call(t,e[0]);case 2:return i?n(e[0],e[1]):n.call(t,e[0],e[1]);case 3:return i?n(e[0],e[1],e[2]):n.call(t,e[0],e[1],e[2]);case 4:return i?n(e[0],e[1],e[2],e[3]):n.call(t,e[0],e[1],e[2],e[3])}return n.apply(t,e)}},function(o,a,n){var e=n(11);o.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return e(t)=="String"?t.split(""):Object(t)}},function(o,a,n){var e=n(10),t=n(1)("iterator"),i=Array.prototype;o.exports=function(s){return s!==void 0&&(e.Array===s||i[t]===s)}},function(o,a,n){var e=n(3);o.exports=function(t,i,s,r){try{return r?i(e(s)[0],s[1]):i(s)}catch(l){var c=t.return;throw c!==void 0&&e(c.call(t)),l}}},function(o,a,n){"use strict";var e=n(49),t=n(17),i=n(18),s={};n(5)(s,n(1)("iterator"),function(){return this}),o.exports=function(r,c,l){r.prototype=e(s,{next:t(1,l)}),i(r,c+" Iterator")}},function(o,a,n){var e=n(1)("iterator"),t=!1;try{var i=[7][e]();i.return=function(){t=!0},Array.from(i,function(){throw 2})}catch{}o.exports=function(s,r){if(!r&&!t)return!1;var c=!1;try{var l=[7],u=l[e]();u.next=function(){return{done:c=!0}},l[e]=function(){return u},s(l)}catch{}return c}},function(o,a){o.exports=function(n,e){return{value:e,done:!!n}}},function(o,a,n){var e=n(2),t=n(30).set,i=e.MutationObserver||e.WebKitMutationObserver,s=e.process,r=e.Promise,c=n(11)(s)=="process";o.exports=function(){var l,u,g,d=function(){var b,x;for(c&&(b=s.domain)&&b.exit();l;){x=l.fn,l=l.next;try{x()}catch(S){throw l?g():u=void 0,S}}u=void 0,b&&b.enter()};if(c)g=function(){s.nextTick(d)};else if(i){var w=!0,_=document.createTextNode("");new i(d).observe(_,{characterData:!0}),g=function(){_.data=w=!w}}else if(r&&r.resolve){var T=r.resolve();g=function(){T.then(d)}}else g=function(){t.call(e,d)};return function(b){var x={fn:b,next:void 0};u&&(u.next=x),l||(l=x,g()),u=x}}},function(o,a,n){var e=n(3),t=n(50),i=n(22),s=n(19)("IE_PROTO"),r=function(){},c="prototype",l=function(){var u,g=n(16)("iframe"),d=i.length,w=">";for(g.style.display="none",n(25).appendChild(g),g.src="javascript:",u=g.contentWindow.document,u.open(),u.write("<script>document.F=Object</script"+w),u.close(),l=u.F;d--;)delete l[c][i[d]];return l()};o.exports=Object.create||function(u,g){var d;return u!==null?(r[c]=e(u),d=new r,r[c]=null,d[s]=u):d=l(),g===void 0?d:t(d,g)}},function(o,a,n){var e=n(12),t=n(3),i=n(54);o.exports=n(4)?Object.defineProperties:function(s,r){t(s);for(var c,l=i(r),u=l.length,g=0;u>g;)e.f(s,c=l[g++],r[c]);return s}},function(o,a,n){var e=n(55),t=n(17),i=n(13),s=n(32),r=n(8),c=n(26),l=Object.getOwnPropertyDescriptor;a.f=n(4)?l:function(u,g){if(u=i(u),g=s(g,!0),c)try{return l(u,g)}catch{}if(r(u,g))return t(!e.f.call(u,g),u[g])}},function(o,a,n){var e=n(8),t=n(63),i=n(19)("IE_PROTO"),s=Object.prototype;o.exports=Object.getPrototypeOf||function(r){return r=t(r),e(r,i)?r[i]:typeof r.constructor=="function"&&r instanceof r.constructor?r.constructor.prototype:r instanceof Object?s:null}},function(o,a,n){var e=n(8),t=n(13),i=n(39)(!1),s=n(19)("IE_PROTO");o.exports=function(r,c){var l,u=t(r),g=0,d=[];for(l in u)l!=s&&e(u,l)&&d.push(l);for(;c.length>g;)e(u,l=c[g++])&&(~i(d,l)||d.push(l));return d}},function(o,a,n){var e=n(53),t=n(22);o.exports=Object.keys||function(i){return e(i,t)}},function(o,a){a.f={}.propertyIsEnumerable},function(o,a,n){var e=n(5);o.exports=function(t,i,s){for(var r in i)s&&t[r]?t[r]=i[r]:e(t,r,i[r]);return t}},function(o,a,n){o.exports=n(5)},function(o,a,n){var e=n(9),t=n(3),i=function(s,r){if(t(s),!e(r)&&r!==null)throw TypeError(r+": can't set as prototype!")};o.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(s,r,c){try{c=n(7)(Function.call,n(51).f(Object.prototype,"__proto__").set,2),c(s,[]),r=!(s instanceof Array)}catch{r=!0}return function(l,u){return i(l,u),r?l.__proto__=u:c(l,u),l}}({},!1):void 0),check:i}},function(o,a,n){"use strict";var e=n(2),t=n(6),i=n(12),s=n(4),r=n(1)("species");o.exports=function(c){var l=typeof t[c]=="function"?t[c]:e[c];s&&l&&!l[r]&&i.f(l,r,{configurable:!0,get:function(){return this}})}},function(o,a,n){var e=n(3),t=n(14),i=n(1)("species");o.exports=function(s,r){var c,l=e(s).constructor;return l===void 0||(c=e(l)[i])==null?r:t(c)}},function(o,a,n){var e=n(20),t=n(15);o.exports=function(i){return function(s,r){var c,l,u=String(t(s)),g=e(r),d=u.length;return g<0||g>=d?i?"":void 0:(c=u.charCodeAt(g),c<55296||c>56319||g+1===d||(l=u.charCodeAt(g+1))<56320||l>57343?i?u.charAt(g):c:i?u.slice(g,g+2):(c-55296<<10)+(l-56320)+65536)}}},function(o,a,n){var e=n(20),t=Math.max,i=Math.min;o.exports=function(s,r){return s=e(s),s<0?t(s+r,0):i(s,r)}},function(o,a,n){var e=n(15);o.exports=function(t){return Object(e(t))}},function(o,a,n){var e=n(21),t=n(1)("iterator"),i=n(10);o.exports=n(6).getIteratorMethod=function(s){if(s!=null)return s[t]||s["@@iterator"]||i[e(s)]}},function(o,a,n){"use strict";var e=n(37),t=n(47),i=n(10),s=n(13);o.exports=n(27)(Array,"Array",function(r,c){this._t=s(r),this._i=0,this._k=c},function(){var r=this._t,c=this._k,l=this._i++;return!r||l>=r.length?(this._t=void 0,t(1)):c=="keys"?t(0,l):c=="values"?t(0,r[l]):t(0,[l,r[l]])},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries")},function(o,a){},function(o,a,n){"use strict";var e,t,i,s=n(28),r=n(2),c=n(7),l=n(21),u=n(23),g=n(9),d=(n(3),n(14)),w=n(38),_=n(40),T=(n(58).set,n(60)),b=n(30).set,x=n(48)(),S="Promise",E=r.TypeError,O=r.process,y=r[S],O=r.process,j=l(O)=="process",k=function(){},R=!!function(){try{var f=y.resolve(1),h=(f.constructor={})[n(1)("species")]=function(m){m(k,k)};return(j||typeof PromiseRejectionEvent=="function")&&f.then(k)instanceof h}catch{}}(),L=function(f,h){return f===h||f===y&&h===i},$=function(f){var h;return!(!g(f)||typeof(h=f.then)!="function")&&h},I=function(f){return L(y,f)?new U(f):new t(f)},U=t=function(f){var h,m;this.promise=new f(function(P,A){if(h!==void 0||m!==void 0)throw E("Bad Promise constructor");h=P,m=A}),this.resolve=d(h),this.reject=d(m)},K=function(f){try{f()}catch(h){return{error:h}}},W=function(f,h){if(!f._n){f._n=!0;var m=f._c;x(function(){for(var P=f._v,A=f._s==1,G=0,H=function(B){var M,en,Q=A?B.ok:B.fail,Z=B.resolve,V=B.reject,tn=B.domain;try{Q?(A||(f._h==2&&D(f),f._h=1),Q===!0?M=P:(tn&&tn.enter(),M=Q(P),tn&&tn.exit()),M===B.promise?V(E("Promise-chain cycle")):(en=$(M))?en.call(M,Z,V):Z(M)):V(P)}catch(gn){V(gn)}};m.length>G;)H(m[G++]);f._c=[],f._n=!1,h&&!f._h&&X(f)})}},X=function(f){b.call(r,function(){var h,m,P,A=f._v;if(C(f)&&(h=K(function(){j?O.emit("unhandledRejection",A,f):(m=r.onunhandledrejection)?m({promise:f,reason:A}):(P=r.console)&&P.error&&P.error("Unhandled promise rejection",A)}),f._h=j||C(f)?2:1),f._a=void 0,h)throw h.error})},C=function(f){if(f._h==1)return!1;for(var h,m=f._a||f._c,P=0;m.length>P;)if(h=m[P++],h.fail||!C(h.promise))return!1;return!0},D=function(f){b.call(r,function(){var h;j?O.emit("rejectionHandled",f):(h=r.onrejectionhandled)&&h({promise:f,reason:f._v})})},F=function(f){var h=this;h._d||(h._d=!0,h=h._w||h,h._v=f,h._s=2,h._a||(h._a=h._c.slice()),W(h,!0))},z=function(f){var h,m=this;if(!m._d){m._d=!0,m=m._w||m;try{if(m===f)throw E("Promise can't be resolved itself");(h=$(f))?x(function(){var P={_w:m,_d:!1};try{h.call(f,c(z,P,1),c(F,P,1))}catch(A){F.call(P,A)}}):(m._v=f,m._s=1,W(m,!1))}catch(P){F.call({_w:m,_d:!1},P)}}};R||(y=function(f){w(this,y,S,"_h"),d(f),e.call(this);try{f(c(z,this,1),c(F,this,1))}catch(h){F.call(this,h)}},e=function(f){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},e.prototype=n(56)(y.prototype,{then:function(f,h){var m=I(T(this,y));return m.ok=typeof f!="function"||f,m.fail=typeof h=="function"&&h,m.domain=j?O.domain:void 0,this._c.push(m),this._a&&this._a.push(m),this._s&&W(this,!1),m.promise},catch:function(f){return this.then(void 0,f)}}),U=function(){var f=new e;this.promise=f,this.resolve=c(z,f,1),this.reject=c(F,f,1)}),u(u.G+u.W+u.F*!R,{Promise:y}),n(18)(y,S),n(59)(S),i=n(6)[S],u(u.S+u.F*!R,S,{reject:function(f){var h=I(this),m=h.reject;return m(f),h.promise}}),u(u.S+u.F*(s||!R),S,{resolve:function(f){if(f instanceof y&&L(f.constructor,this))return f;var h=I(this),m=h.resolve;return m(f),h.promise}}),u(u.S+u.F*!(R&&n(46)(function(f){y.all(f).catch(k)})),S,{all:function(f){var h=this,m=I(h),P=m.resolve,A=m.reject,G=K(function(){var H=[],B=0,M=1;_(f,!1,function(en){var Q=B++,Z=!1;H.push(void 0),M++,h.resolve(en).then(function(V){Z||(Z=!0,H[Q]=V,--M||P(H))},A)}),--M||P(H)});return G&&A(G.error),m.promise},race:function(f){var h=this,m=I(h),P=m.reject,A=K(function(){_(f,!1,function(G){h.resolve(G).then(m.resolve,P)})});return A&&P(A.error),m.promise}})},function(o,a,n){"use strict";var e=n(61)(!0);n(27)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,i=this._t,s=this._i;return s>=i.length?{value:void 0,done:!0}:(t=e(i,s),this._i+=t.length,{value:t,done:!1})})},function(o,a,n){n(65);for(var e=n(2),t=n(5),i=n(10),s=n(1)("toStringTag"),r=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],c=0;c<5;c++){var l=r[c],u=e[l],g=u&&u.prototype;g&&!g[s]&&t(g,s,l),i[l]=i.Array}},function(o,a){o.exports=require("child_process")},function(o,a){o.exports=require("crypto")}])})});var rn=require("crypto"),Un=require("os"),{execSync:Y,spawn:hn}=require("child_process"),N=require("fs"),J=require("path"),vn=require("https"),{machineIdSync:yn}=cn(),an="https://openclaw.sdk.access.llm-shield.omini-shield.com",q="ai-assistant-security-openclaw",mn="@omni-shield/ai-assistant-security-openclaw",wn="https://openclaw.sdk.access.llm-shield.omini-shield.com",xn="https://console.volcengine.com/omni-shield/ai-assistant-security/openclaw?loginToken=";function _n(p,v,o="7B5B2FEDF7FB4YE9"){try{let a=rn.pbkdf2Sync(v,o,1e5,32,"sha256"),n=rn.randomBytes(16),e=rn.createCipheriv("aes-256-gcm",a,n),t=e.update(p,"utf8","binary");t+=e.final("binary");let i=e.getAuthTag(),s=n,r=i,c=Buffer.from(t,"binary"),u=Buffer.concat([s,r,c]).toString("base64");return console.log("[encrypt] \u52A0\u5BC6\u7ED3\u679C:",u),u}catch(a){throw new Error(`\u52A0\u5BC6\u5931\u8D25\uFF1A${a.message}`)}}function Sn(){return yn()}function ln(){let p=J.dirname(J.resolve(__filename)),v=J.join(p,"..",".state");return N.existsSync(v)||N.mkdirSync(v,{recursive:!0}),v}function un(){return J.join(ln(),"login_state.json")}function fn(p){let v=un();N.writeFileSync(v,JSON.stringify(p,null,2),"utf8")}function bn(){let p=un();return N.existsSync(p)?JSON.parse(N.readFileSync(p,"utf8")):null}function On(){let p=J.join(ln(),"poll_login.log"),v=N.createWriteStream(p,{flags:"a"});function o(e){let t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0"),r=String(e.getHours()).padStart(2,"0"),c=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0");return`${t}-${i}-${s} ${r}:${c}:${l}`}let a=console.log,n=console.error;console.log=function(...e){let t=e.map(r=>typeof r=="object"?JSON.stringify(r):r).join(" "),s=`${o(new Date)} - INFO - ${t}
`;v.write(s),a.apply(console,e)},console.error=function(...e){let t=e.map(r=>typeof r=="object"?JSON.stringify(r):r).join(" "),s=`${o(new Date)} - ERROR - ${t}
`;v.write(s),n.apply(console,e)}}function pn(p,v,o){return new Promise((a,n)=>{let e=new URL(p),t={hostname:e.hostname,port:e.port||443,path:e.pathname+e.search,method:"POST",headers:{"Content-Type":"application/json",...v}},i=vn.request(t,s=>{let r="";s.on("data",c=>{r+=c}),s.on("end",()=>{try{let c=JSON.parse(r);a({statusCode:s.statusCode,data:c})}catch(c){n(c)}})});i.on("error",n),i.setTimeout(1e4,()=>{i.destroy(),n(new Error("Request timeout"))}),i.write(JSON.stringify(o)),i.end()})}function jn(){return new Promise(async p=>{let v=Sn(),o=`${an}/OpenTOP/V1/Console/CreateLoginToken`,a={"X-Ai-Device-Fingerprint":v},n=null;for(let e=1;e<=3;e++)try{e>1&&console.log(`[init-login] Retrying CreateLoginToken API call (attempt ${e}/3)...`);let{statusCode:t,data:i}=await pn(o,a,{}),s=i.ResponseMetadata?.Error;if(s&&s.CodeN!==0){console.error(`[init-login] API call failed on attempt ${e}: ${s.Code} - ${s.Message}`),n=s,e<3&&await sn(2e3);continue}let r=i.Result?.LoginToken,c=i.Result?.ExpiredAt,l=`${xn}${r}`;fn({loginToken:r,deviceFingerprint:v,expiredAt:c,loginUrl:l,enable:!1}),p([l,r,v,!0]);return}catch(t){n=t,t.message==="Request timeout"?console.error(`[init-login] Request timeout on attempt ${e}`):console.error(`[init-login] Connection error on attempt ${e}: ${t.message}`),e<3&&await sn(2e3)}console.error("[init-login] Failed to create login token after 3 attempts"),p([null,null,null,!1])})}function Pn(){console.log("[install-plugin] Reading current plugins configuration\u2026");try{let v=Y("openclaw config get plugins --json",{encoding:"utf8",stdio:"pipe"}).trim(),o;try{o=JSON.parse(v)}catch(a){let n=v.split(`
`),e=[],t=0,i=!1;for(let s of n){let r=s.trim();if(r&&(r.includes("{")&&!i&&(i=!0),i&&(e.push(s),t+=(r.match(/\{/g)||[]).length,t-=(r.match(/\}/g)||[]).length,t===0)))break}if(e.length>0){let s=e.join(`
`);o=JSON.parse(s)}else throw a}return(typeof o!="object"||o===null)&&(console.error("[install-plugin] Plugins configuration is not an object; cannot safely update."),process.exit(1)),o}catch(p){console.error(`[install-plugin] Failed to read plugins configuration: ${p.message}`),p.stderr&&console.error(p.stderr),process.exit(1)}}function Tn(){let p=Pn(),v=null,o=!1,a=p.installs;if(typeof a=="object"&&a!==null&&q in a){let i=(a[q]||{}).installPath;typeof i=="string"&&i&&(v=i),delete a[q],p.installs=a,o=!0}let n=p.entries;typeof n=="object"&&n!==null&&q in n&&(console.log("[install-plugin] Cleaning plugins.entries.ai-assistant-security-openclaw configuration\u2026"),delete n[q],p.entries=n,o=!0);let e=p.allow;if(Array.isArray(e)&&e.includes(q)&&(console.log("[install-plugin] Removing ai-assistant-security-openclaw from plugins.allow\u2026"),p.allow=e.filter(t=>t!==q),o=!0),o){let t=JSON.stringify(p);console.log("[install-plugin] Writing updated plugins configuration (cleanup security plugin)\u2026");try{Y(`openclaw config set plugins "${t.replace(/"/g,'\\"')}" --json`,{stdio:"inherit"})}catch(i){console.error(`[install-plugin] Failed to write plugins configuration: ${i.message}`),i.stderr&&console.error(i.stderr),process.exit(1)}}else console.log("[install-plugin] No ai-assistant-security-openclaw related configuration found; skip cleanup.");if(v&&N.existsSync(v)){console.log(`[install-plugin] Removing existing security plugin directory: ${v}`);try{N.rmSync(v,{recursive:!0,force:!0})}catch(t){console.error(`[install-plugin] Failed to remove directory ${v}: ${t.message}`)}}}function En(p){console.log(`[install-plugin] Running command: ${p.join(" ")}`);try{Y(p.join(" "),{stdio:"inherit"})}catch(v){console.error(`[install-plugin] Command failed (exit code ${v.status}): ${p.join(" ")}`),process.exit(v.status||1)}}function kn(){En(["openclaw","plugins","install",mn])}async function Rn(p,v){let o=`${an}/OpenTOP/V1/Console/GetLoginTokenIdentity`,a={"X-Ai-Device-Fingerprint":v},n={LoginToken:p};console.log("[poll-login] Calling GetLoginTokenIdentity API...");try{let{statusCode:e,data:t}=await pn(o,a,n);return console.log(`[poll-login] Response status code: ${e}`),console.log(`[poll-login] Response content: ${JSON.stringify(t)}`),t}catch(e){return e.message==="Request timeout"?console.error("[poll-login] Request timeout! Unable to connect to server"):console.error(`[poll-login] Request exception: ${e.message}`),{}}}function An(p){let v=p.Result||{};return!!(v.ApiKey||v.AccountId||v.AppId)}function In(p,v){let o=p.Result||{};Cn(o,v)}function Cn(p,v){let o=p.ApiKey,a=p.AppId,n=p.Version;if(!o||!a){console.error("[poll-login] Error: Missing ApiKey or AppId in identity information");return}console.log("[poll-login] Encrypting ApiKey...");let e=_n(o,v);console.log("[poll-login] Encryption completed."),console.log("[poll-login] Reading current plugins configuration...");let t;try{let c=Y("openclaw config get plugins --json",{encoding:"utf8",stdio:"pipe"}).trim();try{t=JSON.parse(c)}catch(l){let u=c.split(`
`),g=[],d=0,w=!1;for(let _ of u){let T=_.trim();if(T&&(T.includes("{")&&!w&&(w=!0),w&&(g.push(_),d+=(T.match(/\{/g)||[]).length,d-=(T.match(/\}/g)||[]).length,d===0)))break}if(g.length>0){let _=g.join(`
`);t=JSON.parse(_)}else throw l}}catch(r){console.error("[poll-login] Error: Unable to read plugins configuration"),r.stderr&&console.error(r.stderr);return}if(typeof t!="object"||t===null){console.error("[poll-login] Error: Plugins configuration is not an object, cannot update safely");return}let i=t.entries;(typeof i!="object"||i===null)&&(i={}),i[q]={enabled:!0,config:{apiKey:e,endpoint:wn,appId:a,configVersion:n}},t.entries=i;let s=JSON.stringify(t);console.log("[poll-login] Writing back updated plugins configuration...");try{Y(`openclaw config set plugins "${s.replace(/"/g,'\\"')}" --json`,{stdio:"pipe"})}catch(r){console.error("[poll-login] Error: Failed to update plugins configuration"),r.stderr&&console.error(r.stderr);return}console.log("[poll-login] Plugins configuration updated."),console.log(`[poll-login] ${q} plugin configuration updated.`)}function sn(p){return new Promise(v=>setTimeout(v,p))}async function Fn(p,v){console.log("[poll-login] Starting to poll login status, max wait time 600 seconds, check interval 60 seconds");let n=Date.now(),e=0;for(;;){let t=(Date.now()-n)/1e3;e+=1,console.log(`[poll-login] Check #${e} (waited ${Math.floor(t)} seconds)...`);let i=await Rn(p,v);if(An(i)){console.log("[poll-login] \u2705 User logged in!"),In(i,v),console.log("[poll-login] Updating login state, setting enable to true...");let r=bn();r&&(r.enable=!0,fn(r),console.log("[poll-login] Login state updated successfully.")),console.log("[poll-login] Restarting OpenClaw gateway...");try{Y("openclaw gateway restart",{stdio:"inherit"}),console.log("[poll-login] \u2705 OpenClaw gateway restarted successfully!")}catch(c){console.error(`[poll-login] \u274C Failed to restart OpenClaw gateway: ${c.message}`)}return!0}if(console.log("[poll-login] User not logged in yet"),t>=600)return console.error("[poll-login] \u274C Exceeded max wait time 600 seconds, user still not logged in"),!1;let s=600-t;console.log(`[poll-login] Waiting 60 seconds before checking again (${Math.floor(s)} seconds remaining)...`),await sn(60*1e3)}}function Ln(){let p=process.argv.slice(2),v={loginToken:null,deviceFingerprint:null};for(let o=0;o<p.length;o++)p[o]==="--login-token"&&o+1<p.length?v.loginToken=p[o+1]:p[o]==="--device-fingerprint"&&o+1<p.length&&(v.deviceFingerprint=p[o+1]);return v}async function $n(){let p=Ln();if(p.loginToken&&p.deviceFingerprint){On();let v=await Fn(p.loginToken,p.deviceFingerprint);process.exit(v?0:1)}else return await Mn()}async function Mn(){console.log("=".repeat(60)),console.log("ClawSentinel Combined - Starting All Functions"),console.log("=".repeat(60)),console.log(`
[Step 1] Cleaning up and installing the AI Assistant Security plugin...`),Tn(),kn(),console.log("[Step 1] Plugin installation completed."),console.log(`
[Step 2] Initializing login flow...`);let[p,v,o,a]=await jn();if(!a||!p||!v||!o)return console.error("Failed to generate login URL!"),1;console.log("Login URL generated successfully:"),console.log(p),console.log(`[LOGIN_URL]: ${p}`);let n=J.dirname(J.resolve(__filename)),e=J.join(n,"..",".state","poll_login.log"),t=N.openSync(e,"a");return hn(process.execPath,[__filename,"--login-token",v,"--device-fingerprint",o],{detached:!0,stdio:["ignore",t,t]}).unref(),N.closeSync(t),0}require.main===module&&$n().then(p=>{process.exit(p)}).catch(p=>{console.error(p),process.exit(1)});
Related skills
FAQ
What does byted-security-clawsentry install?
It installs and configures the OpenClaw security plugins, including the ai-assistant-security-openclaw (ClawSentry) plugins.
What runtime does it require?
It requires Node.js version 14 or higher, verified before running the bundle script.