AI Agent Hub
Back to plugins
🧩

dsh-pwsh-quoting-guard

admin-security Updated 2026.09.11

Run the following command in DeepSeek Harness:

dsh plugin install fengbai2233/dsh-pwsh-quoting-guard

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install fengbai2233/dsh-pwsh-quoting-guard inside your DeepSeek Harness environment; the source code is hosted at https://github.com/fengbai2233/dsh-pwsh-quoting-guard. Restart the dsh web server after installation to load the plugin.

About this plugin

The hardest part of LLM-driven PowerShell on Windows is rarely the script logic itself, but the nested quotes. The official pwsh tool packs the entire command into a single string passed via pwsh -Command, and Windows PowerShell 5.1 silently swallows embedded double quotes when forwarding arguments to native executables. The output is wrong, yet no error is raised and token metrics show nothing. dsh-pwsh-quoting-guard eliminates this class of silent failure at the structural level. It exposes two model-visible tools: pwsh_script delivers the script body as a single argv element and binds data parameters as a structured array to $DSH_ARGS, with all escaping handled by plugin code so the model never touches quotes; run_argv bypasses the shell entirely, passing the argument vector straight to the child process and supporting an explicit working directory.

The two tools coexist with the official pwsh tool rather than replacing it. Short one-liners, background tasks, and sandbox-permission escalation still go through the official channel. For quoted arguments, paths with spaces or non-ASCII characters, or multi-line scripts, reaching for these tools first yields correct results at the same token cost. The plugin has zero runtime dependencies and adds roughly 313 tokens of fixed overhead per request, paying for itself once it prevents even one or two quoted-argument failures per call.

Who is this for? If you run DSH sessions on Windows and the model frequently invokes PowerShell scripts or external programs, and you have already been burned by swallowed quotes, CLIXML noise, or retry storms, this plugin is built for exactly that pain point. Install it, restart the DSH web server, and the two tools appear in the tool registry with no extra configuration or dependencies required.

Use Cases

  • Model invokes PowerShell with quotes, spaces, Chinese paths, or $ symbols and gets silent wrong results
  • Passing multi-word arguments to native executables where Windows PowerShell 5.1 silently eats embedded double quotes
  • LLM generates multi-line PowerShell scripts needing structured array parameters to avoid double string interpolation

Best For

  • Teams running DSH sessions on Windows where Windows PowerShell 5.1 is the executor
  • Developers who have repeatedly hit quoting pitfalls and wasted retry tokens on agent-driven PowerShell calls
  • DSH plugin authors who need safe tool registration for LLMs with zero runtime dependencies