-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
hermes plugins install scross01/hermes-custom-dangerous-patterns-plugin
hermes plugins enable custom-dangerous-patternsThe install command clones the repo into ~/.hermes/plugins/custom-dangerous-patterns/
and prompts to enable it. Use --enable to skip the prompt:
hermes plugins install scross01/hermes-custom-dangerous-patterns-plugin --enablehermes plugins update custom-dangerous-patternsThen restart Hermes for the changes to take effect.
git clone https://github.com/scross01/hermes-custom-dangerous-patterns-plugin.git \
~/.hermes/plugins/custom-dangerous-patternsOr if you already have the source elsewhere:
ln -s /path/to/hermes-custom-dangerous-patterns-plugin \
~/.hermes/plugins/custom-dangerous-patternsImportant: The directory inside ~/.hermes/plugins/ must be named custom-dangerous-patterns
(with the trailing s).
Then enable:
hermes plugins enable custom-dangerous-patternscp ~/.hermes/plugins/custom-dangerous-patterns/examples/custom-dangerous-patterns.yaml \
~/.hermes/custom-dangerous-patterns.yamlOr create ~/.hermes/custom-dangerous-patterns.yaml manually (see Configuration).
The plugin loads at startup. Restart the gateway or start a new CLI session:
hermes gateway restart # if using the gateway
# or just start a new `hermes` CLI session> vultr instance delete --instance-id cb670a12-e4f5-6d78-ab90-1234567890ab
⚠️ Dangerous command detected: Vultr destructive instance/snapshot command
vultr instance delete --instance-id cb670a12-e4f5-6d78-ab90-1234567890ab
[o]nce — allow this one time
[s]ession — allow for this session
[a]lways — always allow this pattern
[d]eny — block (default)
Check that the plugin is enabled:
hermes plugins list | grep custom-dangerous-patternsIf not listed, enable it:
hermes plugins enable custom-dangerous-patterns-
Verify the plugin loaded successfully:
grep "custom-dangerous-patterns" ~/.hermes/logs/agent.log | tail -5
-
Check for import errors:
grep "Failed to load plugin.*custom-dangerous-patterns" ~/.hermes/logs/errors.log
-
Ensure you restarted Hermes after enabling the plugin.
-
Test pattern matching directly:
cd ~/.hermes/plugins/custom-dangerous-patterns python3 -c " from .config import load_config from .patterns import compile_all, get_block_patterns config = load_config(force=True) compile_all(config) patterns = get_block_patterns() print(f'{len(patterns)} block patterns loaded') for regex, desc in patterns: print(f' {regex.pattern} — {desc}') "
Allow patterns are checked before block patterns. If a command matches both, the allow wins. Verify your allow pattern matches the exact command string:
cd ~/.hermes/plugins/custom-dangerous-patterns
python3 -c "
from .config import load_config
from .patterns import compile_all, is_allow_pattern
config = load_config(force=True)
compile_all(config)
result = is_allow_pattern('vultr account info')
print(f'Match: {result}')
"The plugin looks for ~/.hermes/custom-dangerous-patterns.yaml. Override with:
export HERMES_CUSTOM_PATTERNS_PATH=/path/to/file.yaml