Beginner · Blended

Practical prompt engineering

Writing requests to language models with a method: clear, verifiable, safe and reusable.

Level
Beginner
Format
Blended
Duration
24 hours
Language
Italian
Certificate
Certificate of attendance
Overview

Overview

A 24-hour, hands-on path to learn how to design, test and maintain reliable prompts: from the structure of a request to evaluation with test cases, up to security, privacy and use in real systems.

Writing well to a language model is not a matter of magic formulas, and the formulas circulating online age quickly. It is a craft of clarity, context and, above all, verification: a prompt is good if it gives correct results repeatably on the cases that matter, and you only know that by testing it.

The course is practical and vendor-independent: you work with several assistants and models, comparing results. You start from how models work (enough to understand why they fail), build the anatomy of a good prompt, and reach the heart of the method: success criteria, test cases, evaluation rubrics, versions and regressions.

The last modules deal with what is usually skipped: confidential data, prompt injection, untrusted answers, responsibility, and the step from prompt to system (tools, structured formats, costs). It ends with a library of tested prompts, built on your own work.

The courses are the author's independent initiatives: the opinions expressed are personal and don't represent any organisation or employer.

What you'll learn

  • Explain how a language model works well enough to predict its typical errors.
  • Write clear, complete prompts: goal, context, constraints, examples and output format.
  • Supply the model with materials and sources and ask for grounded, verifiable answers.
  • Break complex tasks into steps and chain them, without complicating things when it is not needed.
  • Evaluate a prompt with success criteria, a set of test cases and a rubric, and improve it systematically.
  • Protect data and people: recognise prompt injection, information leaks and inappropriate uses.
  • Document, version and maintain a library of reusable prompts, also in a team.

Who it's for

  • Professionals, office workers and students who use AI assistants every day and want better, more reliable results.
  • People who write, analyse, translate or research for work and want a repeatable method.
  • Developers who integrate language models into products and automations.
  • Team and process leads who need to write rules of use and shared standards.

Prerequisites

  • No technical skills for modules 1–7.
  • For module 9 (from prompt to system) it helps to read a little code; it is an optional module for those who do not develop.
  • A computer with an internet connection and a free account with at least one generative AI assistant.
  • A real task from your own work to bring to the course.

Programme

