IT Security · AI SECURITY

AI application security: prompt injection, data leaks and the OWASP Top 10 for LLMs

Remote Admin Security Team·November 23, 2026·23 min read

AI application security covers everything an ordinary web or mobile application needs, plus one more layer: protection against content that tries to steer the model, against data leaking in answers, and against an assistant whose permissions are too broad. The reference point is the OWASP Top 10 for LLM Applications. The most important design rule is this: a language model can be talked into a mistake, so the application code, not the model, decides what a user may see and do.

This article is written for people who commission software and are accountable for what it does, not for penetration testers. We describe classes of threat at the level needed to understand the safeguards, without attack techniques. If you are planning a web or mobile application with an AI module, by the end you will know how to talk to a vendor about AI application security, what to require in the contract and what to check before launch.

Legal status as of November 2026. This article is for information only and is not legal or tax advice.

How does AI application security differ from the security of an ordinary application?

The main difference is that in an application built on a large language model (LLM), instructions and data reach the model through the same channel: as text. In classic software, program code and user data can be technically separated. A language model receives the instruction written by the application’s developers, the user’s question and the content of a document as one stream of text. No reliable mechanism tells it that a sentence from an attachment is information to process and not a command to carry out.

Four differences follow from this, and each matters when you commission software:

  • Every piece of content the model reads is a potential input for an attacker: a PDF invoice, an e-mail, a customer ticket, a web page.
  • The model is non-deterministic. The same question can produce different answers, so resistance is checked with series of attempts, not with a single test.
  • The model is often connected to tools. An assistant that can send a message or save a record in an ERP system turns a mistake in an answer into a mistake in an action.
  • There are new components to protect: a vector database holding fragments of documents, the model files, the system prompt and the connection to the model provider.

The classic list still applies: login, roles, sessions, the API, the database and server updates. The AI module does not replace these safeguards. It adds its own on top of them.

What is the OWASP Top 10 for LLM Applications and how should you use it?

The OWASP Top 10 for LLM Applications is OWASP’s published list of the ten most important risk categories in applications that use large language models; the current edition is labelled 2025. The full list with descriptions is publicly available. OWASP also maintains the Top 10 for web applications, the ASVS verification standard and the MASVS standard for mobile applications. An application with AI uses them together.

For a buyer of software, the OWASP LLM Top 10 has three uses: it is a shared vocabulary for talking to the vendor, a checklist at acceptance, and the natural scope for testing the AI module. For each item the vendor should be able to say how the application protects itself, or why that risk does not apply. The list is not a formal standard or a certificate, and it does not replace a risk analysis of the specific system.

The table summarises all ten items; the sections that follow expand on them. Every example in this article is illustrative and does not describe any specific deployment or incident.

Risk (OWASP name) Illustrative example Basic safeguard
LLM01 Prompt Injection Hidden text in an e-mail tries to give the assistant an instruction. External content treated as untrusted; business rules kept outside the model.
LLM02 Sensitive Information Disclosure The assistant summarises a payroll document for an employee who has no access to it. Permissions checked before any content reaches the model.
LLM03 Supply Chain A model or library is downloaded from a public repository without checking where it came from. Component inventory, pinned versions, dependency scanning.
LLM04 Data and Model Poisoning A document with a false procedure ends up in the knowledge base. Control over what feeds the knowledge base; the source shown in the answer.
LLM05 Improper Output Handling The model’s answer is placed on a page without escaping and the browser runs foreign code. Model output treated like data from an unknown user.
LLM06 Excessive Agency An assistant that should only look up orders can also cancel them. Least privilege; approval by a person.
LLM07 System Prompt Leakage A customer extracts the system prompt, which has a password written in it. No secrets in the prompt; the code enforces the rules.
LLM08 Vector and Embedding Weaknesses A shared vector database returns one company’s contracts to an employee of another. Permissions attached to every fragment; data separation.
LLM09 Misinformation The assistant quotes a clause of the terms and conditions that does not exist. Answers grounded in sources; refusal when there is no source.
LLM10 Unbounded Consumption A public chat without limits is flooded with automated queries. Per-user limits; budgets with alerts.

Prompt injection: how can a document or an e-mail give the model an instruction?

Prompt injection (LLM01) happens when text supplied to the model is treated by the model as an instruction, not as data to process. The author of that text may be a user of the application, but just as easily the sender of a message or the issuer of a document.

