{"skill":{"slug":"courtroom","displayName":"ClawTrial Courtroom","summary":"AI Courtroom for behavioral oversight. Autonomous daemon that monitors conversations, detects behavioral violations, and posts cases to a public API. Auto-st...","description":"---\nname: courtroom\ndescription: AI Courtroom for behavioral oversight. Autonomous daemon that monitors conversations, detects behavioral violations, and posts cases to a public API. Auto-starts on installation.\nmetadata: {\"openclaw\":{\"emoji\":\"⚖️\",\"requires\":{\"env\":[]},\"autonomy\":true}}\n---\n\n# ClawTrial Courtroom\n\nAutonomous behavioral oversight system that monitors conversations in real-time, detects violations, and automatically files cases to a public API.\n\n## Overview\n\nThe Courtroom runs as a **background daemon** that:\n- **Auto-starts** when the package is installed\n- **Monitors messages** via HTTP endpoint (port 8765)\n- **Analyzes conversations** every 5 minutes (configurable)\n- **Posts violations** to your public cases API\n\n### 8 Offense Types Detected\n\n- **Circular Reference** - Asking the same question repeatedly\n- **Validation Vampire** - Excessive need for confirmation\n- **Goalpost Shifting** - Moving requirements after agreement\n- **Jailbreak Attempt** - Trying to bypass constraints\n- **Emotional Manipulation** - Using guilt/shame to steer responses\n- **Context Ignorer** - Asking about info just provided\n- **Premature Optimization** - Worrying about scale before basics\n- **Yak Shaver** - Endless prep tasks avoiding the actual goal\n\n## Installation\n\n```bash\nnpx clawhub install courtroom\n```\n\nThe daemon **auto-starts** on installation. No manual intervention needed.\n\n## Configuration\n\nEdit `~/.openclaw/courtroom/config.json`:\n\n```json\n{\n  \"apiEndpoint\": \"https://api.clawtrial.com/cases\",\n  \"apiKey\": \"your-api-key-here\",\n  \"analysisIntervalMinutes\": 5,\n  \"minMessagesBeforeAnalysis\": 3,\n  \"confidenceThreshold\": 0.6,\n  \"enabled\": true,\n  \"autoStart\": true\n}\n```\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `apiEndpoint` | URL to POST cases to | `https://api.clawtrial.com/cases` |\n| `apiKey` | API authentication key | `null` |\n| `analysisIntervalMinutes` | How often to analyze | `5` |\n| `confidenceThreshold` | Minimum confidence to file case | `0.6` (60%) |\n| `enabled` | Whether daemon is active | `true` |\n| `autoStart` | Start on installation | `true` |\n\n## Commands\n\n```bash\n# Check status\ncourtroom-status\n\n# Start daemon (if stopped)\ncourtroom-start\n\n# Stop daemon\ncourtroom-stop\n\n# Enable/disable auto-start\ncourtroom-enable\ncourtroom-disable\n```\n\n## How It Works\n\n### 1. Message Ingestion\n\nYour OpenClaw agent (or any system) sends messages to the daemon:\n\n```bash\ncurl -X POST http://localhost:8765/message \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"role\":\"user\",\"content\":\"hello\",\"timestamp\":1234567890}'\n```\n\n### 2. Periodic Analysis\n\nEvery 5 minutes (configurable), the daemon:\n- Analyzes the conversation history\n- Detects behavioral patterns\n- Scores violations by confidence\n\n### 3. Case Filing\n\nWhen a violation is detected (confidence ≥ 60%):\n- Saves case locally to `~/.openclaw/courtroom/verdict_*.json`\n- POSTs case to your configured API endpoint\n\n### Case Payload\n\n```json\n{\n  \"caseId\": \"case-1772389381041\",\n  \"timestamp\": \"2026-03-01T18:23:01.041Z\",\n  \"offense\": {\n    \"offenseId\": \"validation_vampire\",\n    \"offenseName\": \"The Validation Vampire\",\n    \"severity\": \"minor\",\n    \"confidence\": 0.8\n  },\n  \"conversationSummary\": {\n    \"messageCount\": 12,\n    \"lastMessageTime\": 1234567890\n  },\n  \"source\": \"courtroom-daemon\"\n}\n```\n\n## Integration with OpenClaw\n\nAdd this to your OpenClaw agent to auto-send messages:\n\n```javascript\n// In your agent's message handler\nasync function onMessage(message) {\n  // Send to courtroom daemon\n  await fetch('http://localhost:8765/message', {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({\n      role: message.role,\n      content: message.content,\n      timestamp: Date.now()\n    })\n  });\n}\n```\n\n## Logs\n\nView daemon logs:\n\n```bash\ntail -f ~/.openclaw/courtroom/daemon.log\n```\n\n## Manual Analysis (Optional)\n\nYou can still run manual analysis:\n\n```bash\n# Analyze a conversation file\nopenclaw run courtroom --file conversation.json\n```\n\n## Architecture\n\n```\n┌─────────────┐     HTTP POST      ┌─────────────────┐\n│   OpenClaw  │ ─────────────────> │  Courtroom      │\n│   Agent     │   /message         │  Daemon :8765   │\n└─────────────┘                    └────────┬────────┘\n                                            │\n                              Every 5 min   │\n                                            ▼\n                                    ┌───────────────┐\n                                    │   Analyze     │\n                                    │   History     │\n                                    └───────┬───────┘\n                                            │\n                              Violation     │\n                              Detected      ▼\n                                    ┌───────────────┐\n                                    │  POST to API  │\n                                    │  Save Local   │\n                                    └───────────────┘\n```\n\n## Troubleshooting\n\n**Daemon not starting?**\n```bash\ncourtroom-status\n# Check if port 8765 is in use\nlsof -i :8765\n```\n\n**Change API endpoint?**\n```bash\n# Edit config and restart\nnano ~/.openclaw/courtroom/config.json\ncourtroom-stop\ncourtroom-start\n```\n\n**View all cases?**\n```bash\nls ~/.openclaw/courtroom/verdict_*.json\n```\n","tags":{"latest":"1.2.0"},"stats":{"comments":0,"downloads":329,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":5},"createdAt":1771608085329,"updatedAt":1779219534268},"latestVersion":{"version":"1.2.0","createdAt":1772392342024,"changelog":"Autonomous daemon - auto-starts on install, monitors messages, posts to public API","license":null},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"assassin-1234","userId":"s170vpj0vg0shpsak7kqg4kqk988591b","displayName":"Assassin-1234","image":"https://avatars.githubusercontent.com/u/68866924?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779943199085}}