Preface¶
The plugin-based architecture of DeepSeek Harness (dsh) allows users to extend behavior without modifying core code. TrustedRouter is a service that provides privacy protection and intelligent routing. It requires that policy configuration be included in the request body, for example {"provider": {"min_privacy": "confidential"}}. Model providers in dsh typically can only pass information via Headers and cannot write to Body fields. Without this plugin, TrustedRouter policies cannot be injected directly into the request.
The dsh-trustedrouter plugin solves this problem. It wraps the fetch method of the dsh server and injects a provider object into the request body sent to the TrustedRouter gateway, enabling per-model privacy and routing policies to be configured in dsh.
Plugin Overview¶
- Function: Adds a TrustedRouter provider object for each model in DeepSeek Harness.
- Maintainer: AmmarByFar
- License: MIT
- Dependencies: Requires
pnpmto be available in PATH and depends on@deepseek-ai/schemastery.
Installation¶
Before installing this plugin, ensure that pnpm is installed and callable from the terminal. After installation, restart dsh web.
Command-line installation (for the web profile):
dsh plugin --profile web add github:AmmarByFar/dsh-trustedrouter#v0.1.0
After installation, restart dsh web for the plugin to take effect. This plugin has no build step.
Configuration and Usage¶
1. Configure in the Web UI (Per Model)¶
After installation, go to the Settings → Models page in dsh. In the configured TrustedRouter provider card, click Privacy & routing.
For each model under that provider, you can configure the following policies:
- Privacy floor (min_privacy): Set to
no_store,zdr, orconfidential. TrustedRouter will reject requests below this level. - Prefer (sort): Choose the optimization target, such as
price,latency, orthroughput. - Only these providers (only): Restrict which providers are allowed.
- Never these providers (ignore): Exclude certain providers.
- Billing (usage): Set to
creditsorbyok(Bring Your Own Key). - US-headquartered providers only (jurisdiction: “us”): Use only providers headquartered in the United States.
Apply configuration: Click Apply to save. The next request will automatically apply the selected policy.
2. Global and Advanced Settings¶
In the sidebar Plugins, go to TrustedRouter privacy (under Installed).
Here you can configure global defaults and advanced options:
- Gateways: Configure the gateway base URLs where policies should be applied (default is
https://api.trustedrouter.com/v1). - Defaults: Default settings applied to all models.
- Advanced defaults:
order: Preferred provider order.allow_fallbacks: Whether to allow fallback to other providers.max_price: Maximum prompt and completion price (USD per million tokens).
- Per-model overrides (JSON): JSON-format model override configuration.
- Raw body rules (JSON): Fields to deep-merge into all POST request bodies (except
provider).
3. Configuration File¶
The plugin writes its configuration to the cordis.patch.yml file in the web profile (path is usually ~/.dsh/profiles/web/cordis.patch.yml).
You can edit this file directly:
- id: trustedrouter
config:
gateways: [https://api.trustedrouter.com/v1] # Gateway address
defaults: { min_privacy: zdr } # Default privacy level
models: # Model-specific configuration
z-ai/glm-5.3: { min_privacy: confidential, only: [tinfoil, privatemode] }
rules: [] # Optional raw rules
log: false # Whether to log changes to the terminal
Limitations and Notes¶
- Desktop app not supported: This plugin supports dsh web only, not the desktop client.
- Automatic updates: dsh currently does not automatically update installed plugins. To upgrade a plugin, manually uninstall it and install it again. Settings are stored in the profile and will not be lost.
- Configuration permissions: Settings can only be modified in a browser on the same machine running dsh web.
- Initial state: If no policy is configured after installation, requests will remain unchanged.
- Security mechanism: If a request requires a policy but the Body cannot be read, the plugin rejects the request (fails closed) and prints a message to the terminal instead of sending an incomplete request.
- Dependency check: pnpm reports a peer dependency warning for
@deepseek-ai/schemastery. This is expected because the package is provided by dsh itself.
Verification¶
On the Plugins page, enable Log changes to the terminal, then send a chat message using a TrustedRouter model. The terminal will output a log similar to this:
[trustedrouter] added provider to POST https://api.trustedrouter.com/v1/chat/completions for z-ai/glm-5.3: {"min_privacy":"confidential"}