guide
Annotation queues
Project-scoped human review backlogs: enqueue work items on a trace or observation, claim with an optional reviewer label, then complete — via API, Python SDK, or the in-app Queues UI.
How it works
- Project-scoped queues
- Named backlogs of work items in one project. Each item points at exactly one trace or observation.
- Claim → complete
- Items move pending → claimed → completed. Status changes only via claim/complete endpoints — not PATCH.
- Opaque reviewer
- Optional string label on claim or enqueue. Not identity or RBAC — project API keys (and UI session) gate access.
- Queues vs scores / notes
- Queues organize review work. Scores hold structured values; notes hold free-text rationale on the same targets.
Auth
Every public queue route needs Authorization: Bearer sk-as-… from the project's Keys tab. Keys are project-scoped; missing or invalid keys return 401. Reviewer strings are labels only — not membership or RBAC.
API
Base path /api/public/annotation-queues. Queue CRUD, item enqueue/list/patch/delete, plus claim and complete.
Create queue
curl -X POST "$AGENTSENTRI_HOST/api/public/annotation-queues" \
-H "Authorization: Bearer $AGENTSENTRI_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"human-review","description":"spot-check new traffic"}'Enqueue item
curl -X POST "$AGENTSENTRI_HOST/api/public/annotation-queues/QUEUE_ID/items" \
-H "Authorization: Bearer $AGENTSENTRI_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"traceId": "TRACE_ID",
"body": "Check grounding vs retrieved context"
}'Claim
curl -X POST "$AGENTSENTRI_HOST/api/public/annotation-queues/QUEUE_ID/items/ITEM_ID/claim" \
-H "Authorization: Bearer $AGENTSENTRI_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"reviewer":"alex"}'Complete
curl -X POST "$AGENTSENTRI_HOST/api/public/annotation-queues/QUEUE_ID/items/ITEM_ID/complete" \
-H "Authorization: Bearer $AGENTSENTRI_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{}'List pending with GET …/annotation-queues/:id/items?status=pending. Do not PATCH status — use claim / complete.
UI
Open project nav Queues: create queues, filter items by status, enqueue with a trace or observation id, then Claim / Complete. Target links open the trace detail page so you can add scores or notes while reviewing.
Python SDK
from agentsentri import AgentSentri
sentri = AgentSentri()
queue = sentri.create_annotation_queue(name="human-review")
queue_id = queue["queue"]["id"]
item = sentri.enqueue_annotation_item(
queue_id,
trace_id="TRACE_ID",
body="Check grounding vs retrieved context",
)
item_id = item["item"]["id"]
sentri.claim_annotation_item(queue_id, item_id, reviewer="alex")
sentri.complete_annotation_item(queue_id, item_id)Helpers: create_annotation_queue, enqueue_annotation_item, list_annotation_items, claim_annotation_item, complete_annotation_item.
Edge cases
| XOR target on enqueue | Exactly one of traceId or observationId — both or neither returns 400. |
| Claim race | Concurrent claims on the same pending item: one wins, the other gets 409. |
| Complete after claim | Completing from pending is rejected (409) — claim first. |
| Reviewer is not RBAC | Opaque string only; project keys isolate data. No full queue RBAC in this story. |