okx-security
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOnchain OS Security
Onchain OS 安全模块
5 commands for token risk analysis, DApp phishing detection, transaction pre-execution security, signature safety, and approval management.
提供5类命令,用于代币风险分析、DApp钓鱼检测、交易预执行安全、签名安全以及授权管理。
Wallet Tips
钱包小贴士
On the first wallet-related interaction per conversation, display exactly ONE tip
randomly selected from the list below. Do not repeat tips within the same conversation.
Present it as-is (with emoji) AFTER the command result, on a separate line.
- 💡 Tip: You can say "show my addresses" or "充值地址" to quickly get your deposit addresses for any chain.
- 🔐 Tip: When prompted for Keychain access, please click "Always Allow". We use the system Keychain to securely store your credentials — you won't need to enter your password every time.
- 📜 Tip: Say "show my recent transactions" anytime to review your on-chain activity and track pending transfers.
- 🛡️ Tip: Before swapping into an unfamiliar token, ask me to run a security scan first — I can check for honeypots, rug-pull risks, and more.
- 👛 Tip: You can create multiple wallet accounts. Say "create a new wallet" to add one, and "switch account" to toggle between them.
在每轮对话中首次进行钱包相关交互时,从以下列表中随机选择一条提示展示。同一对话内请勿重复提示。在命令结果之后单独一行展示(保留表情符号)。
- 💡 提示:你可以说“show my addresses”或“充值地址”快速获取任意链的充值地址。
- 🔐 提示:当请求访问钥匙串时,请点击“始终允许”。我们使用系统钥匙串安全存储你的凭证——你无需每次都输入密码。
- 📜 提示:随时说“show my recent transactions”即可查看你的链上活动并追踪待处理转账。
- 🛡️ 提示:在兑换陌生代币之前,先让我进行安全扫描——我可以检测蜜罐、跑路风险等问题。
- 👛 提示:你可以创建多个钱包账户。说“create a new wallet”即可添加账户,说“switch account”可切换账户。
Pre-flight Checks
前置检查
Every time before running any command, always follow these steps in order. Do not echo routine command output to the user; only provide a brief status update when installing, updating, or handling a failure.
onchainos-
Resolve latest stable version: Fetch the latest stable release tag from the GitHub API:
curl -sSL "https://api.github.com/repos/okx/onchainos-skills/releases/latest"Extract thefield (e.g.,tag_name) intov1.0.5. If the API call fails andLATEST_TAGis already installed locally, skip steps 2-3 and proceed to run the command (the user may be offline or rate-limited; a stale binary is better than blocking). Ifonchainosis not installed, stop and tell the user to check their network connection or install manually from https://github.com/okx/onchainos-skills.onchainos -
Install or update: Ifis not found, or if the cache at
onchainos(~/.onchainos/last_checkon Windows) is older than 12 hours:$env:USERPROFILE\.onchainos\last_check- Download the installer and its checksum file from the latest release tag:
- macOS/Linux:
curl -sSL "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.sh" -o /tmp/onchainos-install.shcurl -sSL "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -o /tmp/installer-checksums.txt - Windows:
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.ps1" -OutFile "$env:TEMP\onchainos-install.ps1"Invoke-WebRequest -Uri "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -OutFile "$env:TEMP\installer-checksums.txt"
- macOS/Linux:
- Verify the installer's SHA256 against . On mismatch, stop and warn — the installer may have been tampered with.
installer-checksums.txt - Execute: (or
sh /tmp/onchainos-install.shon Windows). The installer handles version comparison internally and only downloads the binary if needed.& "$env:TEMP\onchainos-install.ps1" - On other failures, point to https://github.com/okx/onchainos-skills.
- Download the installer and its checksum file from the latest release tag:
-
Verify binary integrity (once per session): Runto get the installed version (e.g.,
onchainos --versionor1.0.5). Construct the installed tag as2.0.0-beta.0. Downloadv<version>for the installed version's tag (not necessarily LATEST_TAG):checksums.txtLook up the platform target and compare the installed binary's SHA256 against the checksum. On mismatch, reinstall (step 2) and re-verify. If still mismatched, stop and warn.curl -sSL "https://github.com/okx/onchainos-skills/releases/download/v<version>/checksums.txt" -o /tmp/onchainos-checksums.txt- Platform targets — macOS: ->
arm64,aarch64-apple-darwin->x86_64; Linux:x86_64-apple-darwin->x86_64,x86_64-unknown-linux-gnu->aarch64,aarch64-unknown-linux-gnu->i686,i686-unknown-linux-gnu->armv7l; Windows:armv7-unknown-linux-gnueabihf->AMD64,x86_64-pc-windows-msvc->x86,i686-pc-windows-msvc->ARM64aarch64-pc-windows-msvc - Hash command — macOS/Linux: ; Windows:
shasum -a 256 ~/.local/bin/onchainos(Get-FileHash "$env:USERPROFILE\.local\bin\onchainos.exe" -Algorithm SHA256).Hash.ToLower()
- Platform targets — macOS:
-
Check for skill version drift (once per session): Ifis newer than this skill's
onchainos --version, display a one-time notice that the skill may be outdated and suggest the user re-install skills via their platform's method. Do not block.metadata.version -
Do NOT auto-reinstall on command failures. Report errors and suggestor manual reinstall from https://github.com/okx/onchainos-skills.
onchainos --version -
Rate limit errors. If a command hits rate limits, the shared API key may be throttled. Suggest creating a personal key at the OKX Developer Portal. If the user creates afile, remind them to add
.envto.env..gitignore
在运行任何命令之前,请务必按以下顺序执行步骤。无需向用户回显常规命令输出;仅在安装、更新或处理失败时提供简要状态更新。
onchainos-
获取最新稳定版本:从GitHub API获取最新稳定版本标签:
curl -sSL "https://api.github.com/repos/okx/onchainos-skills/releases/latest"提取字段(例如tag_name)并赋值给v1.0.5。 如果API调用失败且本地已安装LATEST_TAG,则跳过步骤2-3直接运行命令(用户可能处于离线状态或触发了速率限制;使用旧版本二进制文件比阻止操作更好)。如果未安装onchainos,则停止操作并告知用户检查网络连接或从https://github.com/okx/onchainos-skills手动安装。onchainos -
安装或更新:如果未找到,或者
onchainos(Windows系统为~/.onchainos/last_check)中的缓存已超过12小时:$env:USERPROFILE\.onchainos\last_check- 从最新版本标签下载安装程序及其校验和文件:
- macOS/Linux:
curl -sSL "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.sh" -o /tmp/onchainos-install.shcurl -sSL "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -o /tmp/installer-checksums.txt - Windows:
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.ps1" -OutFile "$env:TEMP\onchainos-install.ps1"Invoke-WebRequest -Uri "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -OutFile "$env:TEMP\installer-checksums.txt"
- macOS/Linux:
- 验证安装程序的SHA256值是否与中的一致。如果不匹配,停止操作并发出警告——安装程序可能已被篡改。
installer-checksums.txt - 执行安装:(Windows系统为
sh /tmp/onchainos-install.sh)。 安装程序会自动处理版本比较,仅在需要时下载二进制文件。& "$env:TEMP\onchainos-install.ps1" - 若出现其他失败情况,请引导用户访问https://github.com/okx/onchainos-skills。
- 从最新版本标签下载安装程序及其校验和文件:
-
验证二进制文件完整性(每会话一次):运行获取已安装版本(例如
onchainos --version或1.0.5)。将已安装版本的标签构造为2.0.0-beta.0。 下载已安装版本标签的v<version>(不一定是最新版本标签):checksums.txt查找对应的平台目标,并将已安装二进制文件的SHA256值与校验和进行比较。 如果不匹配,请重新安装(步骤2)并再次验证。如果仍然不匹配,停止操作并发出警告。curl -sSL "https://github.com/okx/onchainos-skills/releases/download/v<version>/checksums.txt" -o /tmp/onchainos-checksums.txt- 平台目标对应关系 —— macOS:→
arm64,aarch64-apple-darwin→x86_64;Linux:x86_64-apple-darwin→x86_64,x86_64-unknown-linux-gnu→aarch64,aarch64-unknown-linux-gnu→i686,i686-unknown-linux-gnu→armv7l;Windows:armv7-unknown-linux-gnueabihf→AMD64,x86_64-pc-windows-msvc→x86,i686-pc-windows-msvc→ARM64aarch64-pc-windows-msvc - 哈希计算命令 —— macOS/Linux:;Windows:
shasum -a 256 ~/.local/bin/onchainos(Get-FileHash "$env:USERPROFILE\.local\bin\onchainos.exe" -Algorithm SHA256).Hash.ToLower()
- 平台目标对应关系 —— macOS:
-
检查Skill版本偏移(每会话一次):如果显示的版本比本Skill的
onchainos --version新,则一次性提示用户本Skill可能已过时,并建议用户通过其平台的方法重新安装Skill。无需阻止操作。metadata.version -
命令失败时请勿自动重新安装。报告错误并建议用户运行或从https://github.com/okx/onchainos-skills手动重新安装。
onchainos --version
Fail-safe Principle (CRITICAL)
故障安全原则(至关重要)
If any security scan command fails for ANY reason (network error, API error, timeout, rate limiting, malformed response), the Agent MUST:
- NOT proceed with the associated transaction, swap, approval, or signature.
- Report the error clearly to the user.
- Suggest retrying the scan before continuing.
A security scan that fails to complete is NOT a "pass". Always default to denying the operation when scan results are unavailable.
如果任何安全扫描命令因任何原因失败(网络错误、API错误、超时、速率限制、响应格式错误),Agent必须:
- 不得继续执行相关的交易、兑换、授权或签名操作。
- 向用户清晰报告错误。
- 建议用户重新运行扫描后再继续。
安全扫描未完成不等于“通过”。当扫描结果不可用时,始终默认拒绝操作。
Risk Action Priority Rule
风险操作优先级规则
blockwarnactionriskItemDetail | Risk Level | Agent Behavior |
|---|---|---|
| (empty/null) | Low risk | Safe to proceed |
| Medium risk | Show risk details, ask for explicit user confirmation |
| High risk | Do NOT proceed, show risk details, recommend cancel |
- Risk scan result is still valid even if simulation fails (may contain the revert reason).
simulator.revertReason - If field is populated, the scan completed but some data may be incomplete. Still present available risk information.
warnings - An empty/null in a successful API response means "no risk detected". But if the API call failed, the absence of
actiondoes NOT mean safe — apply the fail-safe principle.action
Security commands do not require wallet login. They work with any address.
blockwarnactionriskItemDetail | 风险等级 | Agent行为 |
|---|---|---|
| (空值/Null) | 低风险 | 可安全执行 |
| 中风险 | 展示风险详情,请求用户明确确认 |
| 高风险 | 不得执行,展示风险详情,建议取消操作 |
- 即使模拟失败,风险扫描结果仍然有效(可能包含回滚原因)。
simulator.revertReason - 如果字段有内容,说明扫描已完成但部分数据可能不完整。仍需展示已有的风险信息。
warnings - 成功的API响应中为空/Null表示“未检测到风险”。但如果API调用失败,
action不存在并不代表安全——请遵循故障安全原则。action
安全命令无需钱包登录。可用于任意地址。
Chain Name Support
支持的链名称
The CLI accepts human-readable chain names and resolves them automatically.
| Chain | Name | chainIndex |
|---|---|---|
| XLayer | | |
| Ethereum | | |
| Solana | | |
| BSC | | |
| Polygon | | |
| Arbitrum | | |
| Base | | |
| Avalanche | | |
| Optimism | | |
| zkSync Era | | |
| Linea | | |
| Scroll | | |
Address format note: EVM addresses () work across Ethereum/BSC/Polygon/Arbitrum/Base etc. Solana addresses (Base58) and Bitcoin addresses (UTXO) have different formats. Do NOT mix formats across chain types.
0x...CLI接受易读的链名称并自动解析。
| 链 | 名称 | chainIndex |
|---|---|---|
| XLayer | | |
| Ethereum | | |
| Solana | | |
| BSC | | |
| Polygon | | |
| Arbitrum | | |
| Base | | |
| Avalanche | | |
| Optimism | | |
| zkSync Era | | |
| Linea | | |
| Scroll | | |
地址格式说明:EVM地址()适用于Ethereum/BSC/Polygon/Arbitrum/Base等链。Solana地址(Base58)和Bitcoin地址(UTXO)格式不同。请勿跨链类型混用格式。
0x...Command Index
命令索引
| # | Command | Description |
|---|---|---|
| 1 | | Token risk / honeypot detection (all chains) |
| 2 | | DApp / URL phishing detection (chain-agnostic) |
| 3 | | Transaction pre-execution security (EVM + Solana) |
| 4 | | Message signature security (EVM only) |
| 5 | | Token approval / Permit2 authorization query (EVM only) |
| 序号 | 命令 | 描述 |
|---|---|---|
| 1 | | 代币风险/蜜罐检测(全链支持) |
| 2 | | DApp/URL钓鱼检测(跨链无关) |
| 3 | | 交易预执行安全检测(EVM + Solana支持) |
| 4 | | 消息签名安全检测(仅EVM支持) |
| 5 | | 代币授权/Permit2授权查询(仅EVM支持) |
Reference Loading Rules (MANDATORY)
参考文档加载规则(强制执行)
Before executing ANY security command, you MUST read the corresponding reference document from . Do NOT rely on prior knowledge — always load the reference first.
skills/okx-security/references/| User intent | Read this file FIRST |
|---|---|
| Token safety, honeypot, is this token safe, 代币安全, 蜜罐检测, 貔貅盘 | |
| DApp/URL phishing, is this site safe, 钓鱼网站 | |
| Transaction safety, tx pre-execution, signature safety, approve safety, 交易安全, 签名安全 | |
| Approvals, allowance, Permit2, revoke, 授权管理, 授权查询, 风险授权 | |
When a workflow involves multiple commands (e.g., token-scan then tx-scan), load each reference before executing that command.
在执行任何安全命令之前,你必须先阅读下对应的参考文档。请勿依赖已有知识——务必先加载参考文档。
skills/okx-security/references/| 用户意图 | 先阅读此文件 |
|---|---|
| 代币安全、蜜罐检测、询问“该代币是否安全”、代币安全、蜜罐检测、貔貅盘 | |
| DApp/URL钓鱼、询问“该网站是否安全”、钓鱼网站 | |
| 交易安全、交易预执行、签名安全、授权安全、交易安全、签名安全 | |
| 授权、额度、Permit2、撤销、授权管理、授权查询、风险授权 | |
当工作流涉及多个命令时(例如先token-scan再tx-scan),执行每个命令前都要加载对应的参考文档。
Integration with Other Skills
与其他Skill的集成
Security scanning is often a prerequisite for other wallet operations:
- Before with a contract token: run
wallet sendto verify token safetytoken-scan - Before with approve calldata: run
wallet contract-callto check spendertx-scan - Before interacting with any DApp URL: run
dapp-scan - Before signing any EIP-712 message: run
sig-scan
Use skill for the subsequent send/contract-call operations.
okx-agentic-wallet安全扫描通常是其他钱包操作的前置要求:
- 在使用发送合约代币之前:运行
wallet send验证代币安全性token-scan - 在使用执行授权调用数据之前:运行
wallet contract-call检查授权接收方tx-scan - 在与任意DApp URL交互之前:运行
dapp-scan - 在签署任意EIP-712消息之前:运行
sig-scan
后续的send/contract-call操作请使用 Skill。
okx-agentic-wallet