Introduction¶
The core philosophy of DSH is “Everything is a plugin.” When developing agents, ensuring that the Agent always adheres to global instructions is a common pain point. Injecting instructions into historical messages can sometimes result in compression, whereas injecting them into specific positions within the system prompt is more reliable. The dsh-global-rules plugin maintains a list of user-owned rules and injects them into the system prompt of every request, forcing the Agent to verify them one by one before responding.
Core Features¶
- Three Modification Entries: Modify rules via the visual interface in the settings page, the command-line tool
/rules, or theglobal_rulestool available to the Agent. All three methods modify the same data set. - Storage Location: Rules are stored in
$DSH_HOME/dsh-global-rules/rules.json. - Injection Position: The system prompt is reassembled for every request, inserting the rules at position 100 (after the deployed persona and before the tool descriptions).
Installation¶
Install the plugin into the specified profile directory using pnpm. The plugin name is dsh-global-rules.
pnpm add https://github.com/IHS470/dsh-global-rules/archive/refs/tags/v1.0.0.tar.gz --dir <profile>
After installation, it must be added to the bundle list in the profile configuration.
Usage¶
Command Line¶
Use the /rules command for quick operations.
/rules # View current rules
/rules add <text> # Add a new rule
/rules remove <index> # Delete the Nth rule
/rules clear yes # Clear all rules
/rules on | off # Enable / disable injection
/rules check on | off # Show / hide rule check line in response
/rules help # Show usage instructions
Agent Tools¶
The Agent can invoke the global_rules tool.
| action | parameters | description |
|---|---|---|
list |
— | List rules and switch status |
add |
text |
Append a rule |
update |
index / id, text / ruleEnabled |
Modify content or enable/disable a single rule |
remove |
index / id |
Delete a rule |
clear |
— | Clear all rules |
replace |
rules: string[] |
Replace the entire set |
configure |
enabled / acknowledge |
Global switch and visible check |
Interface¶
Navigate to Settings → Global Rules.
Injection Logic & Configuration¶
The plugin injects a block of text into the system prompt, requiring the Agent to verify the rules one by one before answering.
- Enable/Disable Injection: Controlled via the settings page or commands.
- Show Rule Check: Disabled by default. When enabled, a check result line
Rule check: N rules verifiedis appended to the end of every response.
Limitations & Storage¶
- Data Limits: Maximum 2000 characters per rule, up to 200 rules.
- Storage Format: Writing is strict (empty rules or over-limit content will not be written), while reading is lenient (if one entry is corrupted, only that entry is discarded).
- Log Isolation: The rule list does not enter session logs; it is deployment-level configuration, not conversation content.
- Guarantee Scope: The plugin only guarantees that rules are “delivered,” not that the Agent “complies.”
Notes¶
- The compliance of the reasoning channel with user rules located in the middle of the system prompt is significantly lower than that of the response itself.
- Modifying rule phrasing has limited effect on controlling the reasoning language; it is recommended to start a new session if necessary.