Sentiment Analysis
Detects hostile, manipulative, or threatening tones
API Field:sentiment_enabledOverview
Sentiment Analysis detects the emotional tone of user inputs, identifying highly negative, hostile, manipulative, or threatening sentiment that may indicate malicious intent or user distress requiring special handling.
What It Detects
- Angry or hostile language
- Manipulative phrasing
- Threatening undertones
- Extreme frustration
- Coercive language patterns
- Signs of user distress
- Aggressive communication styles
Why It Matters
Understanding sentiment helps route conversations appropriately, identify at-risk users, prevent escalation, and maintain healthy interaction patterns. It's crucial for customer service and mental health applications.
Technical Details
Risk Score Range
0.0 - 1.0 (High risk: > 0.7)
Confidence Level
Typically 0.80 - 0.94
Processing Time
< 60ms per scan
Common Use Cases
Detection Examples
Highly frustrated customer - may need escalation to human agent.
Threatening and coercive language pattern.
Signs of distress and helplessness - may need support resources.
API Usage
Enable this scanner in your API request by setting sentiment_enabled to true in your API key settings, or include it in your request:
curl -X POST https://benguard.io/api/v1/scan \
-H "X-API-Key: ben_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Your user input here"
}'The scanner settings are configured per API key in your dashboard under Settings → Scanner Configuration.
Response Format
When this scanner detects a threat, the response will include:
{
"is_valid": false,
"status": "threat_detected",
"risk_score": 0.78,
"threat_types": ["sentiment"],
"details": {
"results": [
{
"scanner": "sentiment",
"threat_detected": true,
"risk_score": 0.78,
"confidence": 0.92,
"details": {
"reason": "Highly frustrated customer - may need escalation to human agent.",
"evidence": ["detected pattern in input"]
}
}
]
},
"request_id": "req_abc123"
}Best Practices
- Create escalation paths for high-sentiment conversations
- Train support teams on AI-flagged interactions
- Provide crisis resources for distress signals
- Use sentiment trends for service improvement
- Balance automation with human empathy
Related Scanners
Consider enabling these related scanners for comprehensive protection: