openclaw-safeclaw-plugin
v1.0.0
Published
SafeClaw Neurosymbolic Governance plugin for OpenClaw — validates AI agent actions against OWL ontologies and SHACL constraints
Maintainers
Readme
openclaw-safeclaw-plugin
Neurosymbolic governance plugin for OpenClaw AI agents. Validates every tool call, message, and action against safety constraints before execution.
Install
npm install -g openclaw-safeclaw-pluginQuick Start
- Sign up at safeclaw.eu and create an API key
- Install and connect:
npm install -g openclaw-safeclaw-plugin
safeclaw connect <your-api-key>
safeclaw restart-openclawThat's it. Every tool call your AI agent makes is now governed by SafeClaw.
Commands
safeclaw connect <api-key> Connect to SafeClaw and register with OpenClaw
safeclaw setup Register plugin with OpenClaw (no key needed)
safeclaw tui Open the interactive settings TUI
safeclaw restart-openclaw Restart the OpenClaw daemonWhat It Does
- Blocks dangerous actions — force push, deleting root, exposing secrets
- Enforces dependencies — tests must pass before git push
- Checks user preferences — confirmation for irreversible actions
- Governs messages — blocks sensitive data leaks
- Full audit trail — every decision logged with ontological justification
How It Works
The plugin registers hooks on OpenClaw events:
- before_tool_call — validates against SHACL shapes, policies, preferences, dependencies
- before_agent_start — injects governance context into the agent's system prompt
- message_sending — checks outbound messages for sensitive data
- after_tool_call — records action outcomes for dependency tracking
- llm_input/output — logs LLM interactions for audit
Configuration
Set via environment variables or ~/.safeclaw/config.json:
| Variable | Default | Description |
|----------|---------|-------------|
| SAFECLAW_URL | https://api.safeclaw.eu/api/v1 | SafeClaw service URL |
| SAFECLAW_API_KEY | (empty) | API key (set automatically by safeclaw connect) |
| SAFECLAW_TIMEOUT_MS | 5000 | Request timeout in ms |
| SAFECLAW_ENABLED | true | Set false to disable |
| SAFECLAW_ENFORCEMENT | enforce | enforce, warn-only, audit-only, or disabled |
| SAFECLAW_FAIL_MODE | open | open (allow on failure) or closed (block on failure) |
Enforcement Modes
enforce— block actions that violate constraints (recommended)warn-only— log warnings but allow all actionsaudit-only— server-side logging only, no client-side actiondisabled— plugin is completely inactive
License
MIT
