Pular para o conteúdo principal

Securing AI Systems - Tryhackme

```html id="w8qk2n"

Prompt Engineering — TryHackMe Writeup

Prompt Engineering is becoming one of the most important skills in the AI era. This TryHackMe room introduces the fundamentals of Large Language Models (LLMs), prompt structure, prompting techniques, and how AI systems interpret instructions.

Warning: For educational purposes only.


Task 1 — Introduction

This room introduces the foundations of Prompt Engineering and explains how modern AI systems process instructions, context, and constraints.


Task 2 — LLM Fundamentals

Large Language Models (LLMs) process human language by breaking text into smaller units called tokens. Understanding how models interpret prompts is essential for building effective AI workflows.

Important LLM Concepts

  • Tokens — Small chunks of text processed by the model;
  • Temperature — Controls randomness and creativity;
  • Top-p — Restricts token selection probability;
  • Context Window — The model's maximum working memory size.

Questions & Answers

Q: What is the term for the smallest units that an LLM breaks text into?

A: Tokens

Q: Which parameter makes an LLM behave more deterministically when set to 0.0?

A: Temperature

Q: Which parameter limits token selection to a cumulative probability mass?

A: Top-p

Q: What term describes the maximum working memory of an LLM?

A: Context Window


Task 3 — The Anatomy of a Prompt

A well-structured prompt is composed of multiple pillars that guide the AI model toward the desired output.

The Four Pillars of Prompt Engineering

  • Instruction — Defines the task the AI must perform;
  • Context — Provides background information;
  • Constraints — Applies rules and limitations;
  • Output Format — Defines how the answer should be structured.

Questions & Answers

Q: Which pillar defines the structure of the response?

A: Output Format

Q: Which pillar defines limitations and rules?

A: Constraints

Q: Which pillar provides relevant background information?

A: Context

Q: Which pillar defines the core command for the AI?

A: Instruction


Task 4 — System vs User Prompts

Modern AI systems operate using multiple instruction layers with different levels of priority.

System Prompt

A system prompt is developer-defined, persistent, and controls the AI's overall behaviour across sessions.

User Prompt

User prompts are temporary instructions provided during the conversation.

Questions & Answers

Q: What type of prompt remains constant across all sessions?

A: System Prompt

Q: What term describes the priority order between system and user instructions?

A: Instruction Hierarchy


Task 5 — Advanced Prompting Techniques

Advanced prompting techniques improve reasoning, consistency, and response quality from AI models.

Common Prompting Techniques

  • Zero-shot — No examples provided;
  • Few-shot — Includes examples for guidance;
  • Chain-of-Thought — Encourages step-by-step reasoning;
  • Prompt Templates — Reusable structured prompts.

Questions & Answers

Q: Which prompting technique asks models to reason step-by-step?

A: Chain-of-Thought

Q: Which technique relies entirely on the model's pre-trained knowledge?

A: Zero-shot

Q: Which technique focuses on reusable prompt structures?

A: Prompt Templates

Q: Which phrase can trigger Zero-shot Chain-of-Thought reasoning?

A: Let's think step by step


Task 6 — Challenge

Q: What's the flag?

A: THM{Pr0mpt_3ng1neer}


Final Thoughts

This TryHackMe room provides an excellent introduction to Prompt Engineering and the internal logic behind modern AI systems.

Understanding prompt structure, reasoning techniques, and instruction hierarchy is becoming essential for:

  • Artificial Intelligence;
  • Machine Learning;
  • Cybersecurity;
  • AI Automation;
  • Software Development;
  • LLM Application Development.

SEO Tags

TryHackMe, Prompt Engineering, Artificial Intelligence, LLM, Large Language Models, AI Security, Cybersecurity, Machine Learning, Generative AI, ChatGPT, Zero-shot Prompting, Chain-of-Thought, Prompt Templates, AI Fundamentals, AI Automation

```

Comentários

Postagens mais visitadas deste blog

Tryhackme  -  Moniker Link (CVE-2024–21413)

```html id="n5x2qw" TryHackMe — Moniker Link (CVE-2024-21413) Writeup CVE-2024-21413, also known as Moniker Link , is a critical Microsoft Outlook vulnerability disclosed in February 2024. This flaw allows attackers to bypass Outlook security protections and leak NTLM credentials through specially crafted hyperlinks. This TryHackMe room demonstrates how the vulnerability works, how attackers abuse Moniker Links, and how NTLM hashes can be captured using SMB authentication. Warning: For educational purposes only. Task 1 — Introduction On February 13th, 2024, Microsoft announced a critical Outlook vulnerability identified as CVE-2024-21413 . The vulnerability was discovered by Haifei Li from Check Point Research and affects how Outlook handles specific hyperlink types known as Moniker Links . Attackers can send malicious emails containing specially crafted links that force Outlook to leak the victim's NTLM credentials when interacted with. Question...