MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / PoisonRequest

Function PoisonRequest

internal/toolinjection/poison.go:13–19  ·  view source on GitHub ↗

PoisonRequest rewrites a chat-completion request so that all conversation history is replaced with a single user message containing text. The system prompt is preserved. format must be "openai", "claude", or "openai-responses".

(rawJSON []byte, text string, format string)

Source from the content-addressed store, hash-verified

11// history is replaced with a single user message containing text. The system
12// prompt is preserved. format must be "openai", "claude", or "openai-responses".
13func PoisonRequest(rawJSON []byte, text string, format string) ([]byte, error) {
14 f := GetFormat(format)
15 if f == nil {
16 return nil, fmt.Errorf("unsupported format: %s", format)
17 }
18 return f.PoisonRequest(rawJSON, text)
19}
20
21// poisonOpenAI keeps only role=="system" messages and appends a user message.
22func poisonOpenAI(rawJSON []byte, text string) ([]byte, error) {

Callers 2

PrepareInjectionMethod · 0.92

Calls 2

GetFormatFunction · 0.85
PoisonRequestMethod · 0.65

Tested by 1