MCPcopy
hub / github.com/garrytan/gstack / hasInjection

Function hasInjection

lib/jsonl-store.ts:42–44  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

40
41/** True if `text` contains an instruction-like injection pattern. */
42export function hasInjection(text: string): boolean {
43 return INJECTION_PATTERNS.some((p) => p.test(text));
44}
45
46/** Returns the first injection pattern that matches, or null. For actionable errors. */
47export function firstInjectionMatch(text: string): RegExp | null {

Callers 2

validateDecideFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected