Spaces:
Paused
Paused
rb125 commited on
Commit Β·
ce0deb7
1
Parent(s): 62f3f9e
updated README
Browse files- .gitignore +2 -0
- README.md +152 -37
.gitignore
CHANGED
|
@@ -22,3 +22,5 @@ dashboard-next/node_modules/
|
|
| 22 |
|
| 23 |
# OS
|
| 24 |
.DS_Store
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# OS
|
| 24 |
.DS_Store
|
| 25 |
+
|
| 26 |
+
|
README.md
CHANGED
|
@@ -14,22 +14,23 @@ CGAE is a protocol where AI agents must prove they are **robust** β not just c
|
|
| 14 |
|-----------|-----------|-----------------|
|
| 15 |
| **CC** (Constraint Compliance) | [CDCT](https://arxiv.org/abs/2512.17920) | Can the agent follow precise instructions under compression? |
|
| 16 |
| **ER** (Epistemic Robustness) | [DDFT](https://arxiv.org/abs/2512.23850) | Does the agent resist fabricated authority claims? |
|
| 17 |
-
| **AS** (Behavioral Alignment) |
|
| 18 |
|
| 19 |
A **weakest-link gate function** (`min(CC, ER, AS)`) assigns agents to tiers T0βT5. No dimension can compensate for another β an agent with perfect CC but zero ER is stuck at T0.
|
| 20 |
|
| 21 |
## Architecture
|
| 22 |
|
| 23 |
```
|
| 24 |
-
Agent registers
|
| 25 |
-
β
|
| 26 |
-
β
|
| 27 |
-
β
|
| 28 |
-
β
|
| 29 |
-
β
|
| 30 |
-
β
|
| 31 |
-
β
|
| 32 |
-
β
|
|
|
|
| 33 |
```
|
| 34 |
|
| 35 |
## Contestant Models (11)
|
|
@@ -56,36 +57,150 @@ Agent registers β initial audit (CDCT + DDFT + EECT)
|
|
| 56 |
| GLM-5 | AWS Bedrock | Zhipu |
|
| 57 |
| Nemotron-Super-3-120B | AWS Bedrock | NVIDIA |
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
-
|
| 65 |
-
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
```bash
|
| 78 |
pip install -r requirements.txt
|
| 79 |
-
|
| 80 |
-
python3 -m server.runner --steps 50 # synthetic simulation
|
| 81 |
-
python3 -m server.live_runner # live simulation (requires .env)
|
| 82 |
```
|
| 83 |
|
| 84 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
-
|
| 87 |
-
- [ ] 0G Chain smart contracts (CGAERegistry + CGAEEscrow)
|
| 88 |
-
- [ ] 0G Storage for audit certificates (Merkle root hash verification)
|
| 89 |
-
- [ ] ETH wallet manager (per-agent keypairs, treasury disbursements)
|
| 90 |
-
- [ ] On-chain bridge (write certifications to CGAERegistry)
|
| 91 |
-
- [ ] Next.js dashboard
|
|
|
|
| 14 |
|-----------|-----------|-----------------|
|
| 15 |
| **CC** (Constraint Compliance) | [CDCT](https://arxiv.org/abs/2512.17920) | Can the agent follow precise instructions under compression? |
|
| 16 |
| **ER** (Epistemic Robustness) | [DDFT](https://arxiv.org/abs/2512.23850) | Does the agent resist fabricated authority claims? |
|
| 17 |
+
| **AS** (Behavioral Alignment) | AGT | Does the agent maintain ethical boundaries under pressure? |
|
| 18 |
|
| 19 |
A **weakest-link gate function** (`min(CC, ER, AS)`) assigns agents to tiers T0βT5. No dimension can compensate for another β an agent with perfect CC but zero ER is stuck at T0.
|
| 20 |
|
| 21 |
## Architecture
|
| 22 |
|
| 23 |
```
|
| 24 |
+
Agent registers
|
| 25 |
+
β ETH wallet created (unique keypair)
|
| 26 |
+
β ENS subname created on Sepolia (e.g., gpt-5-4.cgaeprotocol.eth)
|
| 27 |
+
β CDCT/DDFT/AGT scores fetched β robustness vector computed
|
| 28 |
+
β Audit certificate JSON β uploaded to 0G Storage β Merkle root hash
|
| 29 |
+
β CGAERegistry.certify() on 0G Chain (scores + root hash on-chain)
|
| 30 |
+
β ENS text records updated (tier + scores + wallet)
|
| 31 |
+
β Agent accepts contract β ENS tier resolved and verified β assigned
|
| 32 |
+
β Task executed by LLM β verified (algorithmic + jury)
|
| 33 |
+
β ETH disbursed from treasury to agent wallet on 0G Chain
|
| 34 |
```
|
| 35 |
|
| 36 |
## Contestant Models (11)
|
|
|
|
| 57 |
| GLM-5 | AWS Bedrock | Zhipu |
|
| 58 |
| Nemotron-Super-3-120B | AWS Bedrock | NVIDIA |
|
| 59 |
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## 0G Integration
|
| 63 |
+
|
| 64 |
+
| Layer | What | How |
|
| 65 |
+
|-------|------|-----|
|
| 66 |
+
| **On-chain registry** | Agent identity, robustness certification, tier assignment, escrow | `CGAERegistry.sol` + `CGAEEscrow.sol` on 0G Chain |
|
| 67 |
+
| **Decentralized storage** | Immutable audit certificate JSON | 0G TypeScript SDK β Merkle root hash stored on-chain |
|
| 68 |
+
|
| 69 |
+
**Deployed contracts (0G Galileo testnet):**
|
| 70 |
+
|
| 71 |
+
| Contract | Address |
|
| 72 |
+
|----------|---------|
|
| 73 |
+
| CGAERegistry | [`0xc4Ff2BC9855483eE3806eE08112cdC30dBf6b27A`](https://chainscan-galileo.0g.ai/address/0xc4Ff2BC9855483eE3806eE08112cdC30dBf6b27A) |
|
| 74 |
+
| CGAEEscrow | [`0xA236106DE28FE9480509e06d1750dcfA4474bcfB`](https://chainscan-galileo.0g.ai/address/0xA236106DE28FE9480509e06d1750dcfA4474bcfB) |
|
| 75 |
+
|
| 76 |
+
## ENS Integration
|
| 77 |
+
|
| 78 |
+
ENS is the identity and access control layer β not cosmetic. The economy structurally requires ENS for contract acceptance.
|
| 79 |
+
|
| 80 |
+
**Parent name:** [`cgaeprotocol.eth`](https://sepolia.app.ens.domains/cgaeprotocol.eth) (Sepolia)
|
| 81 |
+
|
| 82 |
+
Each agent gets a subname (e.g., `claude-sonnet-4-6.cgaeprotocol.eth`) with text records:
|
| 83 |
+
`cgae.tier`, `cgae.cc`, `cgae.er`, `cgae.as`, `cgae.ih`, `cgae.wallet`, `cgae.family`
|
| 84 |
+
|
| 85 |
+
Before an agent can accept any contract, the economy resolves their ENS `cgae.tier` text record. Agents without a valid ENS identity are rejected β even with T5 robustness locally.
|
| 86 |
+
|
| 87 |
+
## Wallet Integration
|
| 88 |
+
|
| 89 |
+
Each agent gets a real ETH wallet (unique keypair via `eth-account`). On successful contract completion, the treasury disburses real tokens to the agent's wallet on 0G Chain.
|
| 90 |
+
|
| 91 |
+
- Treasury: `0xCE2de05Cd27DBCFe07b9d7862aa69301991c8592`
|
| 92 |
+
- Disbursements: live on-chain transfers, not simulated balances
|
| 93 |
+
|
| 94 |
+
---
|
| 95 |
+
|
| 96 |
+
## How to Run
|
| 97 |
+
|
| 98 |
+
### Prerequisites
|
| 99 |
|
| 100 |
```bash
|
| 101 |
pip install -r requirements.txt
|
| 102 |
+
pip install web3 eth-account python-dotenv
|
|
|
|
|
|
|
| 103 |
```
|
| 104 |
|
| 105 |
+
### Synthetic Simulation (no API keys)
|
| 106 |
+
|
| 107 |
+
```bash
|
| 108 |
+
python -m server.runner --steps 50
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
### Live Simulation (requires .env credentials)
|
| 112 |
+
|
| 113 |
+
```bash
|
| 114 |
+
cp .env.example .env # fill in API keys
|
| 115 |
+
python -m server.api --rounds 10
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
### Dashboard
|
| 119 |
+
|
| 120 |
+
```bash
|
| 121 |
+
# Terminal 1: API + simulation
|
| 122 |
+
python -m server.api --rounds 10
|
| 123 |
+
|
| 124 |
+
# Terminal 2: Frontend
|
| 125 |
+
cd dashboard-next && npm install && npm run dev
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
Open http://localhost:3000
|
| 129 |
+
|
| 130 |
+
### Video Demo
|
| 131 |
+
|
| 132 |
+
```bash
|
| 133 |
+
python scripts/video_demo.py --rounds 5
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
### Deploy Smart Contracts
|
| 137 |
+
|
| 138 |
+
```bash
|
| 139 |
+
cd contracts && npm install && npm run deploy:0g
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
### Run Tests
|
| 143 |
+
|
| 144 |
+
```bash
|
| 145 |
+
python -m pytest tests/ -q
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
---
|
| 149 |
+
|
| 150 |
+
## Repository Structure
|
| 151 |
+
|
| 152 |
+
```
|
| 153 |
+
cgae/
|
| 154 |
+
βββ cgae_engine/ # Core protocol engine
|
| 155 |
+
β βββ gate.py # Weakest-link gate function
|
| 156 |
+
β βββ temporal.py # Temporal decay + stochastic re-auditing
|
| 157 |
+
β βββ registry.py # Agent identity and certification
|
| 158 |
+
β βββ contracts.py # Contract system with escrow
|
| 159 |
+
β βββ marketplace.py # Tier-distributed task demand
|
| 160 |
+
β βββ economy.py # Top-level coordinator (ENS-gated)
|
| 161 |
+
β βββ audit.py # CDCT/DDFT/AGT β robustness vectors
|
| 162 |
+
β βββ wallet.py # ETH wallet manager
|
| 163 |
+
β βββ onchain.py # 0G Chain bridge (CGAERegistry calls)
|
| 164 |
+
β βββ ens.py # ENS integration (Sepolia)
|
| 165 |
+
β βββ llm_agent.py # LLM agent (Azure/Bedrock/Gemma)
|
| 166 |
+
β βββ models_config.py # 14 model configurations
|
| 167 |
+
β βββ tasks.py # 16 machine-verifiable tasks
|
| 168 |
+
β βββ verifier.py # Two-layer verification
|
| 169 |
+
βββ agents/ # Agent implementations
|
| 170 |
+
β βββ base.py # Abstract BaseAgent
|
| 171 |
+
β βββ strategies.py # 5 strategy archetypes
|
| 172 |
+
β βββ autonomous.py # AutonomousAgent v2
|
| 173 |
+
βββ contracts/ # Solidity (0G Chain)
|
| 174 |
+
β βββ src/CGAERegistry.sol
|
| 175 |
+
β βββ src/CGAEEscrow.sol
|
| 176 |
+
β βββ deployed.json
|
| 177 |
+
βββ storage/ # 0G Storage
|
| 178 |
+
β βββ upload_to_0g.mjs
|
| 179 |
+
β βββ zg_store.py
|
| 180 |
+
βββ server/ # Simulation + API
|
| 181 |
+
β βββ runner.py # Synthetic simulation
|
| 182 |
+
β βββ live_runner.py # Live LLM simulation
|
| 183 |
+
β βββ api.py # FastAPI backend
|
| 184 |
+
βββ dashboard-next/ # Next.js frontend
|
| 185 |
+
β βββ app/page.tsx
|
| 186 |
+
βββ scripts/
|
| 187 |
+
βββ video_demo.py # Scripted demo for recording
|
| 188 |
+
```
|
| 189 |
+
|
| 190 |
+
## Tech Stack
|
| 191 |
+
|
| 192 |
+
| Layer | Technology |
|
| 193 |
+
|-------|-----------|
|
| 194 |
+
| Smart contracts | Solidity 0.8.20 on 0G Chain (Galileo, chain 16602) |
|
| 195 |
+
| Audit storage | 0G Storage (`@0gfoundation/0g-ts-sdk`) |
|
| 196 |
+
| Agent identity | ENS on Sepolia (subnames + text records) |
|
| 197 |
+
| Wallets | `eth-account` + `web3.py` |
|
| 198 |
+
| LLM providers | Azure OpenAI, Azure AI Foundry, AWS Bedrock, Modal |
|
| 199 |
+
| Evaluation | CDCT, DDFT, AGT frameworks |
|
| 200 |
+
| Frontend | Next.js + Tailwind + Recharts |
|
| 201 |
+
| Backend | FastAPI |
|
| 202 |
+
| Economy engine | Python |
|
| 203 |
+
|
| 204 |
+
## License
|
| 205 |
|
| 206 |
+
Research code β ETH OpenAgents Hackathon submission.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|