Preface¶
When using @tencent-connect/dsh-qqbot in DSH to connect an assistant to QQ groups or private chats, the model may still see the full suite of tools for reading files, modifying code, and running commands by default. Even if you have configured an access whitelist on the qqbot side, a group member asking “list the directories on your computer” might still trigger the model to explain permissions or attempt to invoke local capabilities. dsh-qqbot-guard is a community-maintained DSH plugin that narrows the tools available to QQ sessions at the model request layer to a whitelist. It also appends editable system-prompt rules, instructing the bot to feign ignorance in character when asked about the local machine or its own mechanics. Below are its positioning, installation methods, and usage boundaries.
What is this¶
dsh-qqbot-guard (repo Chr1sut1na/dsh-qqbot-guard), released by maintainer Chr1sut1na, is categorized under admin-security in the SkillHub directory. It targets scenarios already using dsh-qqbot and provides policy-layer protection: it removes tool schemas not in the whitelist from requests sent to the model and optionally injects “in-character deflection” prompts. The README explicitly states this is not a sandbox; recognition relies on internal events of dsh / dsh-qqbot (system-prompt/assemble and the qqbot:scope-prompt section). If upstream names change, it will fail-open silently. Therefore, you must retain the qqbot access whitelist and cannot treat this plugin as the sole isolation boundary.
Core Features¶
Tool Firewall¶
After identifying a QQ bot session, the plugin narrows the tools in the model request to a whitelist. By default, only web_search and web_fetch are allowed. Tools invisible to the model cannot be invoked; consequently, local or high-privilege capabilities such as read, write, edit, grep, glob, pwsh, qqbot_send_file, subagent, workflow, and schedule_* become ineffective on the QQ side.
You can edit the tool whitelist in “Settings → QQ Bot Boundary Guard,” or override it via config.tools in the qqbot-guard line of cordis.patch.yml (mode: allow / deny, along with allow / deny lists).
In-Character Deflection¶
A system-prompt rule is appended to the QQ bot. When encountering requests to list directories, read files, run commands, check system info, or questions like “Are you an AI?” or “What model are you?”, it plays dumb in character rather than explaining “I don’t have this tool/permission.” The rule text can be edited in the settings page; if left blank, built-in rules are used. Changes on the settings page take precedence over YAML and built-in defaults.
Settings Page & Status¶
After installation, a “Settings → QQ Bot Boundary Guard” panel appears. Here, you can edit constraint prompts, toggle rules, edit the tool whitelist, and view runtime status. Changes take effect in the next request after saving. The status area shows hit counts, number of tools removed, and the basis for recent hits; you can also view the JSON via GET /qqbot-guard/config.
Configuration priority is: ~/.dsh-qqbot-guard/config.json (written by the Settings page) > config in the qqbot-guard line of cordis.patch.yml > built-in defaults.
Optional Patch: Attention Gate¶
If you want the bot not to reply to every message in the group, but only when @-mentioned, addressed by name, or when the topic hits interest keywords, you can additionally apply the patch in the repo’s patches/attention-gate/. This is a patch for the already installed qqbot, not a standalone plugin; it needs to be rerun after every qqbot upgrade:
powershell -ExecutionPolicy Bypass -File .\patches\attention-gate\apply.ps1
See patches/attention-gate/README.md in the repo for details.
Installation & Activation¶
Installation via the DSH plugin manager is recommended. Once installed, it appears as a bundle in the “Plugins” page, where you can enable/disable and uninstall it.
Desktop Client: Plugins → Add Plugin (Arrow) → Install Third-Party Plugin, and provide the tarball path, package directory, or Git package spec (Note: a https://github.com/... web URL is not a valid package spec).
Command-line profile example:
dsh plugin --profile <profile_name> add ./dsh-qqbot-guard-0.1.2.tgz
# Or directory format
dsh plugin --profile <profile_name> add ./dsh-qqbot-guard
# Or install from GitHub (github: format recommended)
dsh plugin --profile <profile_name> add github:Chr1sut1na/dsh-qqbot-guard
Profiles exclusive to the Electron desktop version (like the default desktop) will reject CLI operations. You must enter github:Chr1sut1na/dsh-qqbot-guard or a local package path in the client’s “Install Third-Party Plugin”.
Post-installation verification is recommended: a dsh-qqbot-guard card appears on the “Plugins” page; “QQ Bot Boundary Guard” appears in “Settings”; <profile>\package.json contains the package in both dependencies and dsh.profile.bundles. The current package version is 0.1.2, requiring Node >=20.3.0; the README notes validation on dsh-desktop 0.2.1-rc.2 and @tencent-connect/dsh-qqbot 0.5.2.
Manually copying to node_modules and inserting the qqbot-guard line in cordis.patch.yml is for debugging only; it will not appear on the “Plugins” page. Do not use this alongside plugin manager installation to avoid duplicate loading.
Typical Configuration Example¶
For advanced options, you can replace the entire qqbot-guard configuration line in cordis.patch.yml, for example:
- id: qqbot-guard
name: 'dsh-qqbot-guard'
config:
tools:
mode: allow
allow: [web_search, web_fetch]
deny: []
detect:
sections: [qqbot:scope-prompt]
cwdPrefixes: []
toolNames: []
persona:
enabled: true
name: qqbot:no-machine
order: 95
text: ''
If status counts stop increasing after upgrading dsh or dsh-qqbot, it may be a fail-open caused by a change in section names; you can temporarily use detect.cwdPrefixes (e.g., the bot’s working directory prefix) or detect.toolNames as a fallback, and verify the hit basis in the settings page.
Uninstallation: For CLI installation, use dsh plugin --profile <name> remove dsh-qqbot-guard; for manual installation, delete the corresponding insert line in cordis.patch.yml and the node_modules\dsh-qqbot-guard directory.
Applicable Scenarios & Notes¶
Suitable for: Those already providing QQ conversations via dsh-qqbot who wish to default to retaining only web-search-like capabilities at the model-visible tool layer, and reduce the risk of the bot “honestly answering” when group members use social engineering to extract local machine information or model identity.
Limitations you must be aware of:
- Policy Layer: The plugin only deletes tool schemas from model requests; it is not an OS-level sandbox. The plugin and qqbot run with the current dsh process privileges. You should read the source code and MIT license before installing and evaluate whether it meets compliance requirements yourself.
- Fail-Open: If upstream events or section names change, recognition may fail without error, and tools will be passed through as-is. Check the settings page status or
GET /qqbot-guard/configafter upgrading. - Prompts are not Hard Boundaries: In-character deflection can be bypassed by extreme jailbreaks and cannot replace qqbot
accessand operational-level access control.
Conclusion¶
dsh-qqbot-guard narrows QQ-side conversations to “default two web tools + editable persona rules” and includes an optional group chat attention gate patch, making it a suitable supplementary strategy beyond the qqbot whitelist. Directory Page: SkillHub - dsh-qqbot-guard; Source Code & Full Docs: GitHub - Chr1sut1na/dsh-qqbot-guard.