# Pośrednie wstrzykiwanie promptu (przez dokumenty i narzędzia)

EN: **Indirect prompt injection** · id `indirectinjection`

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Bezpieczeństwo i governance](https://aiatlasgraph.com/t/safety.md) › [Bezpieczeństwo aplikacji AI](https://aiatlasgraph.com/t/security.md) › [Ataki przez prompt](https://aiatlasgraph.com/t/promptattacks.md) › Pośrednie wstrzykiwanie promptu (przez dokumenty i narzędzia)

## Description

- PL: Atakujący nie rozmawia z modelem — ukrywa polecenia w stronie, mailu, pliku czy wyniku narzędzia, które aplikacja LLM sama pobierze. Szczególnie groźne dla RAG i agentów, bo może prowadzić do kradzieży danych lub niechcianych działań.
- EN: The attacker never talks to the model — they hide instructions in a web page, email, file or tool result that the LLM application will fetch itself. Especially dangerous for RAG and agents, as it can lead to data theft or unwanted actions.

## In one sentence

- PL: To ukrywanie złośliwych poleceń w dokumentach lub wynikach narzędzi, które model sam pobiera.
- EN: This hides malicious instructions in documents or tool results that a model retrieves.

## Problem it solves

- PL: Asystent czyta stronę dla ciebie, a jej autor może próbować przejąć wpływ na dalsze działania.
- EN: An assistant reads a page for you, while its author may try to influence the assistant's later actions.

## What it does

- PL: Polecenie przychodzi jako rzekoma treść do analizy; gdy system przyzna mu rangę instrukcji, może zmienić odpowiedź lub użycie narzędzi.
- EN: An instruction arrives disguised as material to analyse; if treated as authoritative, it can change responses or tool use.

## Everyday example

- PL: Dokument przesłany do streszczenia zawiera żądanie wysłania prywatnych notatek, choć użytkownik prosił tylko o skrót.
- EN: A document submitted for summarisation demands private notes be sent elsewhere, although the user requested only a summary.

## This concerns you if you…

- PL: asystent pobiera strony, pliki lub wiadomości
- PL: narzędzia zwracają treści od innych osób
- EN: let an assistant retrieve pages, files or messages
- EN: use tools that return other people's content

## Keywords

untrusted context · tool output injection · data exfiltration · taint tracking · instruction-data separation · CaMeL

## How it works

- PL: Atakujący umieszcza instrukcje w materiale pobieranym przez wyszukiwarkę, narzędzie lub pamięć agenta. Po włączeniu materiału do kontekstu model może pomylić dane z poleceniem, zmieniając odpowiedź albo dalsze wywołania.
- EN: An attacker places instructions in material retrieved through search, tools or agent memory. Once incorporated into context, a model can confuse data with instructions and change answers or subsequent calls.

## Limits

- PL: Skanowanie pojedynczego dokumentu może pomijać zależności między materiałami i etapami. Obrona musi zachować pochodzenie danych oraz uprawnienia; brak widocznego ataku w odpowiedzi nie dowodzi bezpiecznego wykonania.
- EN: Scanning one document can miss cross-material and cross-stage dependencies. Defence must preserve provenance and permissions; no visible attack in an answer does not establish safe execution.

## Key terms

- PL: **niezaufany kontekst**: Pobrana treść, której nie wolno nadawać uprawnień instrukcji użytkownika.
- PL: **taint tracking**: Śledzenie pochodzenia danych, aby ograniczać ich wpływ na operacje.
- EN: **untrusted context**: Retrieved content that must not inherit user-instruction authority.
- EN: **taint tracking**: Tracking data provenance to constrain its influence on operations.

## Know first

- [Wyszukiwanie i RAG (Retrieval-augmented generation)](https://aiatlasgraph.com/t/retrieval.md)
- [Narzędzia i integracje (Tool use and integration)](https://aiatlasgraph.com/t/tools.md)

## Examples

- PL: ukryty tekst na stronie · złośliwy mail do asystenta · eksfiltracja przez link
- EN: hidden text on a web page · malicious email to an assistant · link-based exfiltration

## Related topics

Untyped, symmetric "see also" links.

- [Bezpieczeństwo agentów: uprawnienia i izolacja (AI agent security)](https://aiatlasgraph.com/t/agentsecurity.md)
- [Narzędzia i integracje (Tool use and integration)](https://aiatlasgraph.com/t/tools.md)
- [Wyszukiwanie i RAG (Retrieval-augmented generation)](https://aiatlasgraph.com/t/retrieval.md)

## Sources

- [OWASP Top 10 for LLM Applications 2025](<https://genai.owasp.org/llm-top-10/>) `owasp-llm-top10-2025` · by OWASP Gen AI Security Project
- [Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection](<https://arxiv.org/abs/2302.12173>) `indirect-prompt-injection-greshake-2023` · by K. Greshake, S. Abdelnabi, S. Mishra, C. Endres, T. Holz, M. Fritz
- [Defeating Prompt Injections by Design](<https://arxiv.org/abs/2503.18813>) `camel-debenedetti-2025` · by E. Debenedetti, I. Shumailov, T. Fan, J. Hayes, N. Carlini, D. Fabian, C. Kern, C. Shi, A. Terzis, F. Tramèr

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/indirectinjection · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
