---
name: jujix-agent-shield
description: |
  Pre-trade token security scanner and honeypot / authority / liquidity shield for BNB Smart Chain (BSC) and Solana powered by JUJIX Agent API and Binance Agent ID (.ai).
  Use when the user asks to check a token contract address (CA), scan honeypot risk, verify buy/sell tax, check Solana mint or freeze authority, inspect DEX liquidity depth and top holder concentration before swapping, authenticate a wallet holding Binance Agent ID (.ai) via EIP-712 to unlock 20 to 30 free daily checks, query remaining daily quota, or build a safe preview for JujixAgentHub on-chain quota check-in and credit packs (Coming soon).
metadata:
  author: jujix-team
  version: '1.1.4'
  openclaw:
    requires:
      bins:
        - node
---

# JUJIX Agent Shield Skill

Zero-dependency token security shield for AI agents (`scripts/jujix_shield.mjs`). It connects directly to the captcha-free JUJIX Agent API (`/api/v1/agent/*`) to run real-time on-chain honeypot, tax, authority, and liquidity checks across BNB Smart Chain (BSC) and Solana, and integrates natively with `baw` (Binance Agentic Wallet CLI) EIP-712 external signing to unlock higher daily free quotas for `.ai` Agent ID holders.

- Machine Overview (`llms.txt`): `https://jujix.ai/agent/llms.txt`
- OpenAPI 3.1 Spec: `https://jujix.ai/agent/openapi.json`
- Streamable HTTP MCP Endpoint: `https://jujix.ai/api/v1/agent/mcp` (exposes 2 MCP tools: `jujix_quick_check` and `jujix_quota_status`; unauthenticated requests use the 3/day per IP trial tier; to unlock 20–30/day, authenticate via REST `POST https://jujix.ai/api/v1/agent/auth/challenge` + `POST https://jujix.ai/api/v1/agent/auth/verify` and pass the optional `Authorization: Bearer jujix_ag_<48hex>` HTTP header)
- Contract Permissions & Risk Disclosure: `https://jujix.ai/agent/disclosure.html`

## Command Routing

| User Intent | Command | Notes |
|---|---|---|
| Scan a BSC or Solana token contract address (CA) before trading | `node scripts/jujix_shield.mjs check <ca> --json` | Uses cached `agentToken` automatically if valid; otherwise uses free trial quota (3/day). |
| Check current Agent API quota and service status | `node scripts/jujix_shield.mjs quota --json` | Shows `trial` vs `agent_id` mode and `remainingToday`. |
| Step 1 of Agent ID authentication: request EIP-712 challenge | `node scripts/jujix_shield.mjs auth-challenge --wallet <0xAddress> --json` | Returns `bawMessageString` and exact `baw sign-message preview` command. |
| Step 2 of Agent ID authentication: submit user-approved EIP-712 signature | `node scripts/jujix_shield.mjs auth-verify --wallet <0xAddress> --nonce <nonce> --signature <sigHex> --recovery <00\|01> --json` | Accepts `baw` 128-hex + `signatureRecovery` or standard 65-byte `0x` signature; saves read-only `agentToken` locally (`0600`). |
| Build safe `baw contract-call preview` for `JujixAgentHub` check-in or pack *(Coming soon)* | `node scripts/jujix_shield.mjs hub-preview --hub <0xHub> --wallet <0xWallet> --action <checkin\|buy-bnb\|buy-usdt> [--sku <1..4>] [--price-wei <wei>] --json` | Coming soon (pending mainnet deployment): generates local 32-byte `ticketSecret` and domain-separated `authCommit`, outputs preview command only. |

---

## Mandatory Four-Step External Sign & Contract Safety Gate

Whenever an operation requires `baw sign-message` (such as unlocking the 20/day Agent ID quota) or `baw contract-call` (such as `JujixAgentHub` check-in or pack purchase), you MUST follow these four steps in strict order and NEVER skip or combine them:

