360 Secure SkillHub
360 安全技能中心

Sfaeflow Solana Skill

这是Solana链上的AI代理支付技能,核心功能含生成代理密钥对、通过SafeFlow控制台创建带额度限制的支付会话、执行链上受管控的自动化支付,还支持查询剩余预算及分类处理支付错误。典型场景为AI代理需在Solana上进行合规、限额的自动支付,通过命令行脚本操作,输入收款地址等参数,输出支付结果或状态,规则由链上合约强制执行。

fwangzil
fwangzil
热度 33.67
最近更新 2026-05-18 11:36:14
分类:开发依赖:代码执行 / 读写文件 / 第三方 API应用场景:自动化脚本 / API 集成 / 财务

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add safe-flow-solana-skill
Metadata
name
safe-flow-solana-skill
description
Use when running SafeFlow against a deployed Solana program. Trigger for tasks such as generating an agent keypair, asking the owner to fund gas and create wallet/session via the web dashboard, saving walletPda/sessionPda for autonomous payments, and executing rate-limited payments on Solana.

SafeFlow Solana Agent Skill

Operate this as a payment skill for AI agents on Solana with on-chain rate limiting.

Default program ID (devnet):

  • DwYEDn6xRpSbnNA7mkszQgDAUoHGfgdBNSi6pwy4qJKy

Quick Start (Owner-Handoff)

  1. Bootstrap agent keypair and print owner handoff instructions:
cd safe-flow-solana-skill/scripts
chmod +x ./*.sh
./bootstrap.sh \
  --program-id DwYEDn6xRpSbnNA7mkszQgDAUoHGfgdBNSi6pwy4qJKy \
  --cluster devnet
  1. Ask owner to:

    • Fund the agent address with SOL for gas (~0.01 SOL)
    • Open the SafeFlow dashboard and create a wallet + session for the agent address
    • Return with walletOwner public key
  2. Save owner-provided config:

./save_config.sh \
  --wallet-owner <OWNER_PUBKEY>
  1. Execute payment:
./execute_payment.sh \
  --recipient <RECIPIENT_ADDRESS> \
  --amount 500000000 \
  --evidence-id "reasoning:task_completed"

How It Works

  1. Agent generates a Solana keypair (stored locally in .safeflow/agent-keypair.json)
  2. Owner creates an AgentWallet PDA + deposits SOL + creates a SessionCap for the agent
  3. Agent uses the SessionCap to execute rate-limited payments autonomously
  4. All payments are enforced on-chain: rate limit, total cap, expiration, and revocation

Session Query

Check remaining budget before attempting payment:

./execute_payment.sh --query --wallet-owner <OWNER_PUBKEY>

Error Handling

The skill classifies payment failures:

Error Meaning Agent Action
ExceedsRateLimit Too fast Wait, retry with smaller amount
ExceedsTotalLimit Budget exhausted Stop, notify owner
SessionExpired Time's up Ask owner for new session
SessionRevoked Owner killed it Stop immediately