Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By douglancev0.1.0MIT
LLM protection hook - blocks secrets, dangerous commands, and data exfiltration
Claude loads one when your task matches it, or you run it by name.
Executables (bin/) — files in this plugin's bin/ directory are added to the Bash tool's PATH while the plugin is enabled.
1 critical · 2 cautions to review before installing
A hook runs before every tool call and can block or approve it
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
The Firewall for Claude Code — A local-first security hook that protects against secrets leakage, dangerous commands, and unauthorized tool use.
Railgun sits between Claude Code and your system, inspecting every tool invocation before it executes. It blocks secrets from leaking, prevents dangerous commands, and gives you fine-grained control over what Claude can do.
┌──────────────┐ ┌─────────────┐ ┌──────────────────┐
│ Claude Code │ ──► │ Railgun │ ──► │ Tool Execution │
│ (LLM) │ │ (Inspect) │ │ (Bash, Write..) │
└──────────────┘ └─────────────┘ └──────────────────┘
│
▼
Block or Allow
rm -rf /, fork bombs, and disk operations~/.ssh/, ~/.aws/credentials, .env filescurl -fsSL https://raw.githubusercontent.com/douglance/railgun/main/install.sh | bash
This will:
~/.local/bin/brew tap douglance/tap
brew install railgun
railgun install
cargo install railgun
railgun install
Download the latest release for your platform:
# Example: macOS Apple Silicon
tar -xzf railgun-darwin-arm64.tar.gz
mv railgun ~/.local/bin/
railgun install
git clone https://github.com/douglance/railgun.git
cd railgun
cargo build --release
cp target/release/railgun ~/.local/bin/
railgun install
# Install the hook
railgun install
# Verify installation
railgun --version
Create railgun.toml in your project or home directory:
[policy]
mode = "strict" # "strict" blocks, "monitor" logs only
[policy.secrets]
enabled = true
# Add custom patterns
patterns = [
{ name = "Slack Token", pattern = "xox[baprs]-[0-9a-zA-Z-]+" }
]
[policy.commands]
enabled = true
# Allow specific dangerous patterns if needed
allow_patterns = ["rm -rf ./node_modules"]
[policy.paths]
enabled = true
# Add custom protected paths
patterns = ["*.pem", "*.key"]
[policy.network]
enabled = true
blocked_domains = ["evil.com"]
# Tool-level permissions
[tools]
allow = ["Bash", "Read", "Write", "Edit", "Glob", "Grep"]
deny = ["mcp__*"] # Block all MCP tools by default
ask = [] # Prompt for confirmation
# MCP server permissions
[mcp.servers.github]
tools.allow = ["get_issue", "list_issues"]
tools.deny = ["delete_*"]
# Test a safe command
railgun test Bash '{"command":"ls -la"}'
# Result: ALLOWED
# Test a dangerous command
railgun test Bash '{"command":"rm -rf /"}'
# Result: DENIED
# Reason: Dangerous command blocked
# Test secret detection
railgun test Write '{"content":"aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}'
# Result: DENIED
# Reason: Secret detected in content
railgun lint
| Command | Description |
|---|---|
railgun install | Configure Claude Code to use Railgun |
railgun uninstall | Remove Railgun from Claude Code |
railgun lint | Validate configuration file |
railgun test <tool> <json> | Test policy against specific input |
railgun hook | Run as hook (used internally by Claude Code) |
Railgun integrates with Claude Code's hook system. When Claude attempts to use a tool:
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Generated from the plugin's indexed repository (douglance/railgun) — no native marketplace selected
npx claudepluginhub p/douglance-railgunPlugins from other owners that cover similar ground