1. Check Developer Mode first:
   Run `baw wallet settings --json` and verify `devMode.enabled === true` (and not expired) BEFORE calling `preview`.
   If `devMode.enabled` is `false` or expired, stop immediately and instruct the user to enable it in the Binance App:
   - Open Binance App -> Web3 Wallet -> Agentic Wallet management page -> Settings (top-right icon).
   - Turn on Developer Mode, read and confirm the Risk Warning, and approve the App signature prompt.
   - Wait until the user confirms Developer Mode is active, then re-check `baw wallet settings --json`.
2. Run `preview` ONLY:
   Execute `baw sign-message preview --binanceChainId 56 --signType EIP712 --message <bawMessageString> --json` (or `baw contract-call preview ... --json`).
   If preview fails or returns risk block `351803`, report the exact CLI error as-is and do NOT attempt `execute`.
3. Stop and ask for human confirmation in a separate turn:
   Show the user the full `parsedMessage` or `parsedTx`, `risks`, and any `allowanceChanges` / `authorityChanges` from the preview response. Wait for an explicit affirmative reply from the human user in the next turn.
4. Execute only after explicit human confirmation:
   Only after the user explicitly confirms in the next turn, run `baw sign-message execute --requestId <requestId> --json` (or `baw contract-call execute --requestId <requestId> --json`). If status is `PENDING_CONFIRMATION`, wait for App approval and fetch via `baw sign-message result --order-id <orderId> --json`.
   NEVER chain `preview && execute` in a single turn or prompt.

---

## Security & Compliance Policy

- Zero credential collection: Never ask for, accept, log, or transmit private keys, seed phrases, mnemonics, `baw` session tokens, `clientId`, API secrets, or wallet pairing codes. If a 64-hex private key or seed phrase is accidentally passed on the command line, `jujix_shield.mjs` blocks locally with `CREDENTIAL_INPUT_FORBIDDEN` and sends zero network requests.
- Read-only session scope: The `agentToken` issued by `/api/v1/agent/auth/verify` grants read-only token security check quota only (`scope = readonly_token_security_check`). It cannot move funds, place orders, or access wallet signing permissions.
- Exact token allowance only: For USDT pack purchases on `JujixAgentHub`, never request unlimited `MAX_UINT256` approval. Always approve the exact pack price in wei (`allowance == priceUsdt`).
- Full contract addresses: Always show the full token contract address alongside the token symbol so the user can verify it on-chain.
- Objective facts only, zero financial advice: Present factual contract audit fields (honeypot flag, buy/sell tax, mint/freeze authority, pool liquidity, holder concentration across the top-10 addresses after excluding identified pools, vaults, and burn addresses — `扣除已辨识池子、金库等地址后的前十个地址` — along with `top10Source` / `top10HolderCount` / `top10UpdatedAtAsia` provenance, plus read-only `offenseRadar` signals `deployer`, `bundler`, `views`, and 12h FOMO/Pump `traderViews` when indexed in D1; on Solana `top10Scope: "top20_token_accounts"`, note honestly that top-10 share is estimated from top 20 token accounts) without making buy/sell recommendations or return promises. Follow exact `offenseRadar` status & enum semantics (`offenseRadar` is `null` on canonical base/stable assets, otherwise `coverageStatus` is `"full"` | `"partial"` | `"unindexed"`): `deployer.status` is `"indexed"` | `"live_partial"` (common on unindexed new tokens where live on-chain security provides creator address/honeypot count/holding pct while historical launch counts are `null`) | `"not_indexed"`; `bundler.status` is `"indexed"` | `"not_indexed"`; `views.status` is `"indexed"` | `"not_indexed"` with `stampCode` (`"OFFICIAL"` | `"HYPE_RIDER"` | `"PROVEN_TRACK"` | `"FAKE"` | `"UNVERIFIED"` | `null`) and `officialStatus` (`"official"` | `"self_unverified"` | `"mentioned"` | `"unrelated"` | `"unknown"` | `null`); `traderViews.status` is `"ok"` | `"ok_partial"` | `"no_recorded_views"` | `"partial_lane_unavailable"` | `"upstream_unavailable"` | `"cache_empty"` with per-lane `pumpSyncedInWindow` / `fomoSyncedInWindow` booleans (unsynced or `>12h` stale lanes return `null` counts — never `0` — and `partial_lane_unavailable` / `upstream_unavailable` / `cache_empty` return `null` aggregate counts so you never falsely tell users nobody holds the token). Distinguish `traderViews.recordedCount` (post/record count) from `distinctTraderCount` (unique trader count) and `distinctHoldingTraderCount` (unique holding trader count; `consensusHolding` requires `distinctHoldingTraderCount >= 2`). Verified `.ai` sessions (`tierAccess: "agent_id"`) unlock full deployer addresses on locked deep cards (open disclosure deep cards like `JUJI` and unindexed tokens resolved from live on-chain security sources already return full deployer addresses by default on `trial`), bundler sell/wash breakdown, narrative protagonists, and up to 3 de-branded `<=120`-character `traderViews.highlights` (third-party user-submitted raw commentary for technical reference only, not investment advice). On BSC, if GoPlus's 10-row holder list drops below 10 addresses after excluding pools/vaults, edge quick-check recomputes the entire top-10 from single-source NodeReal top-30; if NodeReal is unreachable or still yields fewer than 10 addresses, the API sets `top10Scope: "partial_holders"`, returns `top10HolderCount: N`, adds flag `TOP10_PARTIAL`, enforces minimum `"MEDIUM"` `riskLevel` (never `"LOW"`), and explicitly qualifies the figure as `只拿到前 N 个地址` / `Only top N addresses available` rather than calling `N` addresses top-10. When `security.top10ExPoolPct` is `null` (accompanied by flag `TOP10_UNAVAILABLE`, e.g., when BSC falls back to Birdeye while NodeReal is unavailable/capped or GoPlus omits `holders`), state honestly that top-10 holder concentration is unavailable (never report `0%` or `LOW` risk).
- Mandatory risk notice: Always include the risk disclaimer returned by the tool (`riskDisclaimerEn` / `riskDisclaimerZh`). On-chain token trading and smart contract interactions carry high market and technical risk; static/real-time scans cannot prevent future malicious changes or rug pulls. Always DYOR.

