Okx official security

From jiayaoqijia/cryptoskill · View interactive version

Okx official security is an AI agent skill from the GitHub repository jiayaoqijia/cryptoskill. Use this skill for security scanning: check transaction safety, is this transaction safe, pre-execution check, security scan, token risk scanning, honeypot detection, DApp/URL phishing detection, message signature safety, malicious transaction detection, approval safety checks, token approval manage

How to use this skill

Skill file

Onchain OS Security

5 commands for token risk analysis, DApp phishing detection, transaction pre-execution security, signature safety, and approval management.

Pre-flight Checks

Every time before running any onchainos 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.

  1. 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 the tag_name field (e.g., v1.0.5) into LATEST_TAG.

If the API call fails and onchainos is 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). If onchainos is not installed, stop and

tell the user to check their network connection or install manually from

https://github.com/okx/onchainos-skills.

  1. Install or update: If onchainos is not found, or if the cache at ~/.onchainos/last_check ($env:USERPROFILE\.onchainos\last_check on Windows) is older than 12 hours:

curl -sSL "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.sh" -o /tmp/onchainos-install.sh

curl -sSL "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -o /tmp/installer-checksums.txt

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"

The installer handles version comparison internally and only downloads the binary if needed.

  1. Verify binary integrity (once per session): Run onchainos --version to get the installed

version (e.g., 1.0.5 or 2.0.0-beta.0). Construct the installed tag as v<version>.

Download checksums.txt for the installed version's tag (not necessarily LATEST_TAG):

curl -sSL "https://github.com/okx/onchainos-skills/releases/download/v<version>/checksums.txt" -o /tmp/onchainos-checksums.txt

Look 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.

  1. Check for skill version drift (once per session): If onchainos --version is newer

than this skill's metadata.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.

  1. Do NOT auto-reinstall on command failures. Report errors and suggest

onchainos --version or manual reinstall from https://github.com/okx/onchainos-skills.

  1. 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 a .env file, remind them to add .env to .gitignore.

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:

A security scan that fails to complete is NOT a "pass". Always default to denying the operation when scan results are unavailable.

Risk Action Priority Rule

block > warn > safe (empty). The top-level action field reflects the highest priority from riskItemDetail.

| action value | Risk Level | Agent Behavior |

|---|---|---|

| (empty/null) | Low risk | Safe to proceed |

| warn | Medium risk | Show risk details, ask for explicit user confirmation |

| block | High risk | Do NOT proceed, show risk details, recommend cancel |

Security commands do not require wallet login. They work with any address.

Chain Name Support

The CLI accepts human-readable chain names and resolves them automatically.

| Chain | Name | chainIndex |

|---|---|---|

| XLayer | xlayer | 196 |

| Ethereum | ethereum or eth | 1 |

| Solana | solana or sol | 501 |

| BSC | bsc or bnb | 56 |

| Polygon | polygon or matic | 137 |

| Arbitrum | arbitrum or arb | 42161 |

| Base | base | 8453 |

| Avalanche | avalanche or avax | 43114 |

| Optimism | optimism or op | 10 |

| zkSync Era | zksync | 324 |

| Linea | linea | 59144 |

| Scroll | scroll | 534352 |

Address format note: EVM addresses (0x...) 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.

Command Index

| # | Command | Description |

|---|---|---|

| 1 | onchainos security token-scan | Token risk / honeypot detection (all chains) |

| 2 | onchainos security dapp-scan | DApp / URL phishing detection (chain-agnostic) |

| 3 | onchainos security tx-scan | Transaction pre-execution security (EVM + Solana) |

| 4 | onchainos security sig-scan | Message signature security (EVM only) |

| 5 | onchainos security approvals | Token approval / Permit2 authorization query (EVM only) |

Reference Loading Rules (MANDATORY)

Before executing ANY security command, you MUST read the corresponding reference document from skills/okx-security/references/. Do NOT rely on prior knowledge — always load the reference first.

| User intent | Read this file FIRST |

|---|---|

| Token safety, honeypot, is this token safe, 代币安全, 蜜罐检测, 貔貅盘 | references/risk-token-detection.md |

| DApp/URL phishing, is this site safe, 钓鱼网站 | references/risk-domain-detection.md |

| Transaction safety, tx pre-execution, signature safety, approve safety, 交易安全, 签名安全 | references/risk-transaction-detection.md |

| Approvals, allowance, Permit2, revoke, 授权管理, 授权查询, 风险授权 | references/risk-approval-monitoring.md |

When a workflow involves multiple commands (e.g., token-scan then tx-scan), load each reference before executing that command.

Integration with Other Skills

Security scanning is often a prerequisite for other wallet operations:

Use okx-agentic-wallet skill for the subsequent send/contract-call operations.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.