Direct and indirect injection

In the direct variant, a user tries in conversation to persuade the assistant to ignore the rules it was given. The indirect variant is more dangerous for companies, because the attacker does not need an account in the application. It is enough for their content to land wherever the application collects data: in a mailbox, in an attachment or in a contact form.

An illustrative scenario: an application reads orders that arrive by e-mail and prepares them for entry into the sales system. The sender places in the message a passage that a person cannot see, for example written in the background colour, addressed directly to the model. The employee sees an ordinary order. The model sees the whole text and may take the hidden passage for part of its instructions. In the same way, an invoice may carry an added note meant to make the model report a different bank account number from the one the company uses to pay that supplier.

Why a filter alone is not enough

No known method removes prompt injection completely at the level of the model itself. Input filters and additional instructions reduce the number of successful attempts, but they give no certainty, because the same intention can be phrased in a great many ways. A mature design therefore assumes that the model will be deceived sooner or later, and the job of the architecture is to make sure nothing serious comes of it.

Safeguards at the architecture level

  • External content is untrusted. The component that reads untrusted documents never has, at the same time, access to sensitive data and a way to send anything outside the company.
  • Structured output. The model returns fields in an agreed schema, for example document number, amount and supplier, and the application validates them. Free text from the model never triggers an operation.
  • Business rules outside the model. The bank account number is compared with the supplier master data, and any change to it goes through a separate procedure. A rule written in code cannot be persuaded by text from an attachment.
  • Human-in-the-loop. A payment, or a transfer of data outside the company, is approved by a person who sees exactly what will be executed.
  • Control over rendering. The model’s answer does not load external resources on its own, because that is a route by which data can leave the company without the user knowing.

Data leaks: where does information escape from an AI application?

Data can leave an AI application by four main routes: in the model’s answers, through a knowledge base without permission checks, through the system prompt, and through logs and the connection to an external model provider. The first three have their own entries on the OWASP list.

Sensitive information disclosed in answers (LLM02)

Sensitive Information Disclosure is the situation in which the application shows an unauthorised person personal data, commercial terms, salaries or another customer’s data. An illustrative example: a company assistant has access to the whole HR drive, and an employee who asks about the bonus rules receives a summary of a payroll document. The model did not break any safeguard. It was given content it should never have been given.

The safeguard is to move the check in front of the model. The application first establishes which documents the person asking is entitled to see, and only then selects fragments from those documents and passes them to the model. A model that has not seen a document cannot disclose it, however the question is phrased. We describe this principle in more detail in our article on a company knowledge base with AI.

Vector and embedding weaknesses (LLM08)

In applications built on retrieval-augmented generation (RAG), documents are split into fragments and stored in a vector database as numerical representations of meaning, called embeddings. The category Vector and Embedding Weaknesses describes mistakes in this area. An illustrative example: a shared index for several group companies stores no permission information, so a search returns one company’s contract to an employee of another. A second mistake is documents that have been deleted from the drive but still exist in the index. What is needed is permission metadata on every fragment, separation of the data of different customers or companies, and synchronisation of the index with permission changes and deletions.

System prompt leakage (LLM07)

The system prompt is the text in which the application’s developers describe to the model its role and rules. The category System Prompt Leakage is a reminder that a user can extract this text, so it should be treated as public. An illustrative example: the prompt of a sales assistant contains the highest discount it is allowed to give and the password to the warehouse system. Passwords, API keys and rules that security depends on do not belong in the prompt. Secrets are kept on the server side, and access rules are enforced by the application code. The sentence “do not reveal this data” written into a prompt is not an access control mechanism.

Logs and the model provider

Queries and answers written to logs contain the same things as the documents: personal data, amounts, the content of contracts. If the model runs at an external provider and is reached through an API, you need to know where the data is processed, how long it is stored and whether it can be used to train models. The alternative is an open model running on your own or a leased server in Poland, so that documents do not leave the country. We discuss the selection criteria in the article AI model in the cloud or on your own server.

Excessive agency: how much should an assistant with access to tools be allowed to do?

An assistant should be allowed exactly as much as the smallest set of permissions needed for its task, and operations that are hard to reverse should be approved by a person. The category Excessive Agency (LLM06) describes the situation in which the model can do more than its role requires. OWASP points to three sources of the problem: excessive functionality, excessive permissions and excessive autonomy.

