User feedback: ratings from your app's users
Your users’ ratings are one of the best signals of whether an AI answer was any good. Send them to Shield360 with the trace that produced the answer, and you can see the worst-rated answers, compare releases and compare feature-flag variants.
Send feedback
Section titled “Send feedback”import Shield360 from "shield360";
// While handling the request, keep the trace id with the answer.const traceId = Shield360.getCurrentTraceId();
// Later, when the user rates it:await Shield360.feedback({ traceId, score: 1 }); // thumbs upawait Shield360.feedback({ traceId, score: 4, scale: "stars", comment: "Close, but missed one item" });feedback returns true or false and never throws.
import shield360
trace_id = shield360.get_current_trace_id()
shield360.feedback(1, trace_id=trace_id) # thumbs upshield360.feedback(-1, trace_id=trace_id) # thumbs downfeedback returns True or False and never raises.
curl -X POST https://app.shield360.ai/api/feedback \ -H "Authorization: Bearer $SHIELD360_API_KEY" \ -H "Content-Type: application/json" \ -d '{"traceId": "4bf92f3577b34da6a3ce929d0e0e4736", "score": 5, "scale": "stars"}'| Field | Meaning |
|---|---|
traceId (required), spanId | The answer being rated |
score (required) | 1 or -1 for thumbs up or down, or 1 to 5 with scale: "stars". A 1 with no scale is a thumbs up. |
comment | What the user wrote |
userId, tenantId | Who rated it, and their customer |
metadata, app, release, feedbackId | Extra context. Sending the same feedbackId again replaces the rating. |
The endpoint takes only an environment API key, bodies up to 16 KB, and is rate-limited per key.
See feedback
Section titled “See feedback”- Build → Telemetry → Feedback shows scores by day, the worst-rated traces, scores by release and scores by feature-flag variant.
- Each trace has a Feedback tab with its ratings and comments.
- The release regression report compares feedback scores between releases.
What is stored
Section titled “What is stored”- Comments are stored only if your organization stores free text. They are cleaned of secrets and masked for personal data first. Otherwise they are dropped.
userIdandtenantIdare stored only as a keyed hash, never as sent.- Metadata is always masked.
- Ratings are kept for 400 days, and comments for 90 days.
Permissions
Section titled “Permissions”Viewing scores needs View telemetry. Reading comments on a trace needs View a request’s contents.