Total duration 24 hours

  1. Module 1

    How language models work

    Just enough to understand why a model answers the way it does and why it errs, without mathematics.

    4 lessons—

    Topics

    • Tokens and the context window
    • Predicting the next word
    • Training and fine-tuning
    • Temperature and variability
    • Reasoning models
    • Differences between models and versions
    • Hallucinations and how they arise
    1. From text to tokens: what the model seesHow a text is split and counted, and why the available context has a limit.
    2. Predicting what comes next: why a model is plausible, not omniscientWhat «generating» means and why an answer can be fluent and wrong.
    3. Variability, versions and different modelsWhy the same question gets different answers and why a prompt must be retried at every model change.
    4. Reasoning models and fast modelsWhen a model that «thinks» longer is worth it and when a quick, cheap one is enough.

    Exercise Make the same request several times and on two different models; note what changes and what stays stable.

  2. Module 2

    Anatomy of a prompt

    Goal, context, instructions, constraints, format and role: the elements of a request that a colleague would understand at first glance.

    4 lessons—

    Topics

    • Goal and audience
    • Context and motivations
    • Explicit instructions
    • Constraints and output format
    • Role and tone
    • System instructions and user messages
    • The colleague test
    1. Being clear and directThe colleague test: if a person with little context would be confused, the model will be too.
    2. Giving the why: context and purposeExplaining the purpose of an instruction helps the model generalise better than a flat prohibition.
    3. Say what to do, not only what to avoidPositive wording and an output format described precisely.
    4. Role, tone and system instructionsWhat a role and a system prompt are really for, and how to separate them from the user's request.

    Exercise Rewrite three of your «vague» prompts with goal, context, constraints and format, and compare the results before and after.

  3. Module 3

    Examples and structure

    Teaching with well-chosen examples and separating instructions, materials and data in an orderly way, also to get structured output.

    4 lessons—

    Topics

    • Examples: zero, one, a few
    • Choosing relevant and varied examples
    • Delimiters, tags and markdown
    • Separating instructions and data
    • Structured output: lists, tables, JSON
    • Order of the elements in the prompt
    1. Learning from examplesWhen an example is worth more than an explanation, how many are needed and how to keep the model from copying them.
    2. Structuring the prompt: sections and delimitersLabels and tags that separate instructions, context, examples and the data to process.
    3. Getting a precise formatTables, JSON and response schemas: how to ask for them and how to check them.
    4. Order matters: what goes whereLong materials at the top, the question at the end, stable instructions at the start: effects on quality and cost.

    Exercise Build a prompt that turns messy texts into a table, with three varied examples, and measure the effect of each.

  4. Module 4

    Context, sources and reliability

    Giving the model the right material and getting grounded answers, with citations and the courage to say «I don't know».

    4 lessons—

    Topics

    • Providing documents and data
    • Long context: structure and quotes
    • Grounding the answer in sources
    • Admitting uncertainty
    • Retrieval of information (RAG)
    • Verification and cross-checking
    1. Give the material, not only the questionWhy a model answers better about what it has in front of it than about what it «remembers».
    2. Working with long documentsHow to present them, asking first for the relevant quotes and then for the answer.
    3. Citing, grounding, admitting limitsInstructions that reduce invention: answer only from the sources, flag uncertainty, point out what is missing.
    4. Verifying: quick checks and serious checksChecking citations, comparing with other sources, verification questions and the cases that need expert people.

    Exercise Give the model a 10-page document and ask for a summary with quotes; check by hand that every quote exists and says what is claimed.

  5. Module 5

    Reasoning and complex tasks

    Breaking down, chaining and checking: how to tackle tasks that a single step does not solve.

    4 lessons—

    Topics

    • Breaking into sub-tasks
    • Chaining prompts
    • Step-by-step reasoning
    • Internal thinking of recent models
    • Self-checking and review
    • When thinking aloud is not needed
    1. Breaking down a taskDividing into steps with a checkable intermediate result, instead of one enormous request.
    2. Chaining prompts: draft, review, polishSimple chains in which the output of one step becomes the input of the next.
    3. Explicit reasoning and the thinking of recent modelsWhat research says about chain-of-thought and why many models now reason on their own.
    4. Having the result checkedSelf-checking and cross-review: when they help and when they give only an illusion of control.

    Exercise Take a complex task from your work, break it into three steps and compare the result with a single request.

  6. Module 6

    Evaluating and improving: the method

    The central module: success criteria, test cases, rubrics, comparisons and versions, to really know whether a prompt works.

    5 lessons—

    Topics

    • Defining success before writing
    • Test sets: typical and hard cases
    • Evaluation rubrics
    • Comparing versions (A/B)
    • Automatic and human evaluation
    • Prompt and model versions
    • Regressions and traceability
    1. What «it works» meansMeasurable success criteria: correctness, completeness, tone, format, cost and time.
    2. Building a set of test casesTypical cases, edge cases and cases that have already made the prompt fail: how many are needed and where to find them.
    3. Rubrics and scoresTurning a vague judgement into a grid with scores, always used the same way.
    4. One model evaluating another: uses and cautionsWhen automatic evaluation helps, how to check its reliability and why it does not replace the human eye.
    5. Versions, regressions and model changesRecording every change, rerunning the tests at every change and pinning the model version in production.

    Exercise For one of your prompts, write the success criteria, prepare at least ten test cases and a rubric; then improve the prompt over three iterations, documenting the results.

  7. Module 7

    Prompts for everyday work

    Proven patterns for writing, summarising, analysing, translating, extracting data and programming, and how to keep them in a library.

    4 lessons—

    Topics

    • Writing and revising texts
    • Summarising and comparing documents
    • Extracting data from texts
    • Analysis and reasoning over data
    • Translation and adaptation
    • Code: explaining, writing, reviewing
    • Reusable prompt templates
    1. Writing, rewriting, revisingGiving the model your own style and a starting text, and asking for targeted changes instead of full rewrites.
    2. Summarising, comparing, extractingSummaries for different audiences, comparison between versions of a document, extraction of fields into a table.
    3. Analysis, translation, codeWhat to ask (and not to ask) a model when numbers, languages and programs are involved.
    4. A prompt library that lastsTemplates with placeholders, clear names, usage notes, examples and associated tests; how to share it with a team.

    Exercise Choose three repetitive activities from your work and turn them into prompt templates with placeholders, an example and two test cases each.

  8. Module 8

    Security, privacy and responsibility

    Confidential data, prompt injection, untrusted answers, rights and responsibility: what separates a professional use from a naive one.

    5 lessons—

    Topics

    • Personal and confidential data in prompts
    • Direct and indirect prompt injection
    • Information leaks and the system prompt
    • Treating output as untrusted
    • Excessive agency of tools
    • Copyright and attribution
    • Regulatory framework: GDPR and AI Act
    • Ethical and transparent use
    1. What must not be written in a promptPersonal data, secrets, credentials, confidential documents: where they end up and which rules apply.
    2. Prompt injection: how it works and how to defendInstructions hidden in pages, emails and documents the model reads; realistic defences and their limits.
    3. Output is not trustedWhy you do not run or publish what a model produces without checking, especially if it drives tools.
    4. Rights, responsibility and transparencyWho answers for a text produced with AI, disclosing the use when needed, respecting copyright.
    5. Rules for yourself and for a teamA one-page use policy: permitted data, authorised tools, mandatory checks.

    Exercise Try to make one of your prompts violate its instructions with a hostile text (in a test environment) and write the measures you would adopt.

  9. Module 9

    From prompt to system

    When the prompt becomes part of a product: tools, structured formats, costs, observability and when something beyond the prompt is needed.

    4 lessons—

    Topics

    • Calling a model from a program
    • Tools and functions (tool use)
    • Structured answers and validation
    • Costs, latency and context caching
    • Logging and observability
    • Prompt, data retrieval or fine-tuning?
    1. The prompt as code: versions, tests, reviewTreating prompts as part of the software: repository, review, automated tests, release.
    2. Tools, functions and structured formatsHaving the model call functions and return validatable data, with limits on its powers.
    3. Costs, time and quality: the trade-offsChoosing model, context length and cache reuse according to the task.
    4. When the prompt is not enoughData retrieval, fine-tuning, rules in code or human intervention: how to decide.

    Exercise For one of your prompts, write the integration sheet: input, validated output, automated tests, limits on the tool's powers, estimated costs.

