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-1/

Community Forum API

Problem/Feature Description

A startup is building a community forum. The frontend is a React single-page application hosted at https://forum.example.com, and the backend is a new FastAPI service on a separate domain. Users will post questions and answers through the frontend, which calls the API.

The same codebase needs to run in staging and production without code changes -- origins and hostnames differ per environment and should come from environment variables.

Output Specification

Produce a single Python file named main.py that:

  • Defines a FastAPI application
  • Includes at least two example API routes (e.g., GET /posts and POST /posts)
  • The frontend at https://forum.example.com must be able to call the API from the browser

The file should be complete and runnable (all imports present). You do not need to implement real database logic -- stubs or placeholder return values are fine.

evals

scenario-1

criteria.json

task.md

tile.json