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

@llnvd/openclaw-url-guard

v0.3.1

Published

OpenClaw plugin for URL allowlisting/blocklisting in web_fetch and web_search tools

Downloads

1,007

Readme

openclaw-url-guard

OpenClaw plugin that guards web tool access with hostname allowlist/blocklist policy.

⚠️ Disclaimer: This project is a proof of concept (PoC). It is provided "as is" without warranty of any kind. We make no guarantees about its security, reliability, or fitness for any particular purpose. Use at your own risk.

How It Works

This plugin uses OpenClaw's before_tool_call hook to intercept calls to web_fetch and web_search. When either tool is called:

  1. The plugin extracts the URL from the request
  2. Checks it against your configured allowlist/blocklist policy
  3. Optionally queries URLhaus threat feed
  4. Optionally applies trust scoring
  5. Blocks the call if the URL fails any check, or allows it to proceed

This approach is transparent to the LLM — it uses the standard web_fetch and web_search tools, but they're guarded by your policy.

Install

npm install @llnvd/openclaw-url-guard

Or from git:

git clone https://codeberg.org/llnvd/openclaw-url-guard.git
cd openclaw-url-guard
npm install
npm run build
openclaw plugins install .

Quick Start

Add to your OpenClaw config (~/.openclaw/openclaw.json):

{
  "plugins": {
    "entries": {
      "openclaw-url-guard": {
        "enabled": true,
        "config": {
          "mode": "allowlist",
          "allowlist": [
            "docs.python.org",
            "developer.mozilla.org",
            "en.wikipedia.org",
            "github.com",
            "stackoverflow.com",
            "*.stackexchange.com"
          ],
          "blockPrivateIps": true
        }
      }
    }
  }
}

Restart the gateway and the plugin will automatically guard all web_fetch and web_search calls.

Configuration

Modes

| Mode | Description | |------|-------------| | allowlist | Only URLs matching the allowlist are allowed (default) | | blocklist | All URLs allowed except those matching the blocklist | | hybrid | URL must be in allowlist AND not in blocklist |

Basic Options

{
  "mode": "allowlist",
  "allowlist": ["github.com", "*.githubusercontent.com"],
  "blocklist": ["evil.com"],
  "blockPrivateIps": true
}
  • allowlist/blocklist: Hostname patterns. Use *.domain.com for wildcard subdomains.
  • blockPrivateIps: Block requests to private/internal IPs (default: true)

Threat Feeds

Enable URLhaus threat feed lookups:

{
  "mode": "allowlist",
  "allowlist": ["*"],
  "threatFeeds": {
    "urlhaus": true,
    "mode": "fail-open"
  }
}
  • urlhaus: Enable URLhaus API lookups
  • mode: fail-open (allow on API failure) or fail-closed (block on API failure)

SSRF Protections

SSRF protections are enabled by default. Configure if needed:

{
  "ssrf": {
    "validateDns": true,
    "dnsTimeoutMs": 5000,
    "validateRedirects": true,
    "maxRedirects": 10,
    "allowProtocolDowngrade": false
  }
}
  • validateDns: Resolve hostnames and block if any IP is private/reserved
  • validateRedirects: Validate each redirect hop against policy + DNS
  • allowProtocolDowngrade: Allow HTTPS → HTTP redirects (not recommended)

Per-Workspace Policies

Different workspaces can have different URL policies. Workspace policies are restrictive-only — they can tighten but never loosen the global policy:

{
  "mode": "allowlist",
  "allowlist": ["github.com", "docs.python.org"],
  "blocklist": ["malware.com"],
  "workspaces": {
    "/home/user/fintech-project": {
      "allowlist": ["api.stripe.com"]
    },
    "/home/user/research": {
      "blocklist": ["competitor.com"]
    }
  }
}
  • Allowlist intersection — Workspace restricts global (only domains in BOTH allowed)
  • Blocklist union — Workspace extends global (domains in EITHER blocked)
  • Exact path matching — Policies apply to exact paths, not subdirectories
  • Mode inherited — Workspaces cannot change the global mode

See Configuration for details.

Trust Scoring

Optional scoring system for fine-grained control:

{
  "mode": "allowlist",
  "allowlist": ["*"],
  "scoring": {
    "enabled": true,
    "defaultScore": 0,
    "minScore": -6,
    "rules": [
      { "domain": "github.com", "score": 10, "reason": "highly trusted" },
      { "domain": "*.sketch.com", "score": -5, "reason": "known suspicious" }
    ]
  }
}

Score ranges:

  • +10 to +7: Trusted (skip threat feed checks)
  • +6 to +3: Preferred
  • +2 to -2: Neutral
  • -3 to -6: Suspicious
  • -7 to -10: Blocked

Note: Policy (allowlist/blocklist) is always enforced first. A blocked URL cannot bypass policy with a high score.

Security Defaults

  • Only http:// and https:// protocols accepted
  • Private/internal IP targets blocked by default
  • SSRF protections enabled by default:
    • DNS resolution validation (blocks hostnames resolving to private IPs)
    • Redirect chain validation (validates each hop, blocks protocol downgrades)
    • Hostname blocking (localhost, *.local)
  • URLhaus lookups timeout after 5 seconds
  • Invalid URLs are blocked
  • Policy is always enforced before scoring — blocked URLs cannot bypass policy with high scores

Logging

Enable verbose logging to see guard decisions:

{
  "logging": {
    "enabled": true,
    "logBlocked": true,
    "verboseErrors": true
  }
}

Development

npm install
npm run build
npm test

Run E2E tests:

npm run test:e2e

Documentation

License

MIT