Examining LLM Systems with System Prompts, RAG and Tools

A modern LLM application is not just a model. System prompts, retrieval, knowledge sources, tools, permissions and external services can materially affect the observed behavior.

By Mathias Ellmann English version: 21 October 2026

AI & Machine Learning

A modern LLM application is technically more than a base model. System prompts, retrieval, vector search, knowledge sources, tool calls, agent logic, moderation, permissions and external APIs can materially influence the observed result. A technical examination therefore needs to define the relevant application system, not merely the model name.

Short answer

At minimum, document the model and version, system and developer instructions, retrieval pipeline, knowledge sources, tool interfaces, permissions, runtime parameters and relevant safeguards. A single prompt output is a finding for that specific context; it is not a general property of the model or system.

Examination chain

From the subject of examination to a documented technical conclusion

1 Inventory Record the model, prompts, RAG, tools and security logic.
2 State Document versions, knowledge sources, parameters and permissions.
3 Test Examine representative inputs and system paths reproducibly.
4 Limits State stochasticity, provider changes and external dependencies.

1. Distinguish the model from the application system

The base model produces outputs inside an application whose orchestration supplies additional context and may trigger actions. Model provider, API version, gateway, prompt template, retrieval configuration and tools can change independently. A system that uses the same marketed model name can therefore behave differently after changes elsewhere in the application chain.

A technical examination should document which components were active in the disputed or otherwise relevant system state. With SaaS models, the exact server-side model state or provider-side change history can only be recorded to the extent that the provider exposes it technically. The resulting limitation belongs in the conclusion.

Reproducing a test requires more than the user prompt. System instructions, developer instructions, decoding parameters, tool state, permissions and the relevant knowledge sources can all be necessary to reconstruct the tested conditions.

2. System prompts and instruction hierarchy

System and developer prompts define instructions that a user may not see. For a traceable examination, the relevant question is which version was actually used and whether additional dynamic instructions were inserted at runtime. Prompt templates, policy layers and routing logic should therefore be treated as versioned technical artifacts where possible.

OWASP describes prompt injection as a risk in which inputs can unintentionally alter the behavior of an LLM application. Retrieval-Augmented Generation or fine-tuning do not automatically remove that risk. A technical test may therefore examine how external content enters the context, whether trust boundaries are explicit, which validation or isolation mechanisms exist, and what actions become possible after a model output.

The finding should distinguish the model output from the behavior of the surrounding application. A problematic action can depend on application code, permissions or tool handling even when the underlying text generation is unchanged.

3. Retrieval-Augmented Generation and knowledge sources

In a RAG system, the document corpus, chunking strategy, embeddings, search parameters, filters and ranking logic determine which context reaches the model. An answer can therefore change while the base model and user prompt remain identical.

For traceability, document the knowledge base, index state, retrieval parameters and, where available, the documents or chunks actually retrieved for the tested request. A citation displayed in the user interface is not automatically identical to the context that was internally supplied to the model.

Errors can originate from missing documents, an outdated knowledge base, unsuitable retrieval, ranking behavior or the model's interpretation of retrieved context. These causes should be examined separately rather than collapsed into the statement that “the LLM was wrong.”

4. Tools, agents and permissions

LLM applications can use tools to read files, call APIs, execute code or initiate business processes. The permission and control architecture therefore becomes part of the subject of examination. Relevant artifacts can include tool definitions, service accounts, authorization scopes, confirmation steps and execution logs.

Particular attention should be paid to the scope and privileges of service accounts, confirmation mechanisms for consequential actions, input validation and the treatment of tool outputs as potentially untrusted input. The same model output can have very different consequences depending on the permissions attached to the tool layer.

OWASP's GenAI security work covers both LLM-based and agentic applications. Such risk catalogues can structure an examination, but they do not establish a finding for a concrete system. The actual finding must be obtained from the real configuration, data flows, permissions and observed behavior.

5. Reproducibility and limitations

LLM outputs can be stochastic. Reproducibility therefore often does not mean obtaining byte-identical text. Instead, the examination should document the test conditions, repeat relevant trials and define measurable criteria for the property being assessed. Where seeds or deterministic settings are available, they should be recorded, while their technical limitations remain explicit.

