From Exponential to Polynomial-time Security Typing via Principal