Master LLM security: prompt injection defense, output filtering, plugin safeguards, red teaming, and risk mitigation