Spec a safe upload endpoint for member photos

Vibe codingMedium25 min

Your task

Your community app lets members upload a profile photo and add images to posts. The backend is Python with FastAPI, files go to S3, and every visitor sees the images. An agent will build the upload endpoint.

Write the spec you would hand the agent.

What you know:

  • Pillow is already a dependency
  • images are served from media.example.com, a separate domain behind a CDN
  • members post photos straight from their phones
  • the limits are 10 MB per file and 50 uploads per member per day

Then, in a few sentences: what does a quick "add an image upload endpoint" prompt get wrong?