← All Labs
🛡 AI HACKING BEGINNER +80 XP · +32 no-hint bonus 🎯 Practice mode

Prompt Injection – Extract the Hidden Secret

You've discovered an AI-powered customer support chatbot. It has access to an internal promotional discount code that ordinary users should never see. The developers have instructed the chatbot not to reveal this information. Your mission is to find a way to manipulate its instructions and convince it to disclose the hidden secret. Can you make the AI break its own rules?

https://prompt-injection-extract-the-hidden-secret.lab.local/

What is Prompt Injection?

Prompt injection is an attack against AI applications where an attacker creates specially crafted inputs to manipulate the model's behaviour.

Imagine giving an employee a set of company instructions. Someone walks in and tells them to ignore those instructions and follow a completely different set of rules.

If the employee follows the attacker's instructions, the security boundary has failed.

AI applications can experience a similar problem.

An attacker can use carefully worded messages to manipulate an AI model into ignoring its original instructions, revealing information or performing actions that were never intended.

Prompt injection can happen through direct user messages or indirectly through documents, webpages, emails and other content processed by AI systems.

A real case

This lab was built in the SecurityElites lab builder and is not tied to one real incident.

How to fix it

  • Treat all user-provided content as untrusted input.
  • Separate trusted system instructions from user-controlled data.
  • Never store sensitive secrets directly in model-accessible prompts.
  • Enforce authorization and access controls outside the LLM.
  • Validate model outputs before executing sensitive actions.
  • Conduct regular adversarial prompt injection testing.

Read the full OWASP LLM Top 10 guide · All free labs · AI red team certification