Safeguarding the Future: Building Resilience Against Malicious Agents in Open Communities