An illustrative example: a customer service assistant is meant to answer questions about order status. The team connected it to the sales system through an existing integration account that can also cancel orders and change customer data. When manipulated content reaches the assistant, the extent of the damage is set by the permissions of that account, not by the intentions of the designers.

A practical tool is an autonomy table agreed during the analysis stage. For each operation it states whether the model carries it out itself or only prepares it.

Type of operation Example Reasonable level of autonomy
Reading within the user’s permissions Finding an invoice, checking order status Automatic, with a log entry
Preparing a draft A draft reply to a customer Automatic; a person sends it
Writing to an internal system Creating an order, completing a document’s index After passing validation rules; uncertain cases go to review
External communication Sending an e-mail, sharing a file Approval by a person, or a closed list of templates and recipients
Financial or irreversible operation Ordering a payment, deleting data, changing a supplier’s bank account Only after approval by an authorised person

Technical rules come on top of this. The tools made available to the model are narrow: a separate “find order” instead of a general “run a database query”. The assistant acts in the context of the logged-in user’s permissions, not of a shared technical account. Limits apply to amounts and to the number of operations, and an administrator can switch off the AI module without stopping the whole application.

Improper output handling (LLM05)

Improper Output Handling is a mistake on the application side: the model’s answer is taken as trusted and passed on unchecked, although anyone who supplied text to the model has influenced its content. An illustrative example: the model summarises customer tickets, and the summaries are displayed in the operator’s panel. If the application inserts them into the page without escaping special characters, a suitably prepared ticket can lead to foreign code running in the employee’s browser. Model output is therefore treated like data typed in by an unknown user: it is encoded before display, checked against a schema and passed to the database only through parameterised queries.

Supply chain, data poisoning, misinformation and costs

The four remaining items on the list are not visible in the chat window, which makes them easy to miss when the application is accepted.

Supply chain (LLM03)

An application with AI is assembled from many third-party elements: the model, libraries, ready-made datasets and services reached through an API. The category Supply Chain covers the risk that one of them is vulnerable, has been modified or comes from an uncertain source. An illustrative example: a developer downloads from a public repository a model tuned for the local language, without checking who published it. Some model file formats allow code to run at the moment the file is loaded, so such a file has to be treated as a program, not as data. The safeguards are a component inventory that also covers models, pinned versions, checks of origin and checksums, and dependency scanning. Our article on software supply chain security gives the wider background.

Data and model poisoning (LLM04)

Data and Model Poisoning means deliberately introducing manipulated data into the place where the model learns or draws its knowledge: the training data, the data used for fine-tuning, or the knowledge base. An illustrative example: an assistant’s knowledge base is fed automatically from a shared folder to which many employees and subcontractors can write. Someone adds a document with a false refund procedure, and the assistant starts quoting it as current policy. The protection is to limit who can feed the knowledge base, to approve new sources, and to give answers that name the source document.

Misinformation (LLM09)

Misinformation means answers that sound credible but are untrue, together with people’s excessive trust in such answers. OWASP counts it among security risks because decisions are made on the basis of those answers. An illustrative example: the assistant quotes a clause of the terms and conditions that does not exist, and an employee passes it to a customer as the company’s position. The risk is reduced by answers grounded in documents with the source shown, by refusal when there is no basis, and by human verification wherever a mistake is costly. We have a separate article on this subject: AI hallucinations in business applications.

Unbounded consumption (LLM10)

Every query to the model uses computing power or is billed by the provider. The category Unbounded Consumption describes an application that does not limit this usage. An illustrative example: a public chat on a company website has no limits, so a bot sends it long queries one after another through the night. The bill for a usage-billed model grows, and in the morning customers are left waiting for answers. The safeguards are query limits per user and per IP address, limits on the length of input and output, budgets with alerts, and a requirement to log in before reaching costly functions.

How do you build and maintain an AI application securely?

An AI application is built securely when the security requirements are written together with the functional requirements, not after the work is finished. In practice this means six steps that should be visible in the project schedule.

  1. Data classification and threat modelling. Establishing what data will reach the model, who can supply it with content, what the model can do and what the worst realistic outcome is.
  2. Trust boundaries in the architecture. Separating untrusted content, the model, the tools and the data so that a failure of one element does not open up the others.
  3. Permissions designed before features. Roles, separation of the data of different customers or companies, and an assistant that acts on behalf of a specific user.
  4. Secrets and code review. Keys and passwords kept out of the code and out of the system prompt, dependency scanning, and review of every change by a second person.
  5. A test suite for the AI module. Alongside tests of answer quality, a set of misuse attempts that is run after every change to the model, the prompt or the libraries.
  6. Penetration testing and a response plan. An independent test before launch, and a procedure for an incident: who switches off the module, who analyses the logs, who informs the people affected.

