November 18th, 2026 at 07:42 am
By Ronak Shah, Nordstone
Last updated: November 2026
To ship an LLM feature in a mobile app, put the model calls behind your own API, test answers against a fixed set of real questions, add moderation and output checks, control latency and cost per request, and release gradually with a server-side kill switch. A prototype shows the idea works; these steps show it keeps working.
TL;DR
- Keep model calls on the server: the NCSC secure AI development guidelines cover design, deployment and operation, and OWASP’s system prompt leakage entry is a reason not to ship prompts or keys inside the app.
- Test against a fixed set of real questions before launch, because OWASP lists misinformation as a named risk; a starting set of 50 to 100 questions is a common rule of thumb.
- Treat model output as untrusted and keep actions small: OWASP’s improper output handling entry covers passing model text on unchecked, and its excessive agency entry covers giving a model too much power to act.
- Design for latency and cost together: Nielsen Norman Group’s response-time limits of about 0.1, 1 and 10 seconds are a useful yardstick, and OWASP lists unbounded consumption as the cost risk to cap.
- Release in steps with a server-side kill switch, because app store review is too slow to fix a live AI problem; Google Play’s staged rollouts help with the app itself.
- UK GDPR still applies: the ICO guidance on AI and data protection is the main UK reference and is under review following the Data (Use and Access) Act, and EU users bring EU AI Act transparency rules.
What changes between an LLM prototype and a production feature?
A prototype answers a handful of friendly questions on a developer’s laptop. A production feature meets thousands of real users, odd inputs, slow networks, hostile prompts, provider outages and a monthly bill. Most of the work lies in the parts a demo skips: testing, safety checks, speed, cost limits, monitoring and a safe way to release.
Plan for those parts from the start. If you are still choosing what the feature should do, our guides to building an AI chatbot into a mobile app and building a RAG chatbot cover the starting points. This article picks up from there: what has to be true before real users see it.
Be clear about the job first. Write down what the feature must do, what it must never do, who it is for and how you will know it is working. Those statements become your test set, your guardrails and your launch criteria.
How should you structure an LLM feature in a mobile app?
Keep the model calls on the server, behind your own API. The phone should never hold provider keys or the full prompt, and it should not talk to the model directly. Your API checks who the user is, applies limits, runs input checks, builds the prompt, calls the model, checks the output and returns the reply.
Two design choices pay off later. First, put the model behind an abstraction so that you can change provider or model without rewriting the app. Second, keep prompts and settings in server-side configuration, not in the app binary, so that you can fix a problem the same day without waiting for an app store review.
Figure 1: what happens to one request in a production LLM feature.
On the screen, stream the reply so words appear quickly, handle a dropped connection without losing what the user typed, and show a clear message when the feature is unavailable. Decide what the app does when the model is down: a plain fallback, a simpler answer or a route to a person. If part of the feature could run on the phone, our guide to on-device AI vs cloud AI explains the trade-offs.
How do you test an LLM feature before launch?
Build an evaluation set before you build much else. As a rule of thumb, start with about 50 to 100 real or realistic questions and add every failure you find; it is a common starting point, not a standard. Each one has a note on what a good answer looks like: the expected facts, the source document if you use retrieval, and any answer the feature should refuse. Include awkward cases such as vague questions, questions outside scope, misspellings and attempts to make the model break its rules.
Score answers against a simple rubric that you write down: is it correct, is it grounded in the supplied material, is the tone right, did it refuse when it should. People should review a sample, because automated scoring can miss subtle errors. Some teams use a second model to grade answers at scale, which can help, but it needs checking against human judgement before you trust it.
Then treat the set like a regression test. Re-run it whenever you change the prompt, the retrieved content, the model or its settings, and keep the results. Evaluation tools exist to run this for you; examples include open-source tools such as Promptfoo and Ragas, and the evaluation features in observability products such as Langfuse and LangSmith. These are examples, not recommendations. A spreadsheet and a script are enough to start.
Set pass marks in advance, agreed with the product owner, and do not launch if the feature misses them. For example (illustrative only): at least 90 of 100 answers rated correct and grounded, every one of the 10 questions the feature must refuse refused, and no unsafe replies at all. Choose your own figures for your risk level. OWASP lists misinformation as a named risk for LLM applications, and a fixed test set is the most direct way to see how often your feature produces it. Our QA best practices guide and bug-finding guide cover the wider testing around the AI itself, such as devices, networks and release checks.
How do you moderate and guard an LLM feature?
Put checks on both sides of the model. On the way in, limit message length, remove or flag content you do not allow, and look for attempts to override your instructions. On the way out, check the reply before the user sees it: is it in the format you expect, free of anything unsafe, and within the topics you allow?
The table below sets out the main controls and related risk, using entries from the OWASP Top 10 for LLM applications where one applies. Treat it as a checklist to adapt, not a complete security programme.
| Control | What it protects against | How to test it | Related risk |
| Input checks | Abuse, banned content, attempts to override instructions | Run a set of hostile and off-topic prompts | Prompt injection (LLM01) |
| Output checks | Unsafe or badly formatted replies reaching users or other systems | Feed known bad outputs and confirm they are blocked | Improper output handling (LLM05) |
| Evaluation set | Wrong or invented answers | Score a fixed question set after each change | Misinformation (LLM09) |
| Usage limits and app attestation | Runaway cost, degraded service and bots | Load-test, trigger the limits and try calls from a modified app | Unbounded consumption (LLM10) |
| Permission checks | Users seeing content they should not | Test with accounts at different access levels | Sensitive information disclosure (LLM02) |
| Action confirmation and least privilege | A model sending messages or changing data it should not | Try to trigger each action without confirmation and with a low-privilege account | Excessive agency (LLM06) |
| Prompts and keys kept on the server | Instructions and secrets being extracted from the app | Inspect the app package and network traffic for prompts and keys | System prompt leakage (LLM07) |
| Kill switch and fallback | A bad release harming users | Switch off in staging and confirm the plain fallback appears | General resilience, not an OWASP entry |
Mobile apps face one more abuse risk: bots and tampered copies of your app calling your API directly and running up your model bill. Use app attestation alongside login and rate limits. Apple’s App Attest service, part of DeviceCheck, lets your server confirm that requests come from a genuine instance of your app, and Google’s Play Integrity API checks that requests come from your genuine app on a genuine Android device. Both vendors present these as one signal in a wider anti-abuse approach, not a complete defence.
Moderation tools are available from model providers and as separate services; for example, some providers offer a moderation endpoint, and open-source classifiers can run in your own environment. Whichever you use, test it on your own content and languages, because false alarms annoy users and gaps cause harm.
Give users a way out. Let them report a bad answer, show when they are talking to an AI, and offer a route to a person for anything that matters. If the feature can take actions, such as sending a message or changing data, require confirmation and keep the permissions as small as possible. The NCSC guidelines for secure AI system development are a sound UK reference for building these controls in.
How do you keep latency low on a mobile app?
Users judge speed by how soon something appears, not by how long the full answer takes. Nielsen Norman Group’s three response-time limits are a useful rule of thumb: about 0.1 seconds feels instant, about 1 second keeps a user’s train of thought unbroken, and about 10 seconds is the limit of their attention. For an LLM feature that means aiming for the first words within about a second, showing progress from the start, and offering a cancel option or a background route for anything that runs towards 10 seconds. Stream the reply so the first words show quickly, show a progress cue straight away, and let people read as it arrives. Set sensible timeouts and retries so that a slow request fails clearly instead of hanging.
Cut the work the model has to do. Shorter prompts and shorter history mean less to process. Use a smaller, faster model for simple tasks and keep the larger one for the hard ones. Run retrieval and input checks in parallel where you can, cache answers to frequent identical questions, and put limits on reply length.
Measure on real phones and real networks, not only in the office. Track the time to the first words, the time to the full reply and the share of requests that fail or time out, and set targets that your team agrees before launch.
How do you control the cost of an LLM feature?
Cost grows with use, so decide limits before launch. Model charges depend largely on how much text goes in and out. Cap message length and history, limit reply length, cache common answers, and route simple requests to cheaper models. Set rate limits per user and per day, and put spend alerts on your provider account so that a bug or an abusive user cannot run up a large bill overnight. OWASP lists unbounded consumption as a risk for exactly this reason. On mobile, add app attestation (see the table above), so that bots and modified copies of your app cannot call your API.
Measure cost per conversation and per active user from the first week of testing, and compare it with the value the feature creates. Our AI cost guide gives UK planning ranges of £28,000 to £80,000 over 8 to 14 weeks for LLM-powered conversational AI, and £20,000 to £60,000 over 6 to 12 weeks for AI-powered semantic search. Treat these as starting points and ask suppliers to price your own scope, including running costs. Our article on hidden costs of app development is a useful check for items that are easy to miss, and our guide to who owns the code in a UK app project covers who owns your prompts, evaluation sets and data.
What should you monitor after launch?
Log enough to investigate problems, and no more than you need. Track error rates, latency, cost, refusal rates and how often users report a bad answer. Sample real conversations every week and score them with the same rubric as your test set, so that quality problems show up as numbers and not as complaints.
Watch for change you did not make. Providers update models, and a new version can alter behaviour. Where the provider lets you, pin the model version and test a new one against your evaluation set before switching. Keep a record of each prompt, model and setting change so that you can trace a drop in quality to its cause.
Have an incident plan: who is told, who can switch the feature off, how you tell users and how you fix the cause. Check what personal data your logs hold, set a retention period and make sure it matches your privacy notice.
How should you release an LLM feature?
Release gradually. Start with offline tests, move to an internal beta, then a small share of users, then a wider group, and watch quality, latency and cost at each step. Control the rollout from the server with a feature flag, so that you can pause or reverse it at once without waiting for an app store update.
Figure 2: a gradual release path, with a way back at every step.
Write your release gates down in advance and apply them to every release, as you would for any other feature: no open critical bugs, evaluation scores above the agreed marks, cost per conversation within budget, and sign-off from the product owner. Keep a kill switch that disables the AI feature and shows a plain fallback.
What does UK law add for an LLM feature?
If the feature handles personal data, UK GDPR applies as it does elsewhere. The ICO’s guidance on AI and data protection is the main UK reference, and the ICO says it is under review following the Data (Use and Access) Act, so check its page for updates. It covers lawful basis, fairness, transparency, security and accountability.
If an outside provider runs the model, they are likely to be your processor, so you need a written contract that meets the ICO’s controller and processor requirements, and a check of where data is processed under the ICO’s rules on international transfers. Tell users what happens to their messages, and as good practice make clear they are talking to an AI. A data protection impact assessment is often sensible, and may be required where the use is high risk.
If the feature influences decisions about people, such as eligibility, pricing or access to a service, the automated decision-making rules also matter. The Data (Use and Access) Act replaced the old Article 22 with new rules; the ICO confirms that most of the Act’s remaining data protection provisions came into force on 5 February 2026 (ICO statement), and section 80 of the Act sets out the new automated decision-making rules. They allow significant automated decisions in more circumstances, but expect safeguards such as telling people about the decision, letting them make representations, obtaining human intervention and contesting it, and decisions using special category data remain more tightly restricted. Check the current wording with the ICO or your legal adviser before launch. Our UK GDPR for apps checklist covers the wider app. This is general information, not legal advice.
If you serve users in the EU, the EU AI Act also matters. The European Commission’s page says Article 50 transparency obligations apply from 2 August 2026, and in general they require people to be told when they are interacting with an AI system unless that is obvious. Transitional arrangements for systems already on the market, and the changes the Digital Omnibus made to other parts of the Act, vary, so take advice before relying on any date.
Frequently asked questions
What does production-ready mean for an LLM feature?
Should the app call the LLM provider directly?
How do I test whether my LLM answers are good enough?
How do I stop an LLM feature from costing too much?
How do I make an LLM feature feel fast on a phone?
Do I need a kill switch for an AI feature?
Does UK GDPR apply to an LLM feature?
How long does it take to ship an LLM feature?
Conclusion
Shipping an LLM feature is less about the model than the work around it. Define the job, test against real questions, guard both input and output, limit speed and cost, and release in steps with a way back. Do that, and the feature can keep working after the novelty fades.
Use our one-page LLM launch checklist (download) to run these checks before each release. If you are planning an AI feature for your app, our app development brief template helps you set out the scope before you speak to suppliers. To ta