JustujuAI, layer by layer.Open in the interactive map

AI features inside products

AI built into ordinary apps as buttons and features, where the app's own server calls a model API behind the scenes.

Layer 9 · Applications & Interfaces · Run time · reviewed 2026-10-30

Read first: Retrieval-augmented generation (RAG).

SimpleA plain explanation, one diagram and an analogy, with where the analogy breaks.

Guess first: Look at the diagram: which part talks to the model for the app?

Show the answerThe app's computer, far away. It asks the model and passes the answer back to your phone.

Lots of apps now have an AI button: summarise this, tidy my writing, find similar photos.

There may be no chat box at all. When you press the button, the app quietly asks a model and shows you the answer.

The usual pattern: the app's server builds a prompt from a template plus your data (often found with retrieval), calls a model over an HTTP API, and gets text or structured JSON back to show in the interface.

The API key stays on the server, never in the web page or phone app. Many products route calls through a gateway that can switch models and providers, using a small, cheap model for simple jobs and a larger one for hard ones.

Model output is treated as untrusted input: it is checked before it is shown, stored or used to trigger actions, and usage is logged and limited to control cost.

PersonAppApp serverModel APItaps Summarisedocument idprompt + documentsummary as JSONchecked resultshows summary
What happens when you press "Summarise"

Like: A café that buys its bread from a bakery.
Where it breaks: A bakery makes the same loaf every day. A model can return a different or wrong answer, or one steered by text hidden in your document, so the app must check what comes back.

ResearchWhere the simple picture breaks, open problems and primary sources.

Adding a model to a product is easy to demo. Keeping it correct, safe and affordable once real users and real data flow through it is harder.

Injection through content. Anything users or third parties put into a prompt can carry instructions; OWASP lists prompt injection first among risks for LLM apps (OWASP LLM01).

You own what it says. A tribunal held an airline responsible for wrong fare advice from its website chatbot, rejecting the argument that the bot was a separate entity (Moffatt v. Air Canada, 2024).

Checking quality at scale. People's grading criteria shift as they see outputs ("criteria drift"), so automatic graders need regular checking against people (Shankar et al., 2024).

Output into other systems. Passing model output straight into a browser, database or shell opens the door to classic attacks (OWASP LLM05:2025).

Security on this concept: 1 threat Pending expert review

Chatbot output runs as code in someone's browser Pending expert review

Exposed
  • Web pages and support consoles that display model output
  • The sessions and cookies of the people viewing it
Attacks
  • Prompting the bot to output HTML or script that the page then runs (cross-site scripting)
  • Making the reply load an image whose address carries stolen data
Real case
Research demonstration: Cross-site scripting through a support chatbot (2025-08)
Controls
  • Treat model output as untrusted input: escape it before display
  • A strict content security policy; no automatic loading of remote images
  • Validate output before it reaches a browser, database or shell
Owner
AppSec
Reference
LLM10:2026 Improper Output Handling
AML.T0077 LLM Response Rendering

All layers in the security view

Examples as of 2026-10-30

Sources

  1. Building effective agents (Anthropic) (2024-12-19)
  2. OWASP Top 10 for LLM Applications 2025 (2025)
  3. Using the Messages API (Claude API documentation) (2026)
  4. OWASP Top 10 for LLM Applications: LLM01:2025 Prompt Injection (2025)
  5. Moffatt v. Air Canada, 2024 BCCRT 149 (Civil Resolution Tribunal of British Columbia) (2024-02-14)
  6. Who Validates the Validators? Aligning LLM-Assisted Evaluation of LLM Outputs with Human Preferences (2024-04-18)
  7. OWASP Top 10 for LLM Applications: LLM05:2025 Improper Output Handling (2025)

How it connects

More in Layer 9 · Applications & Interfaces