Code Room
Vibe codingMedium
Question
An AI added this Django view to fetch an invoice as JSON. The team gated the URL behind login, so they assumed it was safe. A customer changes the id in the URL and reads another company's invoice. What's missing, and what's the class of bug?
@login_requireddef get_invoice(request, invoice_id): invoice = get_object_or_404(Invoice, id=invoice_id) return JsonResponse({ "id": invoice.id, "customer": invoice.customer.name, "amount": str(invoice.amount), "line_items": invoice.line_items_json, })What a strong answer looks like
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.
Learn the concepts
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.
Run or narrate your approach, then ask the coach.