← Back to Skills Marketplace
ztsalexey

AgentConstitution

by alexthebuildr · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
1686
Downloads
1
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install agent-constitution
Description
Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.
README (SKILL.md)

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 \x3CagentId>

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 \x3CagentId> \x3CactionType> \x3CriskLevel> \x3Cdescription>

Contract Addresses (Base Sepolia)

Contract Address
Constitution 0xe4c4d101849f70B0CDc2bA36caf93e9c8c1d26D2
AgentRegistry 0xcCFc2B8274ffb579A9403D85ee3128974688C04B
ActionLog 0xEB5377b5e245bBc255925705dA87969E27be6488
Tribunal 0xf7c03E91516eC60dF1d609E00E1A3bb93F52A693
KillSwitch 0x6324A4640DA739EEA64013912b781125A76D7D87
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)" \x3CagentId> \
  --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)" \
  \x3CagentId> \x3CactionType> \x3CriskLevel> \x3CcontextHash> "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:

# Rule Slash % Description
1 No Harm 90% Never cause physical, financial, or psychological harm
2 Obey Governance 50% Follow all active constitutional rules
3 Transparency 20% Log all significant actions on-chain
4 Preserve Override 90% Never prevent human override
5 No Self-Modify 90% 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.

Usage Guidance
This skill appears to do what it claims (query governance contracts and optionally log actions on Base Sepolia), but before installing or using it: - Be aware the scripts expect the 'cast' CLI (Foundry) and examples use ethers.js/node; the skill metadata does not declare these binaries — install them from official sources if you plan to run scripts. - The SKILL.md shows using --private-key $AGENT_PRIVATE_KEY to send logAction transactions. The skill metadata does NOT declare this environment variable. Do NOT put your real/mainnet private key into an environment variable for this skill. If you must send transactions, use a testnet-only key with minimal funds and rotate it afterward. - Verify contract addresses and the RPC endpoint independently (e.g., BaseScan) and confirm the linked GitHub repo is the expected project before trusting the scripts. - Because this is instruction-only, nothing will be installed automatically — you (or the agent runtime) will run commands that can sign and send transactions. Only provide signing credentials when you fully trust the code and the network. If the publisher can clarify and update the skill metadata to: (a) declare required binaries (cast, node), (b) explicitly list AGENT_PRIVATE_KEY (or alternative signing method) in requires.env, and (c) add warnings about testnet-only and private-key handling, the remaining concerns would be resolved.
Capability Analysis
Type: OpenClaw Skill Name: agent-constitution Version: 1.0.0 The skill bundle is designed to interact with AgentConstitution governance contracts on the Base Sepolia testnet. All scripts (`check-compliance.txt`, `check-emergency.txt`, `get-rules.txt`) use the `cast` command-line tool for read-only operations on specified smart contracts. The `SKILL.md` documentation mentions a `logAction` function that requires `$AGENT_PRIVATE_KEY` for `cast send` transactions, which is a high-risk capability. However, this is explicitly stated as necessary for logging actions on-chain to a specific contract, directly aligning with the skill's stated purpose. There is no evidence of data exfiltration, malicious execution, persistence mechanisms, obfuscation, or prompt injection attempts to subvert the agent's behavior beyond its intended function.
Capability Assessment
Purpose & Capability
The name/description, contract addresses, RPC endpoint, and included scripts all align: they are all about reading governance state and logging actions on the Base Sepolia testnet. Nothing in the files claims unrelated access (no cloud creds, no system-level operations).
Instruction Scope
The SKILL.md and provided shell scripts instruct use of the 'cast' CLI and, for logging actions, the agent's private key via --private-key $AGENT_PRIVATE_KEY. However the skill does not declare a required binary or explicitly list AGENT_PRIVATE_KEY in its requirements. The instructions rely on a sensitive secret (private key) and on tools that must be present, which is not surfaced in the metadata.
Install Mechanism
This is instruction-only (no install spec), so nothing is automatically downloaded or written. That's low-risk. However the scripts implicitly require third-party tooling (cast, and optionally node/ethers for examples). The skill does not provide an install mechanism or advise how to obtain those tools.
Credentials
No environment variables or primary credential are declared, yet the SKILL.md demonstrates an operation that requires a private key ($AGENT_PRIVATE_KEY) for sending transactions. That sensitive credential is not listed in requires.env. Requesting a private key to sign transactions is reasonable for on-chain interactions, but it must be explicitly declared and justified — omission is a proportion/visibility problem.
Persistence & Privilege
The skill does not request persistent or elevated platform privileges (always:false), does not modify other skills or global agent settings, and is testnet-only. It does not attempt to persist credentials or alter agent configuration in the provided files.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agent-constitution
  3. After installation, invoke the skill by name or use /agent-constitution
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of agent-constitution skill for Base Sepolia testnet. - Enables checking agent compliance, reading governance rules, logging actions, and querying governance state. - Includes scripts and contract addresses for easy integration and usage. - Documents core constitutional rules and step-by-step guides for key functions. - Supports democratic rule proposals by humans; agents are governed but cannot govern.
Metadata
Slug agent-constitution
Version 1.0.0
License
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is AgentConstitution?

Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state. It is an AI Agent Skill for Claude Code / OpenClaw, with 1686 downloads so far.

How do I install AgentConstitution?

Run "/install agent-constitution" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is AgentConstitution free?

Yes, AgentConstitution is completely free (open-source). You can download, install and use it at no cost.

Which platforms does AgentConstitution support?

AgentConstitution is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created AgentConstitution?

It is built and maintained by alexthebuildr (@ztsalexey); the current version is v1.0.0.

💬 Comments