DRIFT: Dynamic Rule-Based Defense with Injection Isolation for Securing LLM Agents