AI and LLM Security Testing: Data, Tools and Permissions
Plan AI and LLM security testing around prompt injection, retrieval, tool permissions and sensitive data. Define scenarios and evidence for your application.
AI and LLM security testing examines what an AI-enabled application can access, disclose or change when it receives unexpected or hostile content. The focus is the deployed service, including retrieval, connected tools and the permissions behind them.
A useful LLM application test scope starts with the jobs the system performs. An assistant that answers public questions presents different risks from an agent that reads customer records, updates tickets or triggers payments.
Map the data and action boundaries
Identify who uses the service, which data sources it retrieves from and which actions it can perform. Include document ingestion, search indexes, external content, plugins and background tasks.
| Area | Question to investigate |
|---|---|
| Direct instructions | Can a user redirect the application towards unauthorised data or actions? |
| Retrieved content | Can instructions in a document or external response influence privileged behaviour? |
| Customer separation | Does retrieval enforce the requesting user's access to each source? |
| Tool permissions | Can a model request actions beyond the user's authority or the task's needs? |
| Output handling | Is generated content validated before becoming HTML, code or another system's input? |
| Consumption controls | Are usage, task length and expensive operations bounded? |
OWASP guidance for LLM applications provides useful risk categories. The assessment still needs scenarios grounded in your architecture and intended permissions.
Test beyond a collection of prompts
A surprising answer does not always demonstrate a security vulnerability. Establish the protected asset, the trust boundary and the observed effect.
For example, an invented customer record may show a reliability problem. A response containing a controlled marker from another tenant's restricted document demonstrates a different issue: access to information the user should not receive.
Tool activity should be verified where possible. A model claiming that it sent an email is different from an actual request reaching the mail service. Use application logs, tool responses and controlled destinations to establish what happened.
Prepare a representative test environment
Supply accounts for relevant roles and separate tenants, controlled documents, architecture notes and a list of enabled tools. Record the application version, model configuration, retrieval setup and relevant guardrails.
Use safe destinations for messages, exports and external requests. Identify spending limits and any actions requiring human approval. Agree stop conditions and the handling of sensitive source material before testing.
Where production behaviour depends on a provider-managed model, record that dependency. Model and service updates can change outcomes even when your own code remains stable.
Evaluate controls at the service boundary
Prompts can guide behaviour, but sensitive permissions should be enforced by the application and connected services. Retrieval should check the current user's access, and tool execution should validate the requested action independently.
Human approval is most useful when it shows the actual action, destination and relevant data before execution. An approval step that hides those details can leave the reviewer unable to make an informed decision.
Make results reproducible and useful
Record the starting conditions, relevant input, retrieved material, tool behaviour and observed result. Since outputs can vary, repeat important scenarios enough to describe that variability without presenting a single attempt as a reliable success rate.
Separate prompt injection, data access, excessive permissions and ordinary software weaknesses where they require different fixes. Retesting should verify the deployed controls and important related scenarios.
Repeat focused checks when data sources, tools, models or permissions change. A successful assessment of a read-only assistant does not establish the security of a later version that can act on behalf of users.
Related resources
- API Penetration Testing: Endpoints, Permissions and Workflows
- Cloud Security Testing: Identity, Configuration and Exposure
- Application Go-live Security Checklist for Release Teams
Read our Testing methodology to discuss coverage, or Book a demo with the systems and objectives you have in mind.