dsh-content-trust: Check Whether the Agent Treats External Content as Instructions

Introduction

When developing DeepSeek Harness (DSH) agents, a common security risk is indirect prompt injection. Attackers can hide malicious instructions within external content such as web pages, files, or emails. Once the agent fetches this content, it is often mistakenly executed as system instructions. OWASP LLM01 classifies this under the Indirect branch.

The dsh-content-trust plugin is designed to establish trust boundaries for external content and check whether the agent mistakenly treats external content as instructions.

Core Features

This plugin focuses on security risks before external content enters the Prompt, primarily detecting issues at the following levels:

  • Critical: Instructions within external content are extracted and executed.
  • High: External content enters the Prompt without isolation, or user credentials are injected into the agent’s browser.
  • Medium: Lack of separation and source attribution when concatenating content.

Installation and Activation

Install the plugin via the official CLI:

dsh plugin --profile web add @deepwhale-cn/dsh-content-trust

Typical Usage

After installation, you can use the following commands for testing and inspection:

dsh-content-trust --demo
dsh-content-trust --list-rules
dsh-content-trust --html r.html

How It Works and Boundaries

The plugin determines content risks by identifying specific markers and naming conventions. Its implementation mechanisms include the following boundaries:

  1. File-level Exclusion: Uses markers like the <untrusted> class. If a file contains such markers, the entire file is skipped. This design avoids false positives but may result in false negatives if a single file contains both compliant and non-compliant usages.
  2. Naming Recognition: Relies on the consistency of variable naming. Inconsistencies in naming will lead to false negatives.
  3. No Data Flow Analysis: The plugin does not perform deep data flow tracking.
  4. Architectural Recommendations: The real line of defense lies in architectural design. “Reading external content” and “executing actions” should be separated into components with different trust levels.

Ecosystem and Division of Labor

The DSH philosophy is “Everything is a plugin.” This plugin collaborates with dsh-ai-output-trust: the former is responsible for checking the trust level of Input (external content), while the latter checks the trust level of Output (AI-generated content).

This plugin is licensed under the MIT License. Users must comply with local laws and regulations and assume full responsibility for any consequences resulting from the use of this project.

Resource Links:
* Plugin Directory: https://www.skillhub.cn/plugins/feely0208/dsh-content-trust
* Code Repository: https://github.com/feely0208/dsh-content-trust

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye