Jinja Prompt Templates: 4 Checks That Catch Silent Bugs
A one-letter typo in a prompt template renders as nothing, and nothing warns you.
Video #70 ยท LLM engineering and evals
Steps in the video
Files
- checks.py (37 lines)
- prompts.py (17 lines)
Tested with
Python 3.12.15 | jinja2==3.1.6
What this does not show
One prompt, four checks and no model call; the hostile template only reads a harmless attribute, the Jinja sandbox is not complete security, no time or memory limits are set, and passing user text as a value does not stop prompt injection of a model.
Sources
Learning IT by Example.