The development of artificial intelligence from traditional rule-based systems, through generative artificial intelligence, to autonomous AI agents is significantly changing the way digital systems are designed, used and protected. AI agents based on large language models have the ability to understand context, plan, make decisions, use tools, access databases and execute complex multi-step tasks. Such capabilities open up new opportunities in education, science, academic publishing, business, and cybersecurity, particularly in the areas of automated surveillance, threat analysis, anomaly detection, and incident response support. However, increased autonomy simultaneously expands the attack surface and introduces new risks, such as prompt injection attacks, data leakage, misuse of tools, unauthorized access, hallucinated decisions and insufficient transparency of automated processes. The paper specifically analyzes security challenges in LLM/n8n workflow systems for academic publishing, where malicious instructions hidden in PDF manuscripts can compromise metadata extraction, reference checking, and final editorial reports. In response to these risks, a multi-layered protection architecture is proposed that includes prompt injection pattern detection, LLM security risk classification, output validation, access control, audit trail and human-in-the-loop monitoring. It concludes that the future of digital trust depends on the development of AI agents that are not only intelligent and autonomous, but also secure, explainable, verifiable, accountable and compliant with ethical and regulatory requirements.