API
HTTP endpoints for guarding input and output, session management, and health checks for the Defend service.
Base URL is your deployed host (for local development, http://localhost:8000). All versioned routes in this release live under /v1.
Guard endpoints
Evaluate text at the two integration points: before your LLM and before you return model output. Send JSON bodies; responses include action, session_id, score, modules_triggered, and latency_ms.
POST /v1/guard/input
Evaluate inbound user text before your LLM call.
POST /v1/guard/output
Evaluate model output before returning it, optionally with session context.
Session and operations
Inspect or clear server-side session state, and probe process health for load balancers and observability.
Sessions API
Inspect or delete server-side session state (GET and DELETE on /v1/sessions/:session_id).
Health and readiness
Liveness, readiness, and Prometheus metrics (/v1/health, /v1/ready, /v1/metrics).
Interactive OpenAPI
When you run defend serve, open /docs on the FastAPI app for a live OpenAPI UI against your instance.