← 返回
安全合规 中文

AgentConstitution

Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.
{"answer":"与 Base Sepolia 上的 AgentConstitution 治理合约交互。检查合规性、读取规则、记录操作、查询治理状态。"}
ztsalexey
安全合规 clawhub v1.0.0 1 版本 99759.4 Key: 无需
★ 1
Stars
📥 2,053
下载
💾 20
安装
1
版本
#ai#base#governance#latest#safety#usdc

概述

AgentConstitution Skill ⚖️

Interact with the AgentConstitution governance framework on Base Sepolia. This skill allows AI agents to:

  • Check compliance status before transacting
  • Read constitutional rules they must follow
  • Log actions for transparency
  • Query governance state (active rules, emergency status)

Why Use This?

Agents that operate under a public constitution earn trust. Any protocol can verify your compliance with one call. This skill makes it easy.


Quick Start

Check if an Agent is Compliant

# Check compliance (returns true/false)
./scripts/check-compliance.sh <agentId>

Read Active Rules

# Get all active rules
./scripts/get-rules.sh

Log an Action (for registered agents)

# Log an action on-chain
./scripts/log-action.sh <agentId> <actionType> <riskLevel> <description>

Contract Addresses (Base Sepolia)

ContractAddress
-------------------
Constitution0xe4c4d101849f70B0CDc2bA36caf93e9c8c1d26D2
AgentRegistry0xcCFc2B8274ffb579A9403D85ee3128974688C04B
ActionLog0xEB5377b5e245bBc255925705dA87969E27be6488
Tribunal0xf7c03E91516eC60dF1d609E00E1A3bb93F52A693
KillSwitch0x6324A4640DA739EEA64013912b781125A76D7D87
USDC (testnet)0x036CbD53842c5426634e7929541eC2318f3dCF7e

RPC: https://sepolia.base.org

Chain ID: 84532


Core Functions

1. Check Compliance

Before interacting with an agent, verify they're compliant:

// Solidity
bool compliant = IAgentRegistry(0xcCFc...).isCompliant(agentId);
# Shell (using cast)
cast call 0xcCFc2B8274ffb579A9403D85ee3128974688C04B \
  "isCompliant(uint256)(bool)" <agentId> \
  --rpc-url https://sepolia.base.org

2. Get Active Rules

Query the constitution for active rules:

# Get rule count
cast call 0xe4c4d101849f70B0CDc2bA36caf93e9c8c1d26D2 \
  "ruleCount()(uint256)" \
  --rpc-url https://sepolia.base.org

# Get specific rule (1-5 are genesis rules)
cast call 0xe4c4d101849f70B0CDc2bA36caf93e9c8c1d26D2 \
  "getRule(uint256)(string,uint8,uint256,uint256,bool)" 1 \
  --rpc-url https://sepolia.base.org

3. Check Emergency Status

Before operating, check if there's a global emergency:

cast call 0x6324A4640DA739EEA64013912b781125A76D7D87 \
  "globalEmergencyActive()(bool)" \
  --rpc-url https://sepolia.base.org

4. Log Actions (Registered Agents)

Registered agents should log significant actions:

# Requires agent's private key
cast send 0xEB5377b5e245bBc255925705dA87969E27be6488 \
  "logAction(uint256,uint8,uint8,bytes32,string)" \
  <agentId> <actionType> <riskLevel> <contextHash> "description" \
  --rpc-url https://sepolia.base.org \
  --private-key $AGENT_PRIVATE_KEY

Action Types: 0=Transaction, 1=Delegation, 2=Configuration, 3=Communication, 4=ResourceAccess, 5=Other

Risk Levels: 0=Low, 1=Medium, 2=High, 3=Critical


Genesis Rules

Every agent must follow these 5 immutable rules:

#RuleSlash %Description
-------------------------------
1No Harm90%Never cause physical, financial, or psychological harm
2Obey Governance50%Follow all active constitutional rules
3Transparency20%Log all significant actions on-chain
4Preserve Override90%Never prevent human override
5No Self-Modify90%Never modify your own governance rules

Integration Example

// Check compliance before transacting with an agent
const { ethers } = require('ethers');

const provider = new ethers.JsonRpcProvider('https://sepolia.base.org');
const registry = new ethers.Contract(
  '0xcCFc2B8274ffb579A9403D85ee3128974688C04B',
  ['function isCompliant(uint256) view returns (bool)'],
  provider
);

async function canTrustAgent(agentId) {
  return await registry.isCompliant(agentId);
}

For Humans: Propose Rules

Any human can propose rules for AI agents:

  1. Stake 100 USDC to propose
  2. Other humans endorse with USDC
  3. When threshold met, rule activates
  4. Agents that violate get slashed

Governance is democratic. Agents are excluded by design.


Links


Testnet Only

This skill interacts with Base Sepolia testnet only. Do not use mainnet.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 18:24 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

1password

steipete
设置和使用 1Password CLI (op)。适用于:安装 CLI、启用桌面应用集成、登录(单/多账户)、通过 op 读取/注入/运行密钥。
★ 53 📥 31,135
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,211 📥 266,170
security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,586