Python Review

    by Krimesh Shah

    1

    Specialized auditor for FastAPI, FastMCP, and Python code security, async performance, and pytest coverage.

    Free

    Security scanned

    Works with the AI Agents you already use

    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

    CategoryLocationIssueRecommendation
    Async Performanceuser.py:22Blocking I/O detected. time.sleep used inside async def.Replace with await asyncio.sleep or move to a threadpool using def.
    Securityuser.py:45Missing object-level authorization. Users can delete any ID.Validate current_user.id matches the resource owner before deletion.
    Validationuser.py:12Endpoint uses a raw dict for input instead of a Pydantic model.Define a UserCreate schema to enforce type safety and validation.
    Testingtest_user.py:15Mock for database session is too broad.Refine mock to verify specific filter parameters are passed to the query.
    Securityuser.py:50Exception handler returns raw str(e).Use custom error responses to avoid leaking internal stack traces.

    Next steps

    1. Refactor delete_user to include a check against the owner_id field in the database.
    2. Implement Pydantic models for the POST /users endpoint to prevent malformed data.
    3. 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

    1. Submit Python files or a directory of changed code for analysis.
    2. The skill inspects the code along with relevant callers to understand data flow.
    3. It cross-references implementation against FastAPI best practices and security patterns.
    4. 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Listed5 days ago

    What's inside

    Frequently Asked Questions

    This skill performs deep inspections of Python source code to find async bottlenecks, authorization gaps, and security risks like SQL injection or SSRF. It specifically looks for issues that standard linters miss, such as blocking I/O inside FastAPI routes and shared state in pytest fixtures.

    You only need to provide the Python files or the directory of changed code you want analyzed. Your AI agent uses this skill to cross reference your implementation against FastAPI best practices and security patterns without requiring additional software.

    You receive a structured report detailing identified vulnerabilities, performance issues, and missing test cases. The analysis includes a review of data flow between the changed code and relevant callers to ensure a comprehensive evaluation.

    Yes, this skill treats FastMCP tools as privileged endpoints and validates all arguments and resource constraints. It checks for tenant boundaries, sensitive data leaks, and potential path traversal risks within your MCP tool implementations.

    This skill cannot verify package vulnerabilities without external scanner output or confirm actual test results unless executed in an isolated environment. It is focused on analyzing code logic, structure, and internal security patterns rather than external dependencies.

    You can ask your AI agent to audit new FastAPI endpoints for authorization bypasses or to identify blocking synchronous calls in your async handlers. You can also request a review of your pytest suites to ensure fixtures are isolated and boundary cases are covered.

    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.

    Free