A Self-Improving Architecture for Dynamic Safety in Large Language Models