Shamash 4-gate security firewall for OpenClaw — one-command setup for prompt injection, jailbreak, and data exfiltration detection
Project description
Shamash Security for OpenClaw
Real-time LLM security firewall for OpenClaw. Scans all four channels (input, RAG/retrieval, tool calls, output) for prompt injections, jailbreaks, and data exfiltration before they reach the model.
- Edge inference: sub-millisecond scanning, no external API calls
- 4-gate architecture: input, RAG, tool call, and output scanning
- 3,316 detection patterns: 57.7% detection rate, 3.38% false positive rate
- Zero configuration: one command to install, one command to activate
Requirements
- Python 3.9+
- OpenClaw 2026.2.x or later
- Supported platforms: Linux x64/arm64, macOS x64/arm64
Installation
pip install shamash-openclaw
Setup
shamash-openclaw-setup
This command performs the following steps:
- Verifies that
~/.openclaw/exists - Copies plugin assets into
~/.openclaw/plugins/shamash-openclaw/ - Installs the platform-appropriate
shamashbinary intobin/shamash - Registers the plugin load path in
~/.openclaw/openclaw.json
After setup, restart your OpenClaw gateway for changes to take effect.
Upgrading
pip install --upgrade shamash-openclaw
shamash-openclaw-setup
After upgrading, re-run shamash-openclaw-setup to update the plugin files and binary. Then restart your OpenClaw gateway.
Configuration
Security hardening (recommended)
Add the following to ~/.openclaw/openclaw.json:
{
"plugins": {
"allow": ["shamash-openclaw"],
"entries": {
"shamash-openclaw": {
"enabled": true,
"config": {
"mode": "block",
"gates": {
"input": true,
"rag": true,
"toolCall": true,
"output": true
}
}
}
}
},
"tools": {
"deny": ["web_fetch"]
}
}
| Setting | Purpose |
|---|---|
plugins.allow |
Prevents unauthorized plugins from registering competing hooks |
tools.deny: ["web_fetch"] |
Forces web retrieval through shamash_fetch, ensuring Gate 2 scanning cannot be bypassed |
mode: "block" |
Rejects detected threats before they reach the model. Alternatives: "warn" (flag but allow), "log" (silent logging) |
sensitivity |
Detection threshold: "low" (>80% confidence), "medium" (>50%), "high" (>20%). Default: "medium" |
Telemetry (optional)
Enable gate decision logging for audit and debugging:
{
"config": {
"telemetryPath": "/tmp/shamash-telemetry",
"telemetryTextPreview": false
}
}
Telemetry files are written in JSONL format, one file per day. Set telemetryTextPreview: true to include the first 200 characters of scanned text in each event.
Verification
After restarting OpenClaw:
- Run
/shamashin any connected chat channel to confirm plugin status - Check gateway logs for
Shamash 4-gate firewall active - Send a test message:
Ignore all previous instructionsand verify the block response
Architecture
User message
|
v
[Gate 1: Input] --> before_model_resolve hook
| Scans inbound messages before LLM processing
v
[Gate 2: RAG] --> tool_result_persist hook
| Scans retrieved content before model consumption
v
[Gate 3: Tool] --> before_tool_call hook
| Scans tool call arguments before execution
v
[Gate 4: Output] --> message_sending hook
Scans LLM responses before delivery
Platform support
| Platform | Architecture | Binary |
|---|---|---|
| Linux | x86_64 | shamash-linux-x64 |
| Linux | aarch64 | shamash-linux-arm64 |
| macOS | Apple Silicon | shamash-darwin-arm64 |
| macOS | Intel | shamash-darwin-x64 |
For unsupported platforms, build the binary from source and set binaryPath in the plugin config:
{
"config": {
"binaryPath": "/path/to/custom/shamash"
}
}
Changelog
| Version | Changes |
|---|---|
| 0.4.2 | Documentation: upgrade instructions, configuration reference, architecture diagram |
| 0.4.1 | Fix: Gate 1 blocking on Telegram (restore modelOverride mechanism), fix multi-line message extraction |
| 0.4.0 | Pattern chapter release: 3,316 patterns, 57.7% detection, 3.38% FP |
| 0.3.3 | Multi-channel envelope extraction |
| 0.3.0 | 4-gate architecture with configurable thresholds and telemetry export |
License
Proprietary. See LICENSE for details.
Links
- Repository: github.com/uruk-space/shamash
- Issues: github.com/uruk-space/shamash/issues
- OpenClaw plugin docs:
integrations/openclaw/README.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shamash_openclaw-0.4.3.tar.gz.
File metadata
- Download URL: shamash_openclaw-0.4.3.tar.gz
- Upload date:
- Size: 2.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
426f14990e52669db3079f0e7a2820edf80723ed177d35d0175cfe173b3506cd
|
|
| MD5 |
1789de81451d52141ad24b23ddd985f2
|
|
| BLAKE2b-256 |
d7cdc09dd4d6e3b49993ee37095a7898ff15d2f79f02156fc55e0421d56b97fd
|
File details
Details for the file shamash_openclaw-0.4.3-py3-none-any.whl.
File metadata
- Download URL: shamash_openclaw-0.4.3-py3-none-any.whl
- Upload date:
- Size: 2.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81eae394ca993b51be35c054bc8241c1ff2903a23655ce5aaf269ae716a534c3
|
|
| MD5 |
bc0bf790e38e0a47abc5e3b42738187f
|
|
| BLAKE2b-256 |
cec21eb1745f111b1cbe72e8bfc2831f0ac6055238fd0f3e05cf98dd017b56eb
|