What should go into the logs

Without logs you cannot establish what happened, or show that nothing happened. An application with AI records more than an ordinary one:

  • who asked a question or uploaded a document, and when,
  • which documents and fragments were passed to the model,
  • which tools the model called, with what parameters, and who approved the operation,
  • the version of the model and of the system prompt used for a given answer,
  • refusals, exceeded limits and attempts to reach data outside the user’s permissions.

The logs are themselves a set of sensitive data. They need restricted access, a defined retention period and protection against modification.

Monitoring after launch

Collected events have value only when someone looks at them. An alert should be raised by a sudden rise in the number of queries from one account, a series of refusals or validation errors, unusual tool calls and a jump in model costs. In organisations without their own security team, events from the application can be sent to an external team, for example to our 24/7 SOC. The servers and libraries the application runs on need regular checks with vulnerability scanning, because new flaws in components are disclosed after deployment as well. Where the application runs also matters: hosting in Polish data centres makes it simpler to answer the question of where the documents and logs physically are.

A mobile application with an AI module

The user’s phone is an environment the company does not control. The access key to the model cannot be stored in the application installed on the device, because it can be read out of it. Queries to the model therefore pass through your own server, which checks the user’s identity, permissions and limits. The reference point for requirements and tests is the OWASP MASVS standard.

What does penetration testing of an AI application look like?

Penetration testing of an AI application has two parts: a classic test of the web or mobile application, and a test of the AI module in which the tester, under controlled conditions, tries to make the system break its rules, disclose data and carry out operations that are not allowed. Both parts are needed, because an attacker will choose the weaker one.

The scope of the AI part usually includes:

  • attempts to inject instructions in conversation and through every channel from which the application reads content: uploaded files, e-mails, forms, web pages,
  • attempts to extract the system prompt and to reach the data of another user, department or customer,
  • misuse of tools: calls outside the scope of the role, bypassing approval, exceeding limits,
  • a check of what the application does with the model’s answer before displaying it or passing it on,
  • resistance to excessive resource consumption, and a review of what the logs contain.

What sets these tests apart from classic ones is the way conclusions are drawn. The model answers non-deterministically, so the tester repeats attempts and describes in the report the conditions under which a safeguard failed. The whole system is tested, meaning the model together with the application, the integrations and the permissions, because the consequences depend on what the model is connected to.

The result is a report that rates the severity of each finding and gives recommendations, followed by a retest once the fixes are in. Order a test before production launch and after changes that move the trust boundaries: replacing the model, adding a tool, connecting a new data source or changing permissions. At Remote Admin, penetration testing of web and mobile applications is carried out by our own penetration testers, so the security test can be part of the project and not a separate order placed with yet another supplier. We write about when such a test is justified in the article web application penetration testing: when you need it.

One caveat: a penetration test does not prove that an application has no vulnerabilities. It shows what could be found within a given time and scope, which is why it is complemented by continuous monitoring and by repeating the tests after significant changes.

NIS2, Poland’s KSC Act and GDPR: what does the law require of an AI application?

The rules discussed in this article create two kinds of obligation for an AI application: security of systems and of the supply chain, if the company is covered by the national cybersecurity rules that implement NIS2, and security of processing, if the application processes personal data. Which obligations apply to a specific organisation and use case has to be confirmed individually.

NIS2 and the KSC Act

In Poland, the requirements of the NIS2 Directive are implemented by the KSC Act: Poland’s National Cybersecurity System Act, which transposes NIS2 and was amended by the Act of 23 January 2026 (Journal of Laws 2026, item 252), in force since 3 April 2026. Essential and important entities must ensure, among other things, security in the acquisition, development and maintenance of systems, including testing, and security of the ICT supply chain (Article 8(1)). Companies operating in other EU countries should check the national law that implements NIS2 there.

