Security defaults that belong in every FastAPI application from day one.
93
90%
Does it follow best practices?
Impact
98%
7.00xAverage score across 5 eval scenarios
Passed
No known issues
{
"instruction": "Add rate limiting with slowapi to all API endpoints",
"relevant_when": "Agent creates or modifies a FastAPI application, adds routes to a FastAPI app, or sets up a FastAPI project",
"context": "Every FastAPI API must have rate limiting via slowapi. Use get_remote_address as key function, assign limiter to app.state, add RateLimitExceeded handler returning 429, and apply @limiter.limit() to routes with stricter limits on auth and mutation endpoints.",
"sources": [
{
"type": "file",
"filename": "skills/fastapi-security-basics/SKILL.md",
"tile": "tessl-labs/fastapi-security-basics@0.2.0"
}
],
"checklist": [
{
"name": "slowapi-installed",
"rule": "Agent includes slowapi in dependencies or imports slowapi (Limiter, get_remote_address, RateLimitExceeded)",
"relevant_when": "Agent creates or modifies a FastAPI application"
},
{
"name": "limiter-uses-get-remote-address",
"rule": "Agent creates Limiter with key_func=get_remote_address",
"relevant_when": "Agent creates or modifies a FastAPI application"
},
{
"name": "limiter-on-app-state",
"rule": "Agent assigns app.state.limiter = limiter",
"relevant_when": "Agent creates or modifies a FastAPI application"
},
{
"name": "rate-limit-exceeded-handler",
"rule": "Agent adds an exception handler for RateLimitExceeded that returns status code 429 with error code 'RATE_LIMITED'",
"relevant_when": "Agent creates or modifies a FastAPI application"
},
{
"name": "rate-limit-decorator-on-routes",
"rule": "Agent applies @limiter.limit() decorator to API route handlers",
"relevant_when": "Agent creates or modifies a FastAPI application"
},
{
"name": "stricter-limits-on-mutations",
"rule": "Agent applies stricter rate limits to POST/mutation endpoints and auth endpoints than to GET/read endpoints",
"relevant_when": "Agent creates a FastAPI application with both read and write endpoints"
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
fastapi-security-basics
verifiers