- Home
- Skills
- Code Quality & Review
- Python Review
Python Review
by Krimesh Shah
Specialized auditor for FastAPI, FastMCP, and Python code security, async performance, and pytest coverage.
Free
Python Review
Example session with this skill installed
Review this FastAPI endpoint in app/routes/user.py and the corresponding tests in tests/test_user.py for security and async efficiency.
- Read your context and instructions
- Compiled the python review
I have reviewed app/routes/user.py and its test suite. The analysis identified one critical async blocking issue and a potential tenant isolation gap in the delete route.
Python and FastAPI Review Report
| Category | Location | Issue | Recommendation |
|---|---|---|---|
| Async Performance | user.py:22 | Blocking I/O detected. time.sleep used inside async def. | Replace with await asyncio.sleep or move to a threadpool using def. |
| Security | user.py:45 | Missing object-level authorization. Users can delete any ID. | Validate current_user.id matches the resource owner before deletion. |
| Validation | user.py:12 | Endpoint uses a raw dict for input instead of a Pydantic model. | Define a UserCreate schema to enforce type safety and validation. |
| Testing | test_user.py:15 | Mock for database session is too broad. | Refine mock to verify specific filter parameters are passed to the query. |
| Security | user.py:50 | Exception handler returns raw str(e). | Use custom error responses to avoid leaking internal stack traces. |
Next steps
- Refactor
delete_userto include a check against theowner_idfield in the database. - Implement Pydantic models for the
POST /usersendpoint to prevent malformed data. - Add a test case specifically for an unauthorized user attempting to access another user's resource.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual code reviews often miss subtle async bottlenecks or authorization gaps in FastAPI. This skill performs a deep inspection of Python source code, focusing on security, performance, and testing rigor.
What it does
- FastAPI validation checks request/response models, middleware ordering, and identifies blocking I/O in async routes.
- Security auditing finds SQL injection, unsafe deserialization, shell invocations, and SSRF risks in user-provided URLs.
- MCP tool review treats FastMCP tools as privileged endpoints, validating arguments and resource constraints.
- Logic analysis detects mutable defaults, race conditions, and resource leaks in standard Python modules.
- Test verification evaluates pytest suites for boundary coverage, fixture isolation, and brittle mocks.
How it works
- Submit Python files or a directory of changed code for analysis.
- The skill inspects the code along with relevant callers to understand data flow.
- It cross-references implementation against FastAPI best practices and security patterns.
- You receive a structured report detailing vulnerabilities, performance issues, and missing test cases.
Frameworks & tools
This skill supports Python applications using FastAPI, FastMCP, and pytest. It addresses common risks in async/await patterns and Pydantic-based data validation.
Why this beats prompting it yourself
Generic prompts often miss the specific nuances of FastAPI's dependency injection and async lifecycle. This skill enforces strict checks for tenant isolation and object-level authorization that standard linting tools overlook.
Use cases
- Audit new FastAPI endpoints for authorization bypasses and PII leaks.
- Identify blocking synchronous calls inside async route handlers.
- Verify that pytest fixtures aren't leaking state between test runs.
- Review FastMCP tool implementations for potential path traversal or command injection.
Known limitations
This skill focuses on code logic and structure. It cannot verify package vulnerabilities without external scanner output or confirm test results unless executed in an isolated environment.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 5 days ago
- Free with an Agensi account
- Software
Python
Permissions
No special permissions declared or detected
What's inside
Frequently Asked Questions
New in Code Quality & Review
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.