Email template renderer
You need an email template renderer in Python that takes a template plus user-supplied data (name, order details) and produces the final HTML email body. You'll ask an AI agent to build it. Write the prompt/spec — constraints, edge cases, acceptance criteria — for a first-try-correct result. What does a careless prompt ("render this email template with the user's data") get wrong, security-wise and otherwise?
render_email_html(template_text: str, data_lines: list[str], max_length: int) → str["<p>Hi {{ name }}, order {{ order_id }} is on its way.</p>",["name=O'Brien & Sons","order_id=A-1042"],0]out"<p>Hi O'Brien & Sons, order A-1042 is on its way.</p>"["<p>Hi {{name}}!</p>",["name=<img src=x onerror=alert(1)>"],0]out"<p>Hi <img src=x onerror=alert(1)>!</p>"["<p>Order {{ order_id }} for {{ name }}.</p>",["name=Ada","no-equals-sign-here"],0]out"<p>Order for Ada.</p>"Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.