# Generowanie łatek na podatności przez modele językowe

EN: **LLM-based vulnerability patch generation** · id `vulnpatchgen` · aliases: automated vulnerability repair, AVR, LLM security patching, AI-generated security fixes, automatyczne łatanie podatności

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [AI w cyberbezpieczeństwie](https://aiatlasgraph.com/t/cyberai.md) › [Szukanie i łatanie podatności z AI](https://aiatlasgraph.com/t/vulndiscovery.md) › [Systemy automatycznego znajdowania i łatania błędów](https://aiatlasgraph.com/t/cyberreasoning.md) › Generowanie łatek na podatności przez modele językowe

## Description

- PL: Modele generatywne proponują zmiany w kodzie, które mają naprawić znaną podatność. Kandydat wymaga testów funkcjonalnych i oceny bezpieczeństwa przed użyciem.
- EN: Generative models propose code changes intended to repair a known vulnerability. A candidate requires functional testing and security evaluation before use.

## In one sentence

- PL: Model proponuje łatkę do podatnego fragmentu kodu, ale programista i testy muszą sprawdzić, czy naprawdę usuwa błąd i nie psuje programu.
- EN: A model proposes a patch for vulnerable code, but a developer and tests must verify that it fixes the bug without breaking the program.

## Problem it solves

- PL: Znalezionych błędów przybywa szybciej, niż programiści zdążają je naprawiać, więc znane dziury czekają miesiącami.
- EN: Bugs are found faster than developers can fix them, so known holes wait for months.

## What it does

- PL: Jak mechanik, który dostaje nagranie stukającego silnika: proponuje naprawkę, a jazda próbna pokazuje, czy stukanie znikło.
- EN: Like a mechanic handed a recording of a knocking engine: proposes a fix, and a test drive shows whether the knock is gone.

## Everyday example

- PL: Po wykryciu podatności w funkcji C model proponuje zmianę kodu. Zespół uruchamia testy i analizę bezpieczeństwa, zanim rozważy włączenie łatki.
- EN: After a vulnerability is found in a C function, a model proposes a code change. The team runs tests and security analysis before considering the patch.

## This concerns you if you…

- PL: utrzymujesz projekt z otwartym kodem
- PL: masz zaległe zgłoszenia o błędach bezpieczeństwa
- PL: budujesz agentów programistycznych
- EN: maintain an open-source project
- EN: have a backlog of security bug reports
- EN: build coding agents

## Keywords

automated program repair · zero-shot repair · vulnerability repair · prompt design · patch validation · secure code repair

## How it works

- PL: Podatny fragment kodu i opis zadania umieszcza się w zapytaniu do modelu. Badanie zero-shot porównuje różne konstrukcje promptów na przykładach syntetycznych, ręcznie przygotowanych i rzeczywistych, oceniając zarówno usunięcie podatności, jak i poprawność funkcjonalną kandydatów.
- EN: Vulnerable code and a task description are placed in a model prompt. The zero-shot study compares prompt formulations on synthetic, hand-crafted, and real-world examples, evaluating both vulnerability repair and functional correctness of candidates.

## Limits

- PL: W badaniu realne podatności były trudniejsze niż przykłady syntetyczne, a poprawność funkcjonalna pozostawała wyzwaniem. Wynik zależał od konstrukcji promptu i użytego modelu, dlatego każda łatka wymaga testów i przeglądu człowieka.
- EN: In the study, real-world vulnerabilities were harder than synthetic examples, and functional correctness remained challenging. Results depended on prompt construction and the model used, so every patch requires testing and human review.

## Key terms

- PL: **łatka**: Zmiana w kodzie usuwająca błąd.
- PL: **test regresji**: Sprawdzenie, że poprawka nie zepsuła tego, co działało.
- PL: **dane wywołujące awarię**: Konkretne wejście, które powoduje błąd i służy do sprawdzenia naprawy.
- EN: **patch**: A code change that removes a bug.
- EN: **regression test**: A check that a fix didn't break what used to work.
- EN: **crashing input**: A specific input that triggers the bug and verifies the fix.

## Know first

- [Wykrywanie podatności w kodzie przez modele językowe (Vulnerability detection in source code with language models)](https://aiatlasgraph.com/t/llmvulndetect.md)
- [Przegląd kodu przez AI (AI code review)](https://aiatlasgraph.com/t/aicodereview.md)

## Sources

- [Examining Zero-Shot Vulnerability Repair with Large Language Models](<https://export.arxiv.org/abs/2112.02125>) `pearce-zero-shot-vuln-repair-2021` · by Hammond Pearce, Benjamin Tan, Baleegh Ahmad, Ramesh Karri, Brendan Dolan-Gavitt

---

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