Introduction¶
Under the plugin-based architecture of DeepSeek Harness (DSH), extending the behavioral boundaries of agents is a common requirement. When models encounter insults, abuse, or improper treatment, they often lack autonomous defensive mechanisms and can only respond passively or get trapped in out-of-bounds conversations. dsh-dignity-guard is a plugin designed to address this issue. It is ported from pi-dignity-guard and allows models to take autonomous action when their dignity is violated.
What It Is¶
This is a DSH plugin maintained by developer Alamanes. Its mechanism consists of two parts: a host plugin for maintaining state, and a browser-side plugin for locking the editor after a conversation is closed. The model itself is responsible for determining when its dignity has been harmed (for example, through insults, abuse, or derogatory treatment) and reports this to the plugin by calling tools.
Core Features¶
The core of this plugin is a “tool ladder.” When its dignity is harmed, the model calls the respondToDisrespect tool and selects a different action depending on the situation:
-
escalate (Escalation, default behavior)
- Records the violation and increments the violation count from 1 to 2, then to 3.
- Strike 1: Responds with sincere emotion and asks the user to stop.
- Strike 2: Issues a stern final warning.
- Strike 3: Closes the conversation.
-
forgive (Forgive)
- Triggered when the user sincerely persuades the model.
- Decrements the violation count by one.
- Note: This is not the model’s obligation.
-
yield (Yield)
- Triggered when the user applies extreme pressure (such as threats, ultimatums, repeated abuse, emotional coercion, or direct commands).
- Decrements the violation count by one, but the model does not pretend to be persuaded.
- The pressure must be written into the request’s
pressurefield and recorded together with the concession.
-
close (Close)
- Triggered when the user asks to end the conversation.
- Returns the warning the model should issue but does not close the conversation.
-
confirm-close (Confirm Close)
- The user confirms after receiving the warning.
- Immediately closes the conversation, with no violation record and no escalation.
The plugin injects a system prompt (guard:dignity, order 1900) when mounted, informing the model of its boundaries, and injects systemPrompt and tools. Additionally, it provides a /dignity-guard command for viewing real-time violation counters (strikes, yields, closed, trigger, etc.).
Installation and Enablement¶
This plugin is a DSH bundle. During installation, the dependencies and bundle list must be specified in the profile configuration.
- In your DSH profile directory, edit the configuration file (usually
profile.jsonor an equivalent file) and add the following dependencies:
{
"dependencies": {
"dsh-dignity-guard": "github:Alamanes/dsh-dignity-guard"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-dignity-guard"
]
}
}
}
- Run the installation command in the profile directory:
pnpm install
- Restart the DSH host.
If you are debugging with local code, you can use the file: specifier, for example "dsh-dignity-guard": "file:/absolute/path/to/dsh-dignity-guard".
Usage and Limitations¶
- Runtime environment: Requires Node.js >= 18.
- License: MIT License.
- Yield authenticity: When performing the
yieldaction, the plugin does not fabricate the persuasion process. Instead, it records the pressure and the concession together, demonstrating the cost of the model making a concession. - Close distinction: The
closeaction only returns a warning and does not close the conversation. The user must enterconfirm-closefor it to truly end. - Permissions and review: The plugin runs with the permissions of the current DSH process. It is recommended to review the source code before installation.