AI & LLM Security

Break the guardrails: prompt injection, system-prompt leaks and jailbreaks โ€” on a live mock bot.

20 lessons ยท CHF 9.90 one-time

20 lessons ยท knowledge checks ยท final exam ยท verifiable certificate ยท in-browser Live-Lab

Buy now ยท CHF 9.90 Open in the course reader

Frequently asked questions

Why does prompt injection work?

An LLM application places the developer's instructions, retrieved content and the user's message into one context window. The model has no enforced boundary between trusted rules and untrusted text, so carefully worded input can outweigh the developer's instructions.

What is the difference between direct and indirect prompt injection?

In direct prompt injection the attacker types the malicious instructions into the chat. In indirect prompt injection the instructions are hidden in content the model reads later, such as a web page, an email or a document, so the victim never types the attack.

Is a jailbreak the same as prompt injection?

They overlap but differ in target. Prompt injection subverts the application's instructions, for example to leak a secret or misuse a tool. A jailbreak tries to make the model abandon its trained safety behaviour, often through role-play or claimed special modes.

Is it safe to put secrets in a system prompt?

No. Assume users can read the system prompt, because system-prompt leakage is a known risk (OWASP LLM07). Keep keys and credentials on the server and let your code use them on the model's behalf, so there is nothing to leak.

How do you defend an LLM app against prompt injection?

Use defence in depth: no secrets in prompts, authorisation and business rules in code, least privilege for tools, human approval for consequential actions, treating model output as untrusted, and logging plus regular attack regression tests. Prompt rules and keyword filters alone are weak.

Do role markers like system and user stop prompt injection?

They help but do not solve it. A chat template turns role-tagged messages into one token sequence with special marker tokens, which users should not be able to forge if the app uses the library's chat interface. Whether the model respects those roles is still learned behaviour, so authorisation and business rules must live in code outside the model.

Get the full course

One-time purchase, no subscription. Pay as a guest โ€” no account needed.

Buy now ยท CHF 9.90 Open in the course reader

Course syllabus

Lessons unlock after a single one-time purchase โ€” no subscription. Pricing & FAQ โ†’ ยท All course overviews โ†’