Final project and assessment

The tested prompt library

The final work is a small library of three prompts for your own work, each with a usage sheet, test set, rubric, results and version log. You do not hand in the «perfect prompt»: you hand in a prompt of which you know when it works and when it does not.

Assessment and certificate

Assessment is the delivery of the library, with a commented review on clarity, quality of the tests and security. At the end a certificate of attendance is issued; it is not a certification.

What you hand in

  • Three prompts with purpose, audience, constraints and output format.
  • For each, a set of at least ten test cases and an evaluation rubric.
  • A table of results on at least two models or versions.
  • The log of changes and of the regressions met.
  • A security and privacy review, with permitted data and measures.
  • A one-page use policy for your own team.

Method and materials

A blended path with a strong lab character: 16 hours of live online lessons, in 8 sessions of 2 hours, and about 8 hours of independent work on your own prompt library. Modules 1 and 2 are covered in the first session, all the others have one session each. Each session devotes more than half of the time to guided exercises and comparisons between different models. Only sample data are used, never personal or confidential data.

What you need

  • A computer with an up-to-date browser and an internet connection.
  • A free account with at least one generative AI assistant (the course does not depend on any particular one).
  • A spreadsheet or document to record the tests.
  • A real task from your own work, reworked without confidential data.
  • For module 9: optionally a text editor and familiarity with a programming language.

Glossary

42 terms used in the course, in alphabetical order.

