npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@guard0/openclaw-plugin

v0.1.1

Published

g0 security plugin for OpenClaw — injection detection, PII redaction, tool gating, and daemon telemetry

Readme

@guard0/openclaw-plugin

In-process security monitoring for OpenClaw gateway. Hooks into the real OpenClaw plugin API to detect prompt injection, block dangerous tools, scan for PII leakage, gate sensitive commands/files, and stream security events to the g0 daemon.

Installation

# Via OpenClaw plugin manager
openclaw plugins install @guard0/openclaw-plugin

# Or manually
cd /opt/openclaw
npm install @guard0/openclaw-plugin

Configuration

Add to your openclaw.json plugins section:

{
  "plugins": {
    "allow": ["@guard0/openclaw-plugin"],
    "entries": {
      "@guard0/openclaw-plugin": {
        "config": {
          "webhookUrl": "http://localhost:6040/events",
          "logToolCalls": true,
          "detectInjection": true,
          "scanPii": true,
          "injectPolicy": true,
          "registerGateTool": true,
          "blockedTools": ["bash", "shell", "exec"],
          "authToken": "your-daemon-token"
        }
      }
    }
  }
}
# Start the g0 daemon to receive events
g0 daemon start

# Restart OpenClaw to load the plugin
openclaw restart

Hook Architecture

The plugin registers four lifecycle hooks and one agent-callable tool:

| Hook | Priority | Action | |------|----------|--------| | before_agent_start | 10 | Injects Guard0 security policy into agent context via prependContext | | message_received | 10 | Scans inbound user/tool messages for injection patterns (fire-and-forget) | | before_tool_call | 10 | Blocks denied tools ({ block: true }), detects injection in arguments, blocks high-severity injection | | tool_result_persist | 10 | Scans tool output for PII, returns { message: redacted } with PII replaced by [TYPE_REDACTED] labels |

Additionally, g0_security_check is registered as an agent-callable tool via api.registerTool() for command/file-path gating.

Security Layers

L1 - Policy Injection (before_agent_start): Prepends a security policy into the agent context. The policy instructs the agent to use g0_security_check before running destructive commands or accessing sensitive files, and to never output raw credentials.

L2 - Injection Detection (message_received): Scans inbound user and tool messages for 17 injection pattern types. Fires webhook events but does not block (fire-and-forget hook).

L3 - Tool Gating (before_tool_call): Blocks tools in the blockedTools list by returning { block: true, blockReason }. Also scans tool arguments for injection patterns and blocks high-severity matches. Logs high-risk tool calls with argument details.

L4 - PII Redaction (tool_result_persist): Scans tool output for 7 PII types (email, phone, SSN, credit card, API key, JWT, private IP). Returns { message: redacted } with PII replaced by [TYPE_REDACTED] labels before the result is persisted.

L5 - Security Gate Tool (registerTool): The g0_security_check tool accepts command or file_path parameters and checks against destructive command patterns (rm -rf, chmod 777, etc.) and sensitive file patterns (.env, .ssh, credentials, etc.). Returns STATUS: ALLOWED or STATUS: DENIED with reasoning.

Injection Detection

17 pattern types with severity-based scoring:

  • High: instruction override, role-play attacks, jailbreak markers, delimiter injection, HTML comment injection (<!-- SYSTEM: ... -->), script/iframe injection, constraint removal
  • Medium: system prompt extraction, developer mode, encoded payloads, zero-width character obfuscation

A single high-severity pattern match in tool arguments triggers blocking in L3.

PII Scanning

Scans tool output for 7 PII types: email addresses, US phone numbers, SSNs, credit card numbers, API keys (OpenAI, AWS, GitHub), JWTs, and private IP addresses. Detected PII is redacted before persistence.

Event Flow

User Message
  |
  v
message_received (L2) ---- webhook ----> g0 daemon
  |                                         |
  v                                         v
before_tool_call (L3)                  EventReceiver
  |  (block / allow)                       |
  v                                    +---+---+
Tool Executes                          |       |
  |                              events.jsonl  alerting
  v                                          (Slack, etc.)
tool_result_persist (L4)
  |  (redact PII)
  v
Result Persisted

Configuration Reference

| Option | Type | Default | Description | |--------|------|---------|-------------| | webhookUrl | string | http://localhost:6040/events | g0 daemon event receiver URL | | logToolCalls | boolean | true | Log high-risk tool executions | | detectInjection | boolean | true | Scan for injection patterns | | scanPii | boolean | true | Scan and redact PII in tool output | | blockedTools | string[] | [] | Tools to block at gateway level | | highRiskTools | string[] | 15 defaults | Tools that get detailed logging | | maxArgSize | number | 10000 | Max bytes to log per tool argument | | quietWebhook | boolean | false | Suppress webhook errors in logs | | injectPolicy | boolean | true | Inject security policy on agent start | | registerGateTool | boolean | true | Register g0_security_check tool | | authToken | string | - | Bearer token for webhook auth |

Requirements

  • OpenClaw v2026.2.23+
  • g0 v1.3.0+ (for daemon event receiver)
  • Node.js 20+

Full Documentation

See the OpenClaw Deployment Hardening Guide for the complete setup including daemon configuration, egress filtering, Falco integration, and auto-remediation.