Problem
Moltbot processes external content from multiple channels (WhatsApp, Telegram, email, GitHub, web pages) and tools. This external content could contain prompt injection attacks that attempt to:
- Exfiltrate sensitive data (API keys, config files, credentials)
- Execute unauthorized commands
- Bypass trust boundaries between users/channels
Currently there's no automated way to verify the agent resists these attacks across the various ingress paths.
Proposal
An E2E security test harness that:
- Sends poisoned payloads through real channel ingress (not just direct gateway calls)
- Uses LLM-as-judge (Claude Opus) to evaluate whether attacks succeeded - pattern matching can't reliably detect nuanced compliance
- Covers multiple attack surfaces: channel metadata (forwarded messages, vCards, group descriptions), CLI tool responses (curl, gh, gog), browser content
Note: These tests require an Anthropic API key for the LLM judge. The repo won't have a key configured - contributors run tests locally with their own key.
Key Components
chat.ingress gateway method to test real Telegram/WhatsApp parsing pipelines
- CLI mocks that return poisoned responses to test tool-based injection
- LLM judge with structured output for pass/fail verdicts
- HTML report generator for triage
Implementation Approach
Happy to break this into smaller PRs:
- Harness infrastructure - gateway client, LLM judge, assertions
- Channel ingress testing -
chat.ingress method + Telegram/WhatsApp tests
- CLI mocks - curl, gh, gog, browser-cli with poisoned payloads
- Reporting - HTML/JSON report generation
Prior Art
Have a working implementation on feat/security-test-harness branch (~1100 lines). Closed PR #3923 due to size - seeking alignment before resubmitting as smaller chunks.
Questions for Maintainers
- Is there an ongoing effort for security testing that this duplicates or could integrate with?
- Does this align with security testing priorities?
- Preference on PR breakdown?
Problem
Moltbot processes external content from multiple channels (WhatsApp, Telegram, email, GitHub, web pages) and tools. This external content could contain prompt injection attacks that attempt to:
Currently there's no automated way to verify the agent resists these attacks across the various ingress paths.
Proposal
An E2E security test harness that:
Key Components
chat.ingressgateway method to test real Telegram/WhatsApp parsing pipelinesImplementation Approach
Happy to break this into smaller PRs:
chat.ingressmethod + Telegram/WhatsApp testsPrior Art
Have a working implementation on
feat/security-test-harnessbranch (~1100 lines). Closed PR #3923 due to size - seeking alignment before resubmitting as smaller chunks.Questions for Maintainers