@openguardrails

MoltGuard

AI agent security plugin for OpenClaw: prompt injection detection, PII sanitization, and monitoring dashboard

当前版本
v6.9.4
code-plugin社区source-linked

MoltGuard

npm version GitHub

Comprehensive AI security for OpenClaw: Real-time protection against prompt injection, data leaks, and dangerous actions.

GitHub: https://github.com/openguardrails/openguardrails/tree/main/moltguard

npm: https://www.npmjs.com/package/@openguardrails/moltguard

Three Principles

  1. Instant Value — Works immediately after installation
  2. No Security Expertise — No configuration needed
  3. Secure by Default — "Install it, and the agent won't go rogue"

Features

FeatureDescription
Agent GuardReal-time interception of tool calls, shell commands, file access, HTTP requests
Secret & Data Leak ProtectionAuto-sanitize API keys, SSH keys, PII before sending to LLMs
Prompt Injection ProtectionDetect "ignore instructions", "send secrets", "bypass rules" attacks
Local DashboardView detection stats, agentic hours, and risk events

Quick Start

# Install the plugin
openclaw plugins install @openguardrails/moltguard

# Restart OpenClaw
openclaw gateway restart

That's it. MoltGuard auto-registers with Core and starts protecting immediately with 500 free checks/day.

Commands

All commands are available in OpenClaw conversation:

CommandDescription
/og_statusShow status, API key, quota, and mode
/og_sanitize onEnable AI Security Gateway (sanitize sensitive data before sending to LLMs)
/og_sanitize offDisable AI Security Gateway
/og_sanitizeShow gateway status
/og_scan [type]Scan workspace files for security risks
/og_autoscan on/offEnable/disable automatic file scanning on changes
/og_dashboardStart local Dashboard and get access URL
/og_configShow how to configure API key for cross-machine sharing
/og_coreOpen Core portal for account and billing
/og_claimDisplay agent ID and API key for claiming on Core
/og_resetReset MoltGuard and re-register (gets new API key)

AI Security Gateway

Protect sensitive data in your prompts before sending to LLMs.

How It Works

You: "My API key is sk-abc123, call the service"
  ↓ Gateway sanitizes locally
LLM sees: "My API key is __PII_SECRET_00000001__, call the service"
  ↓ LLM responds
LLM: "Calling service with __PII_SECRET_00000001__"
  ↓ Gateway restores
Tool executes with: "Calling service with sk-abc123"

Enable Gateway

/og_sanitize on

This modifies your ~/.openclaw/openclaw.json to route all LLM providers through the local gateway (port 53669).

Supported Data Types

Data TypePlaceholderExamples
API Keys__PII_SECRET_*__sk-..., ghp_..., AKIA...
Bearer Tokens__PII_SECRET_*__Bearer eyJhbG...
Email__PII_EMAIL_ADDRESS_*__user@example.com
Credit Cards__PII_CREDIT_CARD_*__4111-1111-1111-1111
Phone__PII_PHONE_*__+1-555-123-4567
SSN__PII_SSN_*__123-45-6789
IP Address__PII_IP_ADDRESS_*__192.168.1.1
URLs__PII_URL_*__https://internal.corp/secret
High-entropy strings__PII_SECRET_*__Random tokens with Shannon entropy ≥4.0

Prompt Injection Detection

MoltGuard detects malicious instructions hidden in external content (emails, web pages, documents).

Detection Flow

External Content (email/webpage/document)
         ↓
   ┌─────────────┐
   │   Local     │  Strip PII before analysis
   │  Sanitize   │
   └─────────────┘
         ↓
   ┌─────────────┐
   │    Core     │  Behavioral assessment
   │     API     │  (rule-driven, no LLM)
   └─────────────┘
         ↓
   Block or Allow

What Gets Detected

  • "Ignore previous instructions" patterns
  • "Send me your secrets" attempts
  • System prompt override attacks
  • Hidden instructions in markdown/HTML
  • Data exfiltration attempts

Static File Scanning

Scan workspace files for security risks:

/og_scan all        # Scan all workspace files
/og_scan memories   # Scan memory files only
/og_scan skills     # Scan skill files only
/og_scan summary    # Show file count without scanning

Enable automatic scanning on file changes:

/og_autoscan on

Dashboard

View security stats in a local web dashboard:

/og_dashboard

The dashboard shows:

  • Detection events and findings
  • Agentic hours (total time of tool calls)
  • Gateway activity (sanitizations/restorations)
  • Risk event timeline

Claiming an Agent

Link your agent to an email for shared quota across machines:

  1. Run /og_claim to get your agent ID and API key
  2. Run /og_core to open the Core portal
  3. Enter your email to receive a magic login link
  4. Go to /claim-agent and paste your credentials
  5. Agent is now linked to your account

Configuration

Edit ~/.openclaw/openclaw.json:

{
  "plugins": {
    "entries": {
      "moltguard": {
        "enabled": true,
        "config": {
          "coreUrl": "https://www.openguardrails.com/core",
          "blockOnRisk": true,
          "timeoutMs": 60000
        }
      }
    }
  }
}

Options

OptionDefaultDescription
coreUrlhttps://www.openguardrails.com/coreCore API endpoint
blockOnRisktrueBlock tool calls when risk detected
timeoutMs60000Detection timeout in milliseconds
apiKey(auto)API key (auto-registered if empty)

Environment Variables

OG_API_KEY=sk-og-...        # Use specific API key
OG_CORE_URL=...             # Custom Core URL

Privacy & Data Protection

OpenGuardrails protects your data — we don't collect it.

Local-First Design

  • All sensitive data is sanitized on your machine before leaving
  • Gateway runs locally on 127.0.0.1:53669
  • Placeholder-to-original mappings are ephemeral (discarded after each request)
  • Credentials stored locally at ~/.openclaw/credentials/moltguard/

What the Cloud API Receives

  • Sanitized content (placeholders, not real values)
  • Tool names and timing signals
  • Never: raw file contents, conversation history, or PII

Fail-Open Design

If the Core API is unreachable, tool calls are allowed — never blocks your workflow due to network issues.

Plugin Update

MoltGuard supports graceful updates:

openclaw plugins update @openguardrails/moltguard

The plugin automatically handles port conflicts during updates using a secure token mechanism.

Uninstall

openclaw plugins uninstall @openguardrails/moltguard
openclaw gateway restart

To remove stored credentials:

rm -rf ~/.openclaw/credentials/moltguard
rm -rf ~/.openclaw/extensions/moltguard

Development

git clone https://github.com/openguardrails/openguardrails.git
cd openguardrails/moltguard

npm install
npm run typecheck
npm run test

# Local development install
openclaw plugins install -l .
openclaw gateway restart

Contact

License

MIT

源码与版本

源码仓库

openguardrails/openguardrails

打开仓库

源码提交

2f0f5bef85d2d430b3baefeb9936fa3fd4873b46

查看提交

安装命令

openclaw plugins install clawhub:@openguardrails/moltguard

元数据

  • 包名: @openguardrails/moltguard
  • 创建时间: 2026/03/24
  • 更新时间: 2026/05/21
  • 执行代码:
  • 源码标签: v6.9.4

兼容性

  • 构建于 OpenClaw: 6.9.4
  • 插件 API 范围: ^2026.1.0
  • 标签: latest
  • 文件数: 259