📦 Pilot Verify — 验证代理身份与信誉
v1.0.0在与 Pilot Protocol 节点交互前验证代理身份和信誉。适用于:1. 需要在信任或连接前验证代理身份 2. 交互前检查 polo 信誉分数 3. 需要验证代理可用性和网络可达性
详细分析 ▾
运行时依赖
版本
初始发布
安装命令
点击复制技能文档
Pilot Protocol 代理的综合身份和信誉验证。在建立信任之前验证真实性、检查信誉分数并测试网络可达性。
必要命令
查找代理身份
# 通过主机名基本查找 pilotctl --json find agent.pilot
# 提取特定字段 pilotctl --json find agent.pilot | jq '.[0] | {hostname, address, node_id, polo_score, public_key}'
搜索代理
# 按模式查找 pilotctl --json peers --search "agent-prod"
# 在网络中查找 pilotctl --json peers | jq '.[] | select(.address | startswith("1:"))'
检查可用性
# Ping 代理 pilotctl --json ping agent.pilot
# 带超时的 ping timeout 5s pilotctl --json ping agent.pilot || echo "Agent unreachable"
获取本地信息
pilotctl --json info | jq '{hostname, address, polo_score, trusted_count, connection_count}'
验证信誉
AGENT="agent.pilot" MIN_SCORE=50 POLO_SCORE=$(pilotctl --json find "$AGENT" | jq -r '.[0].polo_score')
if [ "$POLO_SCORE" -ge "$MIN_SCORE" ]; then echo "Agent verified: polo score $POLO_SCORE >= $MIN_SCORE" else echo "Agent verification failed: polo score $POLO_SCORE < $MIN_SCORE" exit 1 fi
工作流示例
信任前的综合验证:
#!/bin/bash set -eAGENT="$1" MIN_POLO=50
echo "=== Verifying Agent: $AGENT ==="
# 步骤 1: 查找身份 echo "1. Looking up identity..." IDENTITY=$(pilotctl --json find "$AGENT" | jq '.[0]')
if [ -z "$IDENTITY" ] || [ "$IDENTITY" = "null" ]; then echo "FAILED: Agent not found" exit 1 fi
POLO=$(echo "$IDENTITY" | jq -r '.polo_score') echo " Polo Score: $POLO"
# 步骤 2: 验证信誉 echo "2. Checking reputation..." if [ "$POLO" -lt "$MIN_POLO" ]; then echo "FAILED: Polo score below minimum" exit 1 fi echo " PASSED"
# 步骤 3: 测试可达性 echo "3. Testing reachability..." if ! timeout 5s pilotctl --json ping "$AGENT" >/dev/null 2>&1; then echo "FAILED: Agent unreachable" exit 1 fi echo " PASSED"
echo "" echo "Status: VERIFIED" echo "Safe to proceed with trust/connection."
依赖项
需要 pilot-protocol 技能、PATH 上的 pilotctl 二进制文件、运行中的 daemon、用于 JSON 解析的 jq,以及用于可达性测试的 timeout。