Skip to main content
HPI CYBERApplication Security

AI Security

Penetration testing for AI systems, LLM models and autonomous agents

Security testing for chatbots, language models, agents and RAG systems: understanding the trust boundaries, the permissions and what the system can cause to happen — and validating findings before they reach the report.

Why an AI system needs more than a Web test

A Web or API test examines the controls the system defined. An AI system adds a layer where behavior depends on text: a model that receives instructions in natural language, an agent that invokes tools, and a knowledge base through which documents arrive. The same permission control that can look entirely correct can be bypassed through a model's answer.

What the test shows

Whether the system can be made to expose information not intended for a user, to perform an action beyond their permissions, or to be influenced by an external source. Every finding in the report was validated in the authorized test environment — not a theoretical scenario.

What we assess

The areas below are possible assessment domains. The precise test scope is set by the system type, the testing permissions and the professional capability that was examined and approved.

LLM & Chatbot Security

LLMs and chatbots

  • Direct prompt injection
  • Indirect prompt injection
  • Jailbreak and deviation from the defined behavior policy
  • Sensitive information disclosure
  • System prompt leakage, where it has a security implication
  • Insecure output handling
  • Authorization controls and the link between the user, the data and the actions

Not every jailbreak or system prompt leak is a vulnerability with business impact. The context, the trust boundary and the actual effect are what determine it.

AI Agent Security

AI agents

  • Excessive agency — the agent does more than it was scoped to
  • Tool misuse — a tool used in a way it was not intended for
  • Tool-output prompt injection
  • Unauthorized actions
  • Privileges the agent holds beyond the invoking user's
  • Cross-user and cross-tenant actions
  • Approval boundaries before sensitive operations
  • How external information influences the agent's decisions

RAG & Knowledge Base Security

RAG and knowledge bases

  • Information exposure between users or organizations
  • Retrieval access control — enforced at the retrieval step
  • Documents containing malicious instructions
  • Data poisoning in the context of the information sources
  • Linking document permissions to user permissions
  • Sensitive information exposed through model answers

AI-Powered SaaS Security

SaaS products with AI

  • Multi-tenant isolation
  • AI API authorization
  • Business logic abuse
  • Information exposure between customers
  • Permission and subscription management
  • Integrations with external AI models
  • Verifying the AI does not bypass existing application controls

AI Model & API Security

Models and AI interfaces

  • Authentication and authorization
  • Model API exposure
  • Rate limits
  • Resource abuse
  • Data leakage
  • Model extraction risks
  • Access to models, configuration and sensitive resources
  • Protection of model hosting systems

Deep testing at the model level depends on the architecture, the testing permissions and the capability that was examined and approved in advance.

MCP & AI Tool Integrations

MCP and tool integrations

  • MCP server security
  • Permissions to invoke tools
  • Credential exposure
  • Tool response manipulation
  • Connections to external information sources
  • Separation between users and agents
  • Use of tokens and credentials
  • Abuse of the permissions of connected systems

What can go wrong in an enterprise AI system?

Four hypothetical risk scenarios, illustrating how an AI vulnerability becomes a business impact. These are not incidents found at an HPI customer.

A chatbot exposes another customer's data

Access control over documents is checked on the user, but the knowledge-base retrieval returns chunks from another organization's document — and they come back in the answer.

An agent performs an action beyond its permissions

A user with read-only permission invokes an agent that can reach a write tool, and the action is recorded as if the user had performed it.

An external document changes the RAG's behavior

A document ingested into the knowledge base contains instructions, and the system treats them as system instructions instead of as content.

An AI integration into an internal system

A connection to a CRM or a database gives the agent broader access than needed, opening a path to sensitive information or to invoking unauthorized functions.

Testing methodology

Six steps, from the same process used in application tests — with an architecture and threat-modeling layer suited to AI systems.

  1. Discovery and scoping

    We define what the system is, what is included in the test and what is out of scope, including environments, accounts and third-party constraints.

  2. Architecture and threat modeling

    We map the information flow, the RAG sources, the user types and permissions, and the tools the agent can invoke.

  3. Authorized security testing

    Manual testing within the agreed boundaries, supported by tools, with no dangerous exploitation and no testing of unapproved assets.

  4. Finding validation and risk assessment

    Every finding is examined and weighed by its business impact, not by theoretical severity alone.

  5. Report and remediation guidance

    An executive summary, findings with evidence, business impact and prioritized remediation guidance for the development team.

  6. Retest per agreement

    Retesting of fixed findings, within the scope and timing agreed in advance.

What the architecture step examines

  • The model and its service provider
  • The information flow between system layers
  • RAG sources and their permissions
  • User types and permissions
  • The tools agents can invoke
  • Permissions of connected external systems
  • Trust boundaries between components
  • Actions with business impact
  • Testing limits and third-party permissions

