Effects can definitely help, but a strong type system allows you to encode security concerns for compile time feedback as well.
See https://gmb.is/refinement-types.html for a non-Haskell example.
See https://gmb.is/refinement-types.html for a non-Haskell example.
[0] No, not sanitization!