A single successful or problematic prompt does not establish general robustness, safety or unreliability. Test set, prompt variants, attack assumptions and detection limits must match the intended conclusion. If only a narrow input class was tested, the conclusion remains narrow as well.

NIST AI 600-1 treats generative AI as a specific risk profile within the AI Risk Management Framework. For technical examination, the relevant consequence is to consider risks across the system context and lifecycle rather than isolating only the base model.

6. Configuration manifest and reproducible test matrix

A configuration manifest is useful for examining an LLM system. It can record the marketed model name and, where available, the concrete model version; system prompt; relevant prompt templates; retrieval configuration; embedding and index state; tool interfaces; permissions; security filters; and decoding parameters.

A test matrix should not merely repeat a few example prompts. It should map input classes to expected system paths, permitted tool actions, relevant knowledge sources and observed outputs. With stochastic generation, multiple repetitions can be needed so that a single random outcome is not overinterpreted.

External states require particular attention. A RAG index may be updated, a tool can return changing data, and a provider may replace a model behind the same product name. Such changes are revision triggers and must be considered when later attempts are made to reproduce an earlier finding.

Limitation: A reproduced problematic output is a technical finding about the examined system state and tested conditions. It does not establish a general property for all possible inputs and does not by itself prove a legal or organisational breach.
Why is an LLM not the entire subject of examination?

Modern GenAI applications contain more than the base model. System prompts, retrieval, vector search, tools, permissions and application code can materially change observed behavior.

NIST AI 600-1 addresses generative AI as a system and risk context. OWASP also identifies prompt injection, excessive agency and weaknesses in vector and embedding components among relevant GenAI risk areas.

A technical examination therefore addresses the application chain actually in use, not merely the name of the underlying model.

Examination questions

Is the LLM system examination traceably scoped?

  • Are the base model, provider and, where available, the concrete model state documented?
  • Are the system prompt and relevant prompt templates preserved with version context?
  • Are RAG sources, index state, embeddings and retrieval parameters recorded?
  • Are tool interfaces and their actual permissions documented?
  • Are decoding parameters, seeds or a repetition strategy defined for the tests?
  • Are external state changes and provider changes treated as revision triggers?
  • Is the conclusion limited to the tested input classes and documented system state?

Constructed example

An assistant answers a question differently after a document in the knowledge base is updated. The base model is unchanged. The examination shows that the new index retrieves a different passage and that this context changes the response. The technical finding therefore concerns the RAG pipeline and index state, not the base model alone.

The example is constructed and does not describe a real engagement.

Sources and technical basis

  • Official technical guidance NIST AI 600-1: Generative Artificial Intelligence Profile, a profile of the AI Risk Management Framework. Open source.
  • Technical security framework OWASP GenAI LLM Top 10 2026, used as a current structured reference for key security risks in LLM-based applications. Open source.
  • Author's methodology Sources and methodology of the German knowledge base. Open German source.
  • Official technical guidance NIST AI RMF 1.0, used as the overarching voluntary framework for managing AI risks. Open source.
  • Technical security reference OWASP Top 10 for Agentic Applications 2026, used as a reference for risks in autonomous and tool-using agentic systems. Open source.

Further reading

Translation and methodological scope

This English article is based on the reviewed German V1 source article. The translation preserves the technical meaning, methodological distinctions, source status and stated limitations. It does not strengthen technical findings into legal conclusions and does not treat technical references as proof of compliance or suitability for a specific system.

Source relationship: The corresponding German article remains the reference baseline during English V1 development. Open the German source article.

Author's technical literature and publications

The following works provide additional technical and methodological context. They do not replace required primary sources, standards, manufacturer documentation or other independent specialist sources. Unpublished manuscripts, drafts and teaching materials are deliberately not presented here as public sources.

Mathias Ellmann, IT expert

Data Science & AI Assessments

Technical examination of data quality, model validity, reproducibility, bias, robustness and documented AI-system behaviour.

Explore this assessment service