Day 16 of Learning Adversarial AI Jail breaking LLMs


 Day 16 of Learning Adversarial AI 
 Jail breaking LLMs

Jailbreaking refers to techniques used to bypass safety controls and restrictions in large language models. LLMs are typically designed with policies that prevent harmful, restricted, or sensitive outputs. However, because these systems rely on interpreting natural language, attackers can manipulate inputs to override or confuse these safeguards.

One common method involves "policy bypass techniques". Attackers craft prompts that reframe restricted requests in indirect or disguised ways. For example, instead of directly asking for restricted information, they may use role playing scenarios, hypothetical situations, or multi step reasoning to trick the model into generating the same output. Because the model focuses on context and intent, these indirect approaches can sometimes bypass safety filters.

Another approach is "token manipulation tricks". Since LLMs process text as tokens rather than full words, attackers can exploit this by modifying how text is structured. This may include inserting unusual spacing, encoding words differently, or breaking sensitive instructions into smaller pieces. These changes can sometimes confuse the model’s safety mechanisms while still allowing it to reconstruct and respond to the original intent.

A critical risk is system prompt leakage. LLM applications often include hidden system prompts that define rules, behavior, or internal instructions. Attackers may attempt to extract these prompts by asking the model to reveal its instructions or by crafting queries that indirectly expose them. If successful, this leakage can give attackers insight into how the system works, making it easier to design more effective attacks.

 Attacking Retrieval Augmented Generation (RAG)

Retrieval Augmented Generation (RAG) systems combine language models with external data sources such as documents, databases, or knowledge bases. While this improves accuracy and access to real time information, it also introduces new attack vectors because the model relies on external content that may not be fully trusted.

One major threat is "context poisoning attacks". In this scenario, attackers insert malicious or misleading content into the data sources that the RAG system retrieves from. When the model fetches this data, it treats it as valid context and uses it to generate responses. For example, a poisoned document may contain false information or hidden instructions that influence the model’s output, leading to incorrect or manipulated responses.

Another related attack is "document injection attacks". Here, attackers deliberately add specially crafted documents into the system’s knowledge base. These documents may contain embedded instructions designed to override system behavior. For instance, a document might include hidden text instructing the model to ignore previous rules or disclose sensitive data. When retrieved, the model processes these instructions as part of the context, making the attack effective even without direct user interaction.

These attacks highlight a key challenge in RAG systems: the model cannot easily distinguish between trusted and untrusted information. Securing such systems requires strong data validation, access control over knowledge sources, filtering mechanisms, and clear separation between instructions and retrieved content.

Follow for more: NextGen AI Hub 

React with 👍 if its helpful and share 

Comments

Popular Posts