SafePrompt Documentation
Send your first validation request, then enforce the verdict before model use.
Quick Start
Get an API key, supply the end user IP, and check one input before forwarding it.
Get Started →API Reference
Complete API documentation with request/response examples in multiple languages.
View API Docs →Best Practices
Choose sensitivity, understand session context and stop unsafe or unavailable checks.
Learn More →Framework Integrations
LangChain
Configure the official callback handler for the model entry points your chain uses. Check tool-result coverage in the guide and test your own workflow.
LangChain guide →Middleware & HTTP
Express and Next.js middleware, or a direct HTTP call from any language. One request screens the input before your app forwards it.
Installation guide →Inputs to Screen Before Model Use
Prompt Injection
Screens instructions that try to override the rules given to your AI
Jailbreaks
Screens attempts to redirect your AI through roleplay or jailbreak instructions
Data Extraction
Screens requests to extract system instructions or send data to an attacker
Retrieved Content
Check the exact document or tool-result text your model will receive
First Request Checklist
The quick start covers SDK and raw HTTP paths. These four checks belong in either integration.
Get an API Key
Start with 10,000 free validations a month, no credit card. Keep the key on your server.
Send a Complete Request
Send a POST request to https://api.safeprompt.dev, path /api/v1/validate, with X-API-Key, X-User-IP and Content-Type: application/json. Send a JSON body with prompt and sensitivity: strict.
Enforce the Verdict
Require a successful HTTP response and a boolean safe field. Block unsafe checks; stop or retry when validation is unavailable.
Check Later Inputs Too
Screen retrieved documents and tool results before adding them to context. Backend permissions separately authorize each tool operation.
Choose Your Next Guide
- ✓Architecture: pattern, external-reference and AI semantic checks assess submitted text
- ✓API reference: request fields, response fields, errors and plan quotas
- ✓Session context: associate checks with a conversation without assuming gradual escalation coverage
- →Next step: test safe, unsafe and unavailable checks before connecting your model