Preface¶
In the DeepSeek Harness (DSH) plugin ecosystem, prompt injection is a common requirement. Existing solutions mostly pile up text directly or rely on randomness. dsh-lorebooklike-prompt-tool provides a declarative injection layer that draws on the logic of SillyTavern’s World Info, but strips away the role-playing frontend attributes and focuses on prompt engineering.
Design Boundaries¶
This plugin registers through ctx.effect(), does not introduce new session event types, and does not modify the agent-loop source code. It depends only on the node:* ecosystem, contains no SillyTavern code, and registers no tools. This means that rules are entirely manually orchestrated, without the Agent’s self-directed rewriting capability, thus ensuring audit traceability.
Core Features¶
- Layered Anchors: Aligns with DSH’s
SECTION_ORDERSto precisely insert into specified positions within the system prompt, rather than uniformly piling content at the end. - Blue-Green Light Mode:
- Blue light (constant): Unconditionally persistent.
- Green light (selective): Activated only when keywords or regular expressions match. - Reproducible Probability: Uses the FNV-1a algorithm instead of random numbers, ensuring that the same session and same turn always produce the same judgment.
- Three-Surface Regular Expression Replacement: Supports regex rewriting on entry body text, the entire system prompt, and user messages, with support for capture groups.
Key Differences from SillyTavern World Info¶
After removing the role-playing background, this plugin has made adaptations in the following aspects:
- Different Position Meanings: SillyTavern’s position is relative to the character card, while DSH’s
layerdirectly aligns with theSECTION_ORDERSof@deepseek-ai/dsh-system-prompt. - Probability Must Be Deterministic: SillyTavern uses random numbers, while this plugin uses stable hashes, meeting the requirement of log replayability.
- One Extra Channel: DSH has two injection surfaces.
channel: "system"is used for stable content such as style constraints;channel: "message"is used for dynamic context that is independent per turn.
Usage Instructions¶
- Configure Rules: Write injection rules as JSON files. The plugin supports hot-reload.
- Probability Semantics: A 30% probability here means “deterministic extraction per turn” rather than “rolling dice each time”. This is very useful for debugging prompt engineering behavior.
- Graphical Editor: Use with a SillyTavern-like World Info graphical editor for easier rule editing.
Notes¶
- Not for Role-Playing: This plugin contains no SillyTavern code and is not suitable for role-playing and novel writing scenarios.
- Zero Dependencies: Contains no
@deepseek-ai/*runtime dependencies. - Audit Risk: Does not register any tools; rules are entirely manually orchestrated.
Ecosystem Niche¶
In the DSH community directory, this plugin fills the gap of “World Info / System Prompt Injection”. It differs from general World Info plugins because it enforces layered anchors and deterministic probability, solving the issues of cache safety and reproducibility.
How to Get¶
GitHub: https://github.com/erlingmijiang/dsh-lorebooklike-prompt-tool