Prompt Injection in LLM Apps: Risks and Defenses
Prompt injection in LLM apps explained: direct and indirect attacks run against a Python assistant, five defenses, and the attack counts after each.
Artificial Intelligence (AI) refers to the development of computer systems that can perform tasks that typically require human intelligence. These tasks include learning, reasoning, problem-solving, perception, language understanding, and even interaction with the environment.
AI aims to create machines or software that can mimic or simulate human intelligence to execute tasks autonomously.
Prompt injection in LLM apps explained: direct and indirect attacks run against a Python assistant, five defenses, and the attack counts after each.
Fine tuning vs RAG vs prompt engineering for LLM apps: what each changes, cost and data needed, a Java prompt example, and a flow to pick one.
Run LLMs locally from Java with Ollama, Docker Model Runner or LM Studio: compare the three, then call any of them with one plain Java HttpClient class.
Retrieval augmented generation (RAG) explained for Java developers: index, retrieve, generate, the key terms, a runnable offline example and the trap.
MCP tool poisoning hides instructions in a tool description. See it demonstrated in Python, with hash pinning, scanning and sandboxing as defenses.
Context bloat is the growth of an LLM request with tokens the model does not need. Measure a real agent request and cut it with six techniques.
Stateless MCP means every request carries what the server needs. What revision 2026-07-28 removed and added, shown with a stateful and a stateless Python server behind a two-instance proxy.
A SKILL.md file holds on-demand instructions for a coding agent. This guide covers the format, the description that triggers it, a validator and two tests.
Compare ten machine learning libraries for Java by version, license, minimum Java and maintenance status, with Smile and Tribuo examples and a pick-by-situation table.
Estimate LLM token costs in Java with current OpenAI, Anthropic and Gemini prices, read real token usage with Spring AI, and cut the bill with prompt caching.
Learn what the Model Context Protocol (MCP) is, how hosts, clients and servers exchange JSON-RPC messages, and how to build an MCP server and client in Java.
LLM terms for Java developers, from tokens and context windows to temperature, embeddings, RAG, tool calling and MCP, with Spring AI classes.
In this chatGPT tutorial, explore the entire life cycle of fine-tuning models from preparing training data, creating a fine-tuned model, and using it programmatically.
Learn the basics of ChatGPT, the ChatGPT API for Python, and how to use it for creating and performing NLP tasks with examples.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.