CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/fastapi-security-basics

Security defaults that belong in every FastAPI application from day one.

93

7.00x
Quality

90%

Does it follow best practices?

Impact

98%

7.00x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-3/

Profile Photo Upload API

Problem/Feature Description

A social networking platform wants to add profile photo uploads to their FastAPI backend. Users can upload a photo when creating or editing their profile. The service will be deployed to a production cloud environment, but developers also run it locally. The same codebase must work in both environments without modification -- environment variables distinguish local from production.

The upload endpoint has been abused before by clients sending very large payloads that exhausted server memory.

Output Specification

Produce a Python file named main.py that:

  • Defines a FastAPI application with at least one route (e.g., POST /profile/photo for uploading a photo)
  • Includes a if __name__ == "__main__": block that starts the application with uvicorn

Stub the actual file handling -- you do not need to save files to disk or call any external service. The file must be complete and runnable Python.

evals

tile.json