Preface¶
In the development of Large Language Model (LLM) applications, directly executing model output (eval / shell / SQL / file paths) is a high-risk operation. OWASP lists this specifically as LLM05:2025 Improper Output Handling. If code contains logic that directly concatenates AI output into an execution context, it is equivalent to handing arbitrary code execution rights to a probabilistic model.
The following introduces the DeepSeek Harness plugin dsh-ai-output-trust, designed to detect such risks.
What is it?¶
This is a DSH plugin used to check if code directly executes AI output. It is authored by feely0208, categorized under admin-security, and licensed under MIT.
Core Features¶
The plugin primarily detects four specific high-risk usage patterns:
- Code Execution: Detects the use of
evalandnew Functionto execute AI output. - Shell Commands: Detects the concatenation of AI output within
exec/spawncalls. - SQL Injection: Detects the concatenation of AI output into SQL queries.
- Path Traversal: Detects traversal risks resulting from file paths sourced from AI output.
regarding the identification mechanism, the plugin identifies variables through precise naming conventions to avoid false positives where general model invocations are flagged as high-risk. It is generally recommended that variable names follow the ai* / llm* / model* patterns.
Installation¶
In an environment where DeepSeek Harness is already installed, install the plugin using the following command:
dsh plugin --profile web add @deepwhale-cn/dsh-ai-output-trust
Usage¶
After installation, you can operate via the CLI tool:
dsh-ai-output-trust --demo # View detection results
dsh-ai-output-trust --list-rules # List rules and references
dsh-ai-output-trust --html r.html # Generate an HTML inspection report
Use Cases and Notes¶
This plugin does not perform full data flow analysis; it only inspects code near the call site. It does not rely on static analysis frameworks but makes judgments based on variable naming rules.
Please note the following when using:
* It only checks for the four specific high-risk usages; other indirect trust scenarios are out of scope.
* It relies heavily on precise variable naming (e.g., ai* / llm* / model*); otherwise, it may result in false negatives.
* This plugin is a tool. Users must comply with local laws and regulations and assume full responsibility for any consequences resulting from the use of this project.
Summary¶
dsh-ai-output-trust helps developers quickly identify high-risk output handling methods in Agent code. By combining this with parameterized queries and path normalization, developers can build a safer trust boundary for AI output.
Plugin Directory: dsh-plugin.org
GitHub Repository: github.com/feely0208/dsh-ai-output-trust