Pentesting AI Components: Key Vulnerabilities CISOs Must Address in RAG and Agent Systems

The article from ABP2B details how AI integration into corporate systems dramatically expands the attack surface beyond traditional web applications. It explains the progression from simple chatbots to RAG-enabled assistants and full AI agents that can execute real actions via APIs and tools. Yuri Grishaev, OSCP+ certified specialist and top Standoff 365 hacker, outlines specific risks including unauthorized data access through RAG, prompt injection via poisoned documents, and XSS chains triggered by model outputs. The piece stresses that classic authorization checks often fail when service accounts grant AI components broad access. It also covers how minimal-privilege principles and output sanitization become critical when agents can modify CRM records or calendars. Finally, the authors provide a readiness checklist and policy templates for organizations deploying AI.

HabrTranslated from Russian

Read at source

The integration of AI components into web applications has moved far beyond simple chatbots. Modern systems now connect language models to internal documents, corporate email, CRM platforms, and databases, sometimes allowing autonomous actions. For employees these changes may appear minor, yet from a security perspective the risk landscape has shifted significantly.

Traditional web pentests still examine authorization, access controls, APIs, and business logic. However, the language model now sits between the user and the application, interpreting content and potentially triggering real operations when tools are attached. Attackers can therefore influence the AI component itself rather than directly bypassing application restrictions.

From Chatbot to AI Agent: How Risks Evolve

The simplest implementation is a chatbot that receives a message and returns a response. When no external data sources or privileged actions are involved, manipulation remains limited. Systems using RAG technology add external information retrieval, allowing the model to pull from corporate knowledge bases. AI agents go further by executing actions through connected tools such as creating CRM tasks or modifying calendar entries.

Security assessment should therefore focus on what data the AI can reach and what operations it is permitted to perform, rather than on the specific model in use. The same model may serve public documentation or control sensitive infrastructure, producing vastly different consequences.

RAG Data Leakage and Prompt Injection Risks

When a corporate assistant searches internal documents, service accounts often possess broad read access. An ordinary employee without direct file permissions can still obtain sensitive content through the AI response if user rights are not enforced before retrieval. During pentests it is essential to verify whether the RAG component respects individual access controls.

Prompt injection becomes possible when an attacker plants instructions inside documents, emails, or web pages that the model later processes. The malicious text does not need to reach the chat interface directly; it can travel through multiple intermediate components and still enter the model context. Successful injection alone does not guarantee impact; the real danger depends on connected tools and privileges.

AI Agents and Excessive Privileges

AI agents introduce additional concerns because they can alter system state. If an agent managing a corporate calendar operates under a service account with company-wide rights while the requesting user should only edit personal events, unauthorized changes become feasible. Operations may appear legitimate in logs because they originate from an authorized account.

Consequently, testers must examine available tools, the identity under which actions execute, whether initiator rights are validated, and which operations require extra confirmation.

Recommendations for CISOs

Organizations should first inventory all AI components, including those deployed by individual departments without security oversight. Components with access to confidential data or modification capabilities require priority attention. RAG searches must enforce user-level permissions, model outputs must be sanitized before rendering, and agents must operate under the principle of least privilege. Regular reassessment is necessary because adding new capabilities changes the attack surface even if the underlying model remains unchanged.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in AI Security

Local AI Models Help Scammers by Drafting Fraudulent Replies Without Raising Alerts
SOC Forum 2026 Examines How Generative AI Lowers Attack Barriers and Reshapes Security Operations
Hard Stop System Aims to Contain Autonomous AI Agents After OpenAI Sandbox Escape Incident