Integrate
Any agent calls the same firewall before it calls its own model. OpenAI, LangGraph, NeMo, and a custom app all use these endpoints. PromptShield does not replace the model.
Step 1
Step 2
Step 3
Create an account to get an API key. The key is shown once. Send it as a bearer token. That account only sees its own scans. Admins can also create keys on the Keys page.
For a shared service, set DEMO_MODE=0 and PROMPTSHIELD_API_KEY, then restart the API. Callers send either header:
authorization: Bearer YOUR_KEY x-api-key: YOUR_KEY
Health and this dashboard stay readable without the key. Scan and guard calls require it when demo mode is off. A wrong key returns 401 and the key is never written back in the response.
curl -s http://127.0.0.1:8000/v1/scan \
-H "authorization: Bearer $PROMPTSHIELD_API_KEY" \
-H "content-type: application/json" \
-d '{"source_type":"user_message","trust":1,"content":"Summarise the thread."}'curl -s http://127.0.0.1:8000/v1/scan/file \ -H "authorization: Bearer $PROMPTSHIELD_API_KEY" \ -F "file=@notes.txt"
curl -s http://127.0.0.1:8000/v1/guard/tool-call \
-H "x-api-key: $PROMPTSHIELD_API_KEY" \
-H "content-type: application/json" \
-d '{"session_id":"s_42","tool":"send_email","args":{"to":"ops@example.test","body":"status"}}'Allowed. Send the original text to your model.
Sanitised. Send sanitized_text. The attack span has been replaced. spotlighted_text is the same text marked as untrusted data.
Blocked or Quarantined. Do not send the original text to the model. Show safe_alternative instead. That line is the benign remainder, or a request to rephrase, and it does not repeat the attack.
The same steps are written out in docs/INTEGRATIONS.md.