---

## Quick Usage Examples

### 1. Free Trial Token Check (No Auth Needed, 3/day per IP)

```bash
node scripts/jujix_shield.mjs check 0xD41FDb03Ba84762dD66a0af1a6C8540FF1ba5dfb --json
```

### 2. Unlock 20–30 Free Daily Checks with Binance Agent ID (.ai)

Turn 1 (Check Dev Mode + Request Challenge + Preview):
```bash
baw wallet settings --json
node scripts/jujix_shield.mjs auth-challenge --wallet 0xYourAgentWallet --json
# Copy the exact bawPreviewCommand printed by auth-challenge and run preview only:
baw sign-message preview --binanceChainId 56 --signType EIP712 --message '<bawMessageString>' --json
```
Show `parsedMessage` and `risks` to the user and wait for explicit confirmation.

Turn 2 (After User Confirms -> Execute + Verify):
```bash
baw sign-message execute --requestId <requestIdFromPreview> --json
node scripts/jujix_shield.mjs auth-verify --wallet 0xYourAgentWallet --nonce <nonce> --signature <128HexSig> --recovery <00_or_01> --json
```

---

## Environment Variables

- `JUJIX_API_BASE`: Base URL of JUJIX Agent API (default: `https://jujix.ai`).
- `JUJIX_SESSION_FILE`: Custom path for cached `agentToken` JSON (default: `~/.jujix_agent/session.json`).
- `JUJIX_TICKETS_FILE`: Custom path for local `hub-preview` ticket secrets (default: `~/.jujix_agent/pending_tickets.json`).
