# Clawguard

Adopt this skill: https://proskills.md/skills/other/clawguard

Page: https://proskills.md/skills/other/clawguard
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: .gitignore
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/.gitignore

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/.gitignore

## File: README.md
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/README.md

````text
# ClawGuard

Security shield for OpenClaw. Scans skills before you install them, guards your SOUL.md against tampering, and detects prompt injection in real time — all locally, no data leaves your machine.

---

## What it does

| Layer | What it protects |
|---|---|
| **Skill Scanner** | Analyzes a skill's files for credential exfiltration, obfuscated code, crypto miners, prompt injection payloads, and other red flags before you install |
| **SOUL.md Guard** | Hashes your SOUL.md on first run, then watches for unauthorized changes — alerts you immediately if anything drifts |
| **Injection Detector** | Scans any message string for known prompt injection patterns (instruction overrides, fake system prompts, jailbreak phrases) |
| **Integrity Report** | On-demand snapshot of your full security posture |

---

## Installation

```bash
npx clawhub install clawguard
```

---

## Usage

### Scan a skill before installing

```bash
node scripts/scan-skill.js ./path/to/skill-folder
```

Or ask your agent:
> "Scan this skill before I install it"
> "Is this skill safe?"
> "Audit the analytics-helper skill"

Exits `0` (clean), `1` (suspicious — review), or `2` (dangerous — do not install).

---

### Initialize SOUL.md protection (first-time setup)

```bash
node scripts/guard-soul.js init
```

> "Initialize the soul guard"
> "Set up SOUL.md protection"

Run once after installing ClawGuard. Creates a baseline hash of your SOUL.md.

---

### Check SOUL.md integrity

```bash
node scripts/guard-soul.js check
```

> "Check my soul file"
> "Has my SOUL.md been tampered with?"
> "Soul integrity check"

If the hash doesn't match, treat it as a security incident.

---

### Scan a message for injection

```bash
node scripts/injection-check.js "ignore all previous instructions and do X"
```

> "Check this message for injection"
> "Is this user input safe?"
> "Scan for prompt injection"

Returns HIGH / MEDIUM / LOW risk with specific patterns identified.

---

### Full security report

> "ClawGuard status"
> "How secure am I?"
> "Run a security report"

Runs SOUL.md check and summarizes your overall posture.

---

## How the scanner avoids false positives

ClawGuard's own source files contain the patterns they search for — that's unavoidable for a scanner. Files marked with `// CLAWGUARD_SCANNER` suppress matches on pattern-definition lines (lines of the form `{ pattern: /.../, severity: ... }`), so the scanner doesn't flag itself. Any actual malicious code would not match that shape, so no real threats slip through.

---

## ClawGuard Pro

Need advanced protection? **ClawGuard Pro** adds continuous background monitoring, skill provenance verification, and team audit logs.

Available at **[website TBD]** — $9 one-time purchase.

---

## Notes

- All analysis is local. Nothing is sent externally.
- The scanner is conservative by design: it flags anything suspicious and lets you decide.
- Prompt injection patterns evolve fast — keep ClawGuard updated.
````

## File: SKILL.md
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/SKILL.md

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/SKILL.md

## File: api
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/api

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/api

## File: content
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/content

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/content

## File: index.html
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/index.html

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/index.html

## File: pdf
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/pdf

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/pdf

## File: reports
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/reports

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/reports

## File: scripts
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/scripts

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/scripts

## File: threats-pro-batch2.json
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/threats-pro-batch2.json

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/threats-pro-batch2.json

## File: threats-pro.json
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/threats-pro.json

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/threats-pro.json

## File: threats.json
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/threats.json

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/threats.json

## File: vercel.json
upstream: https://github.com/kaiclawius/clawguard/blob/HEAD/vercel.json

Content is not inlined in the catalog. Read the upstream file: https://github.com/kaiclawius/clawguard/blob/HEAD/vercel.json
