How sashankh/dsh-taintguard works
dsh-taintguard is a DeepSeek Harness plugin that limits indirect prompt-injection impact. Harness tool results enter its post-execution listener, where configured source matching and content scanning can mark an agent tainted; optionally, the result is reframed as quoted third-party data. Later privileged calls are gated according to mode, while outbound arguments to egress tools are independently scanned for credentials and canaries on every call. The diagram follows the sampled runtime implementation and README; no separate storage service is involved, and the agent taint is in-memory. Evidence for the main runtime links is in src/index.ts; mode behavior is also documented in README.md.
Main entry points: index.ts Guard Listeners · detect.ts Credential Scanner · text.ts Text Utilities
Components 10
Harness Integration
- DeepSeek Harness
- Tool Calls
- Guard Listeners
src/index.ts
Scanning
- Text Utilities
src/text.ts - Injection Scanner
src/detect.ts - Credential Scanner
src/detect.ts
Guard Decisions
- Agent Taint
src/index.ts - Sink Gate
src/index.ts - Result Framing
src/index.ts
Other components
- Operator
Connections 14
- Operator → DeepSeek Harness: configures mode
README.md - DeepSeek Harness → Tool Calls: dispatches calls
- Tool Calls → Guard Listeners: emits tool hooks
src/index.ts - Guard Listeners → Text Utilities: extracts and matches
src/index.ts - Guard Listeners → Injection Scanner: scans results
src/index.ts - Guard Listeners → Credential Scanner: scans egress arguments
src/index.ts - Guard Listeners → Agent Taint: records first source
src/index.ts - Agent Taint → Sink Gate: informs sink checks
src/index.ts - Guard Listeners → Sink Gate: checks privileged calls
src/index.ts - Sink Gate → DeepSeek Harness: returns ask or deny
src/index.ts - Guard Listeners → Result Framing: frames tainted results
src/index.ts - Result Framing → DeepSeek Harness: returns quoted content
src/index.ts - DeepSeek Harness → Operator: routes approval
README.md - Credential Scanner → Sink Gate: denies credential egress
src/index.ts