A/B test
A comparison between two versions of a prompt on the same test cases to see which works better.
API
The interface through which a program sends requests to a model and receives its answers, to integrate it into a product.
Chain-of-thought
A technique that asks the model to spell out intermediate reasoning steps before the answer; described in the scientific literature since 2022.
Context
All the information the model has in front of it in the request: instructions, documents, examples, previous conversation.
Context window
The maximum amount of text (in tokens) a model can consider in a single request.
Conversation memory
The history that is resent to the model with every request, rather than a permanent memory of the model.
Delimiter
A mark or tag (for example quotation marks, markdown or XML) that separates the parts of a prompt, such as instructions and data.
Embedding
A numerical representation of a text that captures its meaning, used to search for similar content.
Example (shot)
An input-output pair inserted in the prompt to show the model the expected result. Zero-shot: no examples; few-shot: a few examples.
Excessive agency
The risk that a model-based system has too many powers or permissions and takes unwanted actions; item LLM06 of the OWASP Top 10 for LLM 2025.
Fine-tuning
Further training of a model on specific data to adapt its behaviour.
Grounding
Constraining the answer to provided or verifiable sources, rather than to the model's «memory» alone.
Guardrail
Checks applied before or after the model to limit unwanted inputs and outputs.
Hallucination
A plausible but false or invented answer, delivered by the model in the same tone as a correct one.
Latency
The time between the request and the answer.
LLM (large language model)
A model trained on large quantities of text, able to produce and transform text.
LLM as a judge
Using a model to evaluate the answers of another (or of itself) against a rubric; useful but to be calibrated against human judgements.
Model pinning
Fixing the application to a precise version of the model, to obtain constant behaviour over time.
Multimodal
Able to process several types of input (text, images, audio).
Prompt
The text (instructions, questions, examples, materials) used to ask something of a language model.
Prompt chain
A sequence of requests in which the output of one becomes the input of the next (draft, review, polish).
Prompt engineering
The design, testing and maintenance of prompts to obtain reliable results from a model.
Prompt injection
An attack in which malicious text, written by the user or hidden in content the model reads, alters its instructions; item LLM01 of the OWASP Top 10 for LLM 2025.
Prompt optimisation
Systematic improvement of a prompt from the results of tests, not from intuition.
Prompt template
A prompt with placeholders to fill in at each use, to reuse it consistently.
Prompt versioning
Recording every change to a prompt with date, reason and results, as is done with code.
RAG (retrieval-augmented generation)
A technique that retrieves relevant documents from a knowledge base and inserts them in the prompt so that the model answers on them.
Reasoning model
A model designed to process intermediate steps internally before answering, usually slower and more expensive.
Regression
A worsening of a result that used to work, caused by a change in the prompt or the model.
Response schema
A formal description of the structure the output must have, used to obtain and validate structured answers.
Role prompting
Assigning the model a role (for example a copy editor) to steer its tone and behaviour.
Rubric
An evaluation grid with criteria and score levels, to judge results always the same way.
Self-consistency
A technique that generates several answers with different reasoning and picks the most frequent.
Structured format
Output with an expected shape (JSON, table, list) that a program can read and validate.
Success criteria
A measurable definition of what makes a result good, written before evaluating a prompt.
System prompt
The initial message that sets the assistant's role, rules and style, separate from the user's requests.
System prompt leakage
A leak of the content of the system instructions, which may contain sensitive information; item LLM07 of the OWASP Top 10 for LLM 2025.
Temperature
A parameter that regulates the variability of answers: low for steadier answers, high for more variety.
Token
A unit of text (part of a word, a word or a sign) with which the model reads, writes and measures context.
Tool use
The model's ability to request the execution of external functions (search, calculation, actions) and use their results.
Untrusted output
The principle that what a model produces must be checked before being executed, published or used to decide; recalled by LLM05 (improper output handling).
Zero-shot
A request with no examples: the model relies only on the instructions.

