English | 简体中文
sharpit: secure-by-default developer console and pytest gate for FastAPI


sharpit is an open-source developer console and pytest plugin for FastAPI and Starlette applications, with Flask
supported for test gates. One call, sharpit.install(app), mounts a local web console at /sharpit that shows your
configuration and where each value came from, every route, every SQL statement with the request that ran it, N+1
queries, exceptions, HTTP exchanges and health. pytest --sharpit turns the same capture into CI gates for N+1
queries, query budgets and swallowed exceptions. A command-line client and an MCP endpoint let scripts and AI coding
agents query the running app.
Security is built in, both ways. sharpit is safe to run inside your app: it fails closed, answers loopback callers
only, refuses cross-site requests and masks secrets in every output. It also finds security problems in your app: a
security advisor ported from BootUI reviews authentication, sessions, CORS, OAuth2/JWT and transport settings; an
in-process probe checks HTTP security headers and CORS preflight responses; and an on-demand scan checks installed
packages against OSV with EPSS exploit scores.
sharpit is a Python port of BootUI by Julien Dubois (Apache-2.0), the Spring
Boot developer console: the same design goals, JSON contract and test cases, with a new UI. If you have used Spring
Boot Actuator or BootUI, sharpit gives a FastAPI app the same kind of runtime view.
Quick start
-
Install sharpit and the FastAPI development server:
pip install "sharpit[fastapi]" "fastapi[standard]" # or: uv add "sharpit[fastapi]" "fastapi[standard]"
fastapi[standard] provides fastapi dev and uvicorn. Leave it out if your project already has a server.
-
Save this as app.py:
from fastapi import FastAPI
import sharpit
app = FastAPI()
@app.get("/hello")
def hello() -> dict[str, str]:
return {"message": "hello"}
# Register your application middleware first, then mount sharpit:
sharpit.install(app) # mounts /sharpit and /sharpit/api
-
Run it with a dev signal and open http://127.0.0.1:8000/sharpit/:
fastapi dev app.py # or: uvicorn app:app --reload