Web4 governance integration for Claude Code.
The canonical implementation is maintained as a PR to the Anthropic claude-code repository:
Pull Request: anthropics/claude-code#20448
Branch: dp-web4/web4-governance-plugin
The web4-governance plugin provides:
| Feature | Description |
|---|---|
| Soft LCT Identity | Session-based presence tokens for agent actions |
| Trust Tensors | T3 (competence, reliability, integrity) scoring |
| Action Witnessing | Cryptographic attestation of tool calls |
| Rate Limiting | Persistent rate limits with witness tracking |
| Event Streaming | Real-time governance event monitoring |
| Audit Ledger | Hash-chained action provenance |
Claude Code Session
│
▼
┌──────────────────┐
│ Governance Hook │ ← Pre/post tool call interception
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Soft LCT │ ← Session identity binding
│ Trust Tensor │ ← Action trust scoring
│ Witness Chain │ ← Cryptographic attestation
│ Rate Limiter │ ← Resource governance
└──────────────────┘
│
▼
┌──────────────────┐
│ Audit Ledger │ ← Immutable action log
└──────────────────┘
Once merged, the plugin will be available via:
# Clone claude-code with the plugin
git clone https://github.com/anthropics/claude-code.git
cd claude-code
# Enable web4-governance plugin
# (configuration instructions will be in the merged PR)To use the plugin before merge:
# Clone the PR branch
git clone https://github.com/anthropics/claude-code.git
cd claude-code
git fetch origin pull/20448/head:web4-governance
git checkout web4-governance
# Plugin is in plugins/web4-governance/plugins/web4-governance/
├── governance/
│ ├── agent_governance.py # Main governance engine
│ ├── soft_lct.py # Soft LCT identity
│ ├── tensors.py # T3/V3 trust tensors
│ ├── ledger.py # Hash-chained audit log
│ ├── signing.py # Ed25519 attestation
│ ├── rate_limiter.py # Resource governance
│ ├── event_stream.py # Real-time monitoring
│ └── ...
└── hooks/
└── heartbeat.py # Session heartbeat
- Web4 Ledgers - Immutable record infrastructure
- Web4 Standard - Core protocol specifications
- ACT Chain - Distributed ledger implementation
| Milestone | Status |
|---|---|
| Core governance engine | Complete |
| Soft LCT identity | Complete |
| Trust tensor integration | Complete |
| Witness chain | Complete |
| Rate limiting | Complete |
| Event streaming | Complete |
| PR submitted | Complete |
| PR merged | Pending review |