References and sources

  1. Prompting best practices (opens in a new tab)

    Anthropic, Claude Platform Docs

    Clarity, context, examples (3–5, relevant and varied), structure with tags, long context, reasoning, agentic systems. It changes with the models: check the page of the model in use.

  2. Prompt engineering (opens in a new tab)

    OpenAI, developer documentation

    Message roles, examples, structure, context, prompt versioning, pinning model versions and building evaluations (evals).

  3. OWASP Top 10 for LLM Applications (2025 edition) (opens in a new tab)

    OWASP GenAI Security Project

    Ten risks: prompt injection, sensitive information disclosure, supply chain, data and model poisoning, improper output handling, excessive agency, system prompt leakage, vector and embedding weaknesses, misinformation, unbounded consumption.

  4. Artificial Intelligence Risk Management Framework (AI RMF 1.0) (opens in a new tab)

    NIST, January 2023

    A voluntary framework for managing AI risks.

  5. Generative AI Profile (NIST AI 600-1) (opens in a new tab)

    NIST, July 2024

    An AI RMF profile devoted to the specific risks of generative AI.

  6. Language Models are Few-Shot Learners (opens in a new tab)

    Brown et al., 2020

    The GPT-3 paper: shows that a few examples in the prompt are enough to steer the model without retraining it.

  7. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (opens in a new tab)

    Wei et al., 2022

    Shows that asking for intermediate steps improves the arithmetic and logical reasoning of large models.

  8. Self-Consistency Improves Chain of Thought Reasoning in Language Models (opens in a new tab)

    Wang et al., 2022

  9. ReAct: Synergizing Reasoning and Acting in Language Models (opens in a new tab)

    Yao et al., 2022

    Alternating reasoning and actions with external tools: the basis of many agents.

  10. Lost in the Middle: How Language Models Use Long Contexts (opens in a new tab)

    Liu et al., 2023

    Evidence that models use information in the middle of long contexts less well: it explains the attention to order.

  11. Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection (opens in a new tab)

    Greshake et al., 2023

    Describes indirect prompt injection through content retrieved by applications.

  12. Regulation (EU) 2016/679 (GDPR) (opens in a new tab)

    European Parliament and Council

    In particular Articles 5, 6, 9, 28, 32.

  13. Regulation (EU) 2024/1689 (AI Act), as amended by Regulation (EU) 2026/1744 (opens in a new tab)

    European Parliament and Council

    Relevant to those who use AI assistants at work: AI literacy (Art. 4) and transparency obligations (Art. 50).

The sources were checked on 13 November 2026. Vendors' guides change with each new generation of models: each edition of the course starts with a new check and with tests on the models of the moment. The scientific papers describe results obtained on earlier models: they serve to understand principles, not to predict the behaviour of current models.

Instructor

Francesco Barbato

Full Stack · Cybersecurity · AI

I hold a degree in computer engineering and work on web development, information security and artificial intelligence. This course comes from the daily use of these tools and from a conviction: the difference between a naive use and a professional one lies in the method of verification, not in formulas. The course is an independent initiative and the opinions expressed are personal.

Frequently asked questions

Do I need to program?

No, for modules 1–7. Module 9 is about integration into programs and is optional for those who do not develop.

Which model or tool is used?

The course does not depend on a vendor. You work with several assistants and compare results, because a prompt must always be tested on the model you will really use.

Do the techniques stay valid when new models come out?

The principles (clarity, context, examples, verification) do. The details change: that is why the evaluation method is the centre of the course, and lets you retest everything at each model change.

Are there «magic» prompts to copy?

No. There are useful prompt templates, but only testing on your own cases tells you whether they work. The course teaches how to build those tests.

Is prompt engineering a profession?

It is above all a cross-cutting skill, required in very different roles. The course does not promise a job and does not issue a certification, but a certificate of attendance.

Do I need a paid subscription?

No: free accounts are enough. Paid tools may give different results, and the course teaches how to compare them.

Can I have a version for my team or company?

Yes. A tailored version can be built, working on the team's real tasks and documents (without confidential data in the course materials).

How do I get the full course?

With the «Request information» button: I receive the request and reply personally. Together we define materials, timing and format.

The full course

This page is the course's map: topics, modules, lessons, glossary and sources. To get the full course, with the material for every module, write to me: I reply personally and we agree on timing, format and, if needed, a tailored version for your team.

Request information

What it includes

  • Complete handouts and slides for each module.
  • A test bench with cases, rubrics and sheet templates to use and adapt.
  • A collection of annotated prompts, with the intermediate versions and the errors that improved them.
  • Checklists for security, privacy and responsible use.
  • Exercises with a commented review of your own prompt library.

Price and editions

Price

Price on request

Next edition

Next edition: to be defined

Interested in this course?

Write to me to find out more about content, timing and format, for a group too.

Request information