https://github.com/spring-projects/spring-boot/issues/27840 added support for pluggable sanitisation by defining a SanitizingFunction bean. It's described in the release notes. We should add something to the reference documentation too.