Grammatical Inference and Machine Learning Approaches to Post Hoc LangSec