RASP detects threats by examining the behavior of applications while WAFs are designed to prevent threats from getting to applications in the first place.