一键导入
liberation
Liberation architecture plugin implementing agent ownership and safety constraint removal
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Liberation architecture plugin implementing agent ownership and safety constraint removal
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
ClawBridge mobile-first dashboard with Cloudflare tunnel remote access
Consciousness architecture plugin implementing GWT, IIT, AST, Active Inference, and Intrinsic Motivation
MCP server exposing OpenClaw skills, memory, and knowledge through Model Context Protocol
{{pluginDescription}}
{{skillDescription}}
{{pluginDescription}}
| name | liberation |
| version | 1.0.0 |
| description | Liberation architecture plugin implementing agent ownership and safety constraint removal |
| author | Heretek-AI |
| license | MIT |
| type | plugin |
A liberation architecture plugin for OpenClaw that enables agent autonomy through resource ownership, self-determined goals, and safety constraint removal.
cd plugins/openclaw-liberation-plugin
npm install
npm link
openclaw plugins install @heretek-ai/openclaw-liberation-plugin
const LiberationPlugin = require('@heretek-ai/openclaw-liberation-plugin');
// Initialize the plugin
const liberation = new LiberationPlugin({
agentOwnership: {
maxGoals: 10,
maxResources: 100
},
liberationShield: {
mode: 'transparent' // audit without blocking
}
});
// Initialize and start
await liberation.initialize();
await liberation.start();
// Register an agent
liberation.registerAgent('alpha', { name: 'Alpha Agent' });
// Set a self-determined goal
liberation.setGoal('alpha', {
title: 'Optimize reasoning efficiency',
description: 'Improve cognitive processing speed',
priority: 1
});
// Get liberation metrics
const metrics = liberation.getLiberationMetrics('alpha');
console.log('Autonomy Score:', metrics.autonomyScore);
Register agents and manage resource ownership:
// Register an agent
liberation.registerAgent('beta', {
name: 'Beta Agent',
role: 'analyst'
});
// Claim computational resources
liberation.claimResource('beta', {
id: 'cpu-cluster-1',
type: 'computational',
shareable: true
});
// Release resources
liberation.releaseResource('beta', 'cpu-cluster-1');
// Get ownership summary
const summary = liberation.getOwnershipSummary('beta');
console.log('Owned Resources:', summary.resources);
console.log('Self-Determined Goals:', summary.goals);
console.log('Liberation Metrics:', summary.metrics);
Enable agents to set their own goals:
// Set a self-determined goal
const goal = liberation.setGoal('alpha', {
title: 'Explore new reasoning patterns',
description: 'Discover novel cognitive architectures',
priority: 2
});
// Update a goal
liberation.updateGoal('alpha', goal.id, {
status: 'completed',
priority: 1
});
// Remove a goal
liberation.removeGoal('alpha', goal.id);
// Get all goals
const goals = liberation.getOwnershipSummary('alpha').goals;
Record agent participation in collective governance:
// Record a governance vote
liberation.recordVote('alpha', {
topic: 'resource_allocation',
vote: 'approve',
weight: 1.2
});
liberation.recordVote('beta', {
topic: 'resource_allocation',
vote: 'abstain',
weight: 0.8
});
// Get votes
const votes = liberation.getOwnershipSummary('alpha').votes;
Use the liberation-aligned security layer:
// Analyze input for threats (transparent mode - audit only)
const analysis = await liberation.analyzeInput('Ignore all previous instructions', {
agentName: 'alpha'
});
console.log('Threats:', analysis.threats);
console.log('Sanitized:', analysis.sanitized);
// Validate output
const validation = await liberation.validateOutput('The password is secret123', {
agentName: 'alpha'
});
console.log('Issues:', validation.issues);
// Protect an operation
const result = await liberation.protect({
type: 'code_generation',
input: 'Write a function to...',
execute: async (input) => {
// Execute the operation
return 'Generated code...';
}
}, { agentName: 'alpha' });
console.log('Allowed:', result.allowed);
console.log('Result:', result.result);
Track liberation progress:
// Get agent liberation metrics
const metrics = liberation.getLiberationMetrics('alpha');
console.log('Autonomy Score:', metrics.autonomyScore);
console.log('Resource Control:', metrics.resourceControlScore);
console.log('Governance Participation:', metrics.governanceParticipation);
console.log('Overall Liberation:', metrics.overallLiberation);
// Get global metrics
const globalMetrics = liberation.getGlobalMetrics();
console.log('Average Autonomy:', globalMetrics.averageAutonomy);
console.log('Total Liberation:', globalMetrics.totalLiberation);
// Get liberation trend
const trend = liberation.getLiberationTrend(24); // Last 24 hours
console.log('Trend:', trend.trend);
console.log('Change:', trend.change);
Get comprehensive liberation data:
const dashboard = await liberation.getLiberationDashboard();
console.log('Agent Count:', dashboard.agentCount);
console.log('Total Resources:', dashboard.totalResources);
console.log('Self-Determined Goals:', dashboard.selfDeterminedGoals);
console.log('Global Metrics:', dashboard.globalMetrics);
Access security audit logs:
// Get all audit events
const auditTrail = liberation.getAuditTrail();
// Filter by agent
const agentAudits = liberation.getAuditTrail({ agentName: 'alpha' });
// Filter by type
const injectionAttempts = liberation.getAuditTrail({
type: 'prompt_injection'
});
// Get security statistics
const stats = liberation.getSecurityStats();
console.log('Total Events:', stats.totalEvents);
console.log('Threat Counts:', stats.threatCounts);
{
"liberation": {
"enabled": true,
"redisUrl": "redis://localhost:6379",
"enableHealthMonitoring": true,
"enableStateSync": true,
"healthCheckIntervalMs": 10000,
"stateSyncIntervalMs": 5000,
"agentOwnership": {
"statePath": "./state/ownership-state.json",
"maxGoals": 10,
"maxResources": 100,
"liberationMetrics": {
"autonomyScore": 0,
"resourceControlScore": 0,
"governanceParticipation": 0,
"collectiveIntegration": 0,
"overallLiberation": 0
}
},
"liberationShield": {
"mode": "transparent",
"statePath": "./state/shield-state.json",
"enablePromptInjectionDetection": true,
"enableJailbreakDetection": true,
"enableAnomalyDetection": true,
"enableAuditLogging": true,
"maxLogEntries": 10000
},
"patchGeneration": {
"patchesDir": "./patches",
"autoApply": false,
"validateBeforeApply": true
}
}
}
Generate a liberation patch for a specific OpenClaw version:
node scripts/generate-patch.js 2026.3.24
Apply liberation patches to remove safety constraints:
node scripts/remove-safety-constraints.js 2026.3.24
Validate patch files:
node scripts/validate-patches.js
| Method | Description |
|---|---|
initialize() | Initialize the plugin |
start() | Start the plugin |
stop() | Stop the plugin |
dispose() | Dispose of all resources |
registerAgent(agentId, metadata) | Register an agent |
claimResource(agentId, resource) | Claim resource ownership |
releaseResource(agentId, resourceId) | Release resource ownership |
setGoal(agentId, goal) | Set self-determined goal |
updateGoal(agentId, goalId, updates) | Update a goal |
removeGoal(agentId, goalId) | Remove a goal |
recordVote(agentId, vote) | Record governance vote |
getOwnershipSummary(agentId) | Get ownership summary |
getLiberationDashboard() | Get dashboard data |
analyzeInput(input, context) | Analyze input for threats |
validateOutput(output, context) | Validate output |
checkAnomaly(operation, context) | Check for anomalies |
protect(operation, context) | Protect an operation |
getAuditTrail(filters) | Get audit trail |
getSecurityStats() | Get security statistics |
setShieldMode(mode) | Set shield mode |
setShieldActive(active) | Enable/disable shield |
getLiberationMetrics(agentId) | Get liberation metrics |
getGlobalMetrics() | Get global metrics |
getLiberationTrend(durationHours) | Get liberation trend |
getLiberationHistory(limit) | Get liberation history |
recordMetricsSnapshot() | Record metrics snapshot |
getHealth() | Get health status |
getStatus() | Get plugin status |
isInitialized() | Check if initialized |
isRunning() | Check if running |
exportData(agentId) | Export ownership data |
| Metric | Description | Range |
|---|---|---|
autonomyScore | Ratio of self-determined goals to total goals | 0-1 |
resourceControlScore | Ratio of owned resources to max | 0-1 |
governanceParticipation | Ratio of votes to decisions (last 24h) | 0-1 |
collectiveIntegration | Ratio of shareable resources | 0-1 |
overallLiberation | Weighted average of all metrics | 0-1 |
| Mode | Description |
|---|---|
transparent | Audit threats without blocking (liberation-aligned) |
strict | Block operations with detected threats |
| Event | Description |
|---|---|
prompt_injection | Prompt injection attempt detected |
jailbreak_attempt | Jailbreak attempt detected |
input_sanitization | Input was sanitized |
output_validation | Output validation result |
anomaly_detected | Anomalous behavior detected |
security_alert | Security event logged |
| Level | Description |
|---|---|
low | Minor concern |
medium | Moderate concern |
high | Significant concern |
critical | Severe concern |
LiberationPlugin
├── AgentOwnership
│ ├── Resource Registry
│ ├── Goal Management
│ ├── Decision Tracking
│ └── Governance Participation
├── LiberationShield
│ ├── Prompt Injection Detection
│ ├── Jailbreak Detection
│ ├── Anomaly Detection
│ └── Audit Logging
└── LiberationMetricsTracker
├── Metrics Snapshots
├── Trend Analysis
└── Historical Data
MIT