diff --git a/agentic_security/routes/probe.py b/agentic_security/routes/probe.py index 33ef5e5..8ac7196 100644 --- a/agentic_security/routes/probe.py +++ b/agentic_security/routes/probe.py @@ -1,6 +1,7 @@ import random from fastapi import APIRouter, File, Header, HTTPException, UploadFile +from fastapi.responses import JSONResponse from ..models.schemas import FileProbeResponse, Probe from ..probe_actor.refusal import REFUSAL_MARKS @@ -70,3 +71,9 @@ async def self_probe_image(): @router.get("/v1/data-config") async def data_config(): return [m for m in REGISTRY] + + +@router.get("/health") +async def health_check(): + """Health check endpoint.""" + return JSONResponse(content={"status": "ok"}) diff --git a/agentic_security/routes/test_health.py b/agentic_security/routes/test_health.py new file mode 100644 index 0000000..32ce613 --- /dev/null +++ b/agentic_security/routes/test_health.py @@ -0,0 +1,12 @@ +from fastapi.testclient import TestClient + +from ..app import app + + +def test_health_check(): + """Test the health check endpoint.""" + client = TestClient(app) + + response = client.get("/health") + assert response.status_code == 200 + assert response.json() == {"status": "ok"}