mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-11-25 19:43:29 +01:00
escape_special_chars_for_json only escaped backslash, quote, \n, \r and \t. Other control characters below U+0020 (backspace, form feed, ESC, NUL...) were inserted raw into the JSON request body, producing invalid JSON that targets reject, so attack prompts containing them were never evaluated. Delegate to json.dumps, which escapes every character JSON requires.