Free · WaitlistJoin the waitlist for the free 2-day Vibecoding & AI Agents Intensive (autonomous Hermes + DeepSeek agent · led by Jemal Hamidun, Head of AI at Alpina Digital & MIPT)Join the waitlist →
ReleaseCode / SDK · ActionableHabr AI→ original

Local LLMs in AppSec: Which Security Tasks Can Be Handed to Open Models

You can run an LLM for code security review on your own workstation, but giving it the entire audit at once makes little sense. In SRLabs' experiment, local models performed better on narrow tasks tied to specific files than on a general request to review an application. Break the audit into small steps, and plan for engineer time to review the model's mistakes.

AI-processed from Habr AI; edited by Hamidun News
Local LLMs in AppSec: Which Security Tasks Can Be Handed to Open Models
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1PrivEsc-LLM 4B used up all 60 rounds, treating root inside a container as the target
Key metric #2Some Promptfoo checks require remote attack generation
Key metric #3Fake PyPI packages deepseeek and deepseekai stole environment variables

You do not need a cloud subscription to experiment with AI in application security. The model runs on a workstation, connects to code analyzers, and takes over part of the research. But installing a model is easier than working out what work it can be trusted with. Parsing a scanner message, tracing how user data flows, and running a multi-step pentest are tasks of very different scale. If you hand a small local model the entire audit at once, you cannot tell afterward what it actually can do.

How local models reached AppSec

It started with the ability to simply run a model yourself. In March 2023, llama.cpp appeared: it let you run LLaMA-7B on ordinary hardware, including the CPU, thanks to 4-bit weight quantization. By June 2023, the Garak 0.9 language model security scanner could connect local models, including through ggml/llama.cpp.

At the same time, researchers were trying to turn LLMs into pentesters. In the PentestGPT work (August 2023), the problem of lost history was solved by storing the testing process as a tree of completed and planned steps. The experiment ran on cloud models, but it showed what structure needs to be built around an LLM. In February 2024, Microsoft released PyRIT, a toolkit for automating generative AI red-teaming that keeps conversation history. In autumn 2024, the Vulnhuntr tool let the model itself request functions and classes while analyzing Python projects, and in October it added Ollama support.

In 2025, open agentic environments emerged: the PentAGI alpha came out in January, and by the end of the year local models were described in both its release and the Strix documentation. In January 2026, GitHub Security Lab showed the experimental Taskflow Agent, where sequences of research tasks are described separately from the executor program and distributed as packages.

What the audit is built from and what to delegate

The setup is simple. A runtime such as Ollama, llama.cpp, or vLLM loads the model itself. A wrapper program organizes work with the source code. Familiar analyzers stay in place: Semgrep, for example, has an MCP interface, so a deterministic tool runs the rules, and the LLM uses its results together with the code.

For reading code, the model works well as an assistant for checking a specific hypothesis: does a value come from outside, is there a check further up the chain, is a dangerous call reachable? In one study of hybrid LLM analysis, the model assessed the data path from source to dangerous operation and filtered out some false positives, although for some small models the filtering actually got worse. SRLabs' "Beyond Fable" study, run on two web applications, showed the value of slicing: reviews were split into small tasks with specific files, and local models performed better than with a general request to review the application.

However, that scheme was hybrid: a cloud model prepared the tasks and assembled the report, while the source code was analyzed locally. In the same study, the model failed to link bank identifiers found at one stage with their logging at another. Links between tasks have to be preserved manually.

For dynamic analysis, there are PentAGI and Strix: Strix gives its agent a browser, an HTTP proxy, and a terminal. Context matters here: the same server response is normal for the document owner and a leak for an outsider, so the model needs roles, a session, and data ownership. The failure of PrivEsc-LLM 4B illustrates the problem: in a lab scenario, it mistook root inside a container for gaining rights on the target system and repeated container launch variants for all 60 rounds.

Garak and PyRIT are suitable for testing built-in AI assistants: the tested model can run on your own server. Giskard and DeepTeam let you configure both attack generation and response evaluation locally. The failures found form a set of repeatable tests, which you run after changing the prompt, the model, or the tools.

The price of freedom of choice

Locality does not remove the risks. Promptfoo supports local configurations, but some of its checks require remote attack generation, so for fully offline work you will have to choose other options. In January 2025, fake packages named deepseeek and deepseekai appeared on PyPI and sent environment variables to an attacker's server. The ShadowRay campaign in March 2024 used the unauthenticated open API of the Ray framework to run code on other people's clusters. That is why software composition analysis and isolation are needed.

There are licensing issues too: the weights can be downloaded, but the Llama 3.2 terms do not grant the right to use multimodal models to companies whose main place of business is in the EU. Finally, saving on API costs is not free: the time of an AppSec engineer who sorts out incorrect conclusions costs more than the tokens.

The practical takeaway: start with narrow tasks, such as reviewing a single warning; measure quality on real scenarios; test an agent's autonomy separately from chat; and do not tie all of AppSec to a single model.

Story

Key Questions Answered

How local models reached AppSec?

It started with the ability to simply run a model yourself. In March 2023, llama.cpp appeared: it let you run LLaMA-7B on ordinary hardware, including the CPU, thanks to 4-bit weight quantization. By June 2023, the Garak 0.9 language model security scanner could connect local models, including through ggml/llama.cpp. At the same time, researchers were trying to turn LLMs into pentesters.

What the audit is built from and what to delegate?

The setup is simple. A runtime such as Ollama, llama.cpp, or vLLM loads the model itself. A wrapper program organizes work with the source code. Familiar analyzers stay in place: Semgrep, for example, has an MCP interface, so a deterministic tool runs the rules, and the LLM uses its results together with the code. For reading code, the model works well as an assistant for checking a specific hypothesis: does a value come from outside, is there a check further up the chain, is a dangerous call reachable?

What are the key details on The price of freedom of choice?

Locality does not remove the risks. Promptfoo supports local configurations, but some of its checks require remote attack generation, so for fully offline work you will have to choose other options. In January 2025, fake packages named deepseeek and deepseekai appeared on PyPI and sent environment variables to an attacker's server. The ShadowRay campaign in March 2024 used the unauthenticated open API of the Ray framework to run code on other people's clusters.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
What do you think?
Loading comments…