How this affects the scope

More information sources, more tools and more user types mean more combinations to test. That is why the scope is set in a conversation rather than from a price list, and why what is not tested is defined in advance — for example a third-party provider's assets that carry no permission.

Deep testing of the model itself depends on the architecture and the permissions; if it is out of scope, it is written into the report as a limitation.

Professional frameworks for AI security assessment

These frameworks are a methodological basis for building test coverage. They are not a certification, endorsement or partnership of HPI with the publishing bodies.

OWASP GenAI Security Project

The central reference for LLM and GenAI risks, including the Top 10 for LLM applications.

OWASP Agentic AI Security

Guidance on the risks of agentic systems: agents, multi-step flows and tool invocation.

OWASP AISVS

A catalogue of testable security requirements for AI-enabled systems, aligned with the ASVS structure.

OWASP AI Testing Guide

A methodology for trustworthiness testing of AI systems.

MITRE ATLAS

A map of tactics and techniques in attacks against AI systems, used to plan test coverage.

OWASP ASVS / WSTG / API Security Top 10

The application frameworks for the Web, API and permission layers the AI system runs on top of.

What you receive at the end

  • Executive summary
  • Testing scope
  • Architecture and threat model
  • Findings with severity ratings
  • Documented evidence
  • Business impact for every finding
  • Remediation recommendations
  • Limitations and residual risk
  • Retest results, if performed

What the report doesn't guarantee

A security test report reflects the system at a point in time and within the scope tested. AI systems change quickly — models, documents, configuration and tools — so the report makes no promise of an absence of vulnerabilities.

AI security testing FAQ

What is AI penetration testing?
A security test whose goal is to determine whether a system built on artificial intelligence lets a user, a file or an external system reach information or perform actions beyond what their permissions allow. The test covers both the application layer above the model and the system's behavior in relation to the data it can access.
How is AI pentesting different from a regular Web test?
A Web test focuses on permissions, authentication, input and business logic. An AI test adds layers where behavior depends on text: a model that receives instructions in natural language, an agent that invokes tools, and a knowledge base through which documents arrive. Both layers stay relevant — a model does not remove the need to test the application above it.
What is the difference between AI red teaming and a focused security test?
Red teaming examines whether a defined impact scenario can be reached through a combination of techniques, sometimes over an extended period. A focused security test examines an agreed list of areas and reports validated findings. The difference is mainly in the goal and the boundaries, not in how rigorous the work is.
Can you test a chatbot built on OpenAI, Anthropic or an external model?
The test focuses on your system: the application layer, access controls, information sources and tools. The model provider has no access to your test data, so its approval is not required for testing your own implementation. If the scope needs to include the model's own environment, that is checked with the provider in advance.
Is the model provider's approval required?
Usually not, when the test is limited to your system. If the scope includes access to a model hosting environment or to provider resources, their approval is required — and that is settled before testing starts.
How do you test the security of AI agents?
We examine which tools the agent can invoke, what permissions each tool holds, whether the agent verifies that the invoking user is actually authorized for the action, what happens when a tool returns hostile content, and where human approval is required before an impactful action.
What is a prompt injection attack?
A situation where input reaching the system — from the user or from a document the system ingested — causes the model to give instructions a weight they should not have. Direct injection comes from the user; indirect injection comes from external content the system read.
Can RAG expose other users' documents?
Yes, when access control is checked only on the final answer and not at the retrieval step. If documents are pulled from a single store without filtering by the user's permissions, chunks of documents that should be out of scope can end up in the answer.
What is required from the customer before the test?
A definition of the system and the scope, test accounts in the relevant roles, two organizations or tenants for isolation testing, information sources for the test, and written authorization from the authorized party. Access details and passwords are not sent through the website form.
How long does an AI security test take?
Duration is set after the scope is defined: the number of models, the architecture type, how many agents and tools exist, which information sources are involved, and what constraints a third-party provider imposed. There is no uniform timeframe, and therefore no price list either.
What do you receive at the end?
A report with an executive summary, scope, architecture and threat model, findings with severity, evidence, business impact, remediation guidance and limitations. Retesting is performed only if it was set in the agreement.

Want to understand what needs testing in your AI system?

Tell us briefly what kind of system you run, and we can examine the appropriate security test scope and the requirements to start.

  • Which AI capability runs today, and in which environment
  • Which information sources the system accesses
  • Whether an agent invokes tools, and which ones
  • Whether a report is needed for a customer or a procurement process

Request an AI test scope assessment

Please don't send passwords, API keys, access credentials or confidential information in this form.

Get a Pentest Quote