ssh-session-policy-upsert
Upsert custom policy rules for SSH sessions to block, warn, or log commands matching JavaScript regex patterns.
Instructions
Add or update a session-level custom policy rule. Session rules are applied after immutable built-in hard blocks and before the built-in safe/full warning set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Stable rule id used for future updates or removal | |
| mode | No | Which operation mode the rule applies to | |
| flags | No | Optional JavaScript regex flags, for example i or gi | |
| action | Yes | error blocks the command, warning allows it with warning metadata, log only annotates it | |
| enabled | No | Whether the rule is active. Defaults to true | |
| message | Yes | Human-readable reason shown when the rule matches | |
| pattern | Yes | JavaScript regular expression source without surrounding slashes | |
| session | No | Session id, session ref, or session name. Defaults to the active session | |
| category | Yes | Rule category shown in blocked/warned responses | |
| priority | No | Lower numbers run earlier within the same severity band | |
| suggestion | No | Optional remediation hint shown alongside the message |