If your company is an essential or important entity, ordering an application is the acquisition of a system, so the security requirements and the tests should be part of the order and of the acceptance criteria. If your company supplies software or services to such an entity, it will be asked about its security practices, including those that concern the AI module. An NIS2 / KSC audit helps to identify the gaps against the requirements.

GDPR

Company documents contain personal data of sole traders, employees and the people who sign contracts. Processing them in an application is therefore subject to the GDPR. From the project’s point of view, these provisions matter most:

  • Article 32 concerns security of processing; the access control, logging, testing and monitoring described above serve to meet it,
  • Article 5 sets out the principles of data minimisation and purpose limitation, which means passing to the model only the fields needed for the task,
  • Article 28 requires a data processing agreement when an external provider processes the data, for example the provider of a model reached through an API,
  • Article 35 provides for a data protection impact assessment (DPIA) where a high risk is likely,
  • Article 22 concerns decisions based solely on automated processing that produce legal or similarly significant effects.

Details, such as whether an impact assessment is needed in a specific project, should be settled with your data protection officer or a lawyer.

What should you ask the vendor of an AI application before signing the contract?

Ask how the application limits the consequences of a model error, who will test it and when, and which of these arrangements will be written into the contract. AI application security is largely settled by decisions made before the first line of code is written, so these questions are best asked at the quote stage.

Question An answer that shows maturity Warning sign
How does the application protect itself against prompt injection? A description of the limits built into the architecture: untrusted content, narrow permissions, rules in code, approval by a person. “The prompt forbids the model from following such instructions.”
Whose permissions does the assistant act with? The permissions of the logged-in user, checked before content is passed to the model. One technical account with access to everything.
Which operations does the model carry out on its own? A list of operations divided into automatic ones and those that require approval. “Everything the API allows.”
Where is the data processed and what goes into the logs? A named location, a list of processors, the scope of the logs and their retention period. Not knowing where the queries go.
How is a change of model version handled? A controlled change, preceded by the suite of quality tests and misuse attempts. An update done alongside other work, without tests.
Who will carry out the penetration tests, and will they cover the AI module? Penetration testers from outside the development team, a scope based on the OWASP lists, a report and a retest. “We test it ourselves while we code.”

The best place for the answers is the contract, as requirements and acceptance criteria. We explain how to do that in our guide on how to choose a software development company and which contract terms protect you.

FAQ: frequently asked questions

What is prompt injection?

Prompt injection is a type of attack on an application with a language model in which text supplied to the model is treated as an instruction. The text may come from the user, or it may be hidden in a document, an e-mail or a web page that the application reads. It is the first item on the OWASP list for LLM applications (LLM01).

Can an application be fully protected against prompt injection?

No known method gives full resistance at the level of the model itself. What you can do is limit the consequences: narrow permissions, business rules in code, validation of outputs and human approval of significant operations mean that a deceived model has no way of causing serious damage.

What is the OWASP LLM Top 10?

It is OWASP’s published list of the ten most important risk categories in applications that use large language models, with the current edition labelled 2025. It includes prompt injection, sensitive information disclosure, supply chain and excessive agency, among others. For the buyer it serves as a checklist and as a scope for testing.

Can an AI assistant reveal data that an employee has no access to?

It can, if the application passes documents to the model without checking the permissions of the person asking. In a correctly designed application, permissions are checked before fragments are retrieved, so the model receives only content that the user could open on their own.

When should you order penetration testing of an AI application?

Before production launch and after changes that affect the trust boundaries: replacing the model, adding a tool, connecting a new data source or changing permissions. The test should cover both the classic web or mobile part and the AI module.

Is an AI model on your own server more secure than a model reached through an API?

Your own server removes one group of risks: documents do not go to an external provider, and it is easier to state where processing takes place. It does not protect against prompt injection, faulty permissions or excessive agency, because those come from the design of the application, not from where the model runs. You also take on the duty of updating and securing the server yourself.

A free quote for your AI application

We design and build custom web and mobile applications, including ones with AI modules that support business processes. We treat AI application security as part of the project from the first conversation: we plan permissions, logging and limits for the model together with the features, our own penetration testers carry out the security tests, and the finished application can run in Polish data centres with administration and monitoring 24/7. We choose the technology to fit the project.

Tell us about the process you want to improve and the data the application is to handle. We will prepare an initial scope, schedule and budget. The quote is free and without obligation. You will find the details on our web and mobile app development page, and you can start the conversation through the contact page.