Sorsh integration guide
Add trust scoring to your labeling tool in a few lines. Sorsh records how a task is produced and returns a trust assessment your team can review.
What Sorsh does
Sorsh watches the process of an annotation (typing cadence, paste events, focus changes, time on task) and scores how likely the work is genuine versus pasted from an LLM or rushed. A text-only AI detector or a screenshot of the final answer cannot see this signal; the behavior can.
You add a small script to your existing labeling UI, point it at the field workers type into, and call submit() when they finish. Sorsh returns a trust score and the reasons behind it.
Data & privacy
- Behavioral events store no content. Keystrokes are recorded as event types and timing (e.g.
char,backspace,pastewith a length), never the characters typed. - The final answer text is sent as
final_text, so the quality and AI-text signals can run on it. If you must not transmit answer content, setfinal_textto empty and Sorsh scores on behavior alone (see below). - Answer text is not stored. On pilot instances Sorsh scores the answer and prompt text in memory and does not store it by default. Only scores, verdicts, timing and the answer's length are kept. Answer text stored before then was deleted on 7 Nov 2026 (UTC).
- AI judge (optional). Off by default. If you opt in writing, answer text is sent to Groq for scoring and is not stored by Sorsh.
- Access. Operators sign in with Google or an emailed one-time code. Console credentials travel in request headers only, never in URLs. Deletions, exports and data views are logged with the operator's email.
- No cookies, no third-party calls from the SDK. One POST per submission to your Sorsh endpoint.
- Effort reporting is timing only. Sorsh aggregates the timing signals (never content) per contributor over a reporting window to produce operator-only effort reports and an exportable timesheet you can use for billing. These reports are never shown to workers. There are no screenshots, no screen recording, and no application, website, or URL tracking, by design.
Quick start
Two lines: load the SDK, then call Sorsh.embed with the selector of your answer field. copy & adapt
<!-- 1. load the SDK (served by your Sorsh instance) --> <script src="https://pilot.sorsh.in/sdk/sorsh-sdk.js"></script> <!-- 2. wire it to your existing field + submit button --> <script> Sorsh.embed({ endpoint: "https://pilot.sorsh.in", pilotKey: "pk_xxx", // worker access code (from Sorsh) contributor: function(){ return CURRENT_USER_ID; }, // who is doing the task answer: "#answer", // CSS selector of the answer field submit: "#submit" // optional: send telemetry on this click }); </script>
That is the whole integration for a text task. If you have no obvious submit button, omit submit and call Sorsh._session.submit() yourself when the worker is done.
No-JS variant (data attributes)
Add data-sorsh-answer to your field and data-sorsh-submit to your button, then call Sorsh.embed({endpoint, pilotKey, contributor}) with no selectors.
Sorsh.embed(options)
| Option | Type | Notes |
|---|---|---|
endpoint | string | Base URL of your Sorsh instance. Required. |
pilotKey | string | Worker access code; appended as ?pk=. Required for a pilot instance. |
contributor | string | fn | Stable ID for the worker. A function is called at instrument time. Defaults to a data-sorsh-contributor attribute or "worker". |
answer | CSS selector | The text field. Default [data-sorsh-answer]. SPA-safe: Sorsh waits for it to render. |
submit | CSS selector | Optional. Clicking it sends telemetry. Default [data-sorsh-submit]. |
taskId, project, prompt | string | Labels shown to reviewers. Optional. |
modality | string | "text" (default) or "transcription". |
Returns an object with submit(). The live session is also at Sorsh._session.
Sorsh.instrument(element, options): full control
For custom flows, instrument an element yourself and submit explicitly.
const session = Sorsh.instrument( document.querySelector("#answer"), { contributorId: userId, taskId: "ticket-sum", project: "acme", prompt: "Summarize the ticket", modality: "text", endpoint: "https://pilot.sorsh.in/api/ingest?pk=pk_xxx" } ); // ...worker types... const result = await session.submit(); // returns the trust assessment
Session methods: submit() → Promise of the assessment; payload() → the raw payload (inspect/forward); detach() → stop listening; recordPlay() / recordSeek() for audio transcription tasks.
session.payload(), set final_text="", and POST it yourself. Behavioral scoring still works; quality/AI-text signals simply won't.Non-text tasks
For classification, A/B preference, or bounding-box work, use Sorsh.instrumentInteraction(containerEl, options). It records pointer movement, scroll, media playback, and box draws. Record the choice with session.choose(value) (or setSelection), then session.submit(). Set modality to "classification", "preference", or "bbox".
The trust response
submit() resolves to JSON like:
{
"trust_score": 18, // 0–100, higher = more trustworthy
"verdict": "high_risk", // "clear" | "review" | "high_risk"
"behavioral_risk": 0.92,
"quality_risk": 0.3,
"ai_likelihood": 0.88,
"reasons": ["Answer appeared in one paste with no typing", ...],
"detector": "groq-judge (...)",
"signals": { "time_on_task_s": 4, ... }
}
You can ignore the response in the worker UI (recommended, so workers can't see whether they were flagged) and review everything in the Sorsh operator console instead.
Effort signals
Alongside the risk signals, each assessment carries a timing-only breakdown of the wall-clock time (all in seconds, derived from event timing, never content). They are additive: active_s + idle_s + away_s = time_on_task_s.
| signal | meaning |
|---|---|
active_s | hands-on, in-field time (gaps between events while focused, each capped at 30s so a long think is not counted as work). |
idle_s | focused-but-idle time (long pauses with the field still focused). |
away_s | time tabbed out of the answer field (blur to focus). Never billed as active. |
first_activity_s | time from task start to the first event. |
longest_gap_s | the single longest focused pause. |
Experimental: retype signal
Text answers also carry experimental.retype: a 0 to 1 score, a likely flag, the evidence behind it and the timing features it uses. It estimates whether an answer was typed by hand while reading it from another tab or a phone, which paste detection cannot see. It is not part of trust_score or verdict while we validate it with a labeled accuracy benchmark; the field may change.
Telemetry events (reference)
Each event is { t: ms_since_start, type, ... }. Text/transcription:
| type | meaning |
|---|---|
char / backspace | a keystroke (printable / delete). No character stored. |
nav k | a non-printing key, reported only by class: arrow, home_end, page, enter, tab, mod (shift/ctrl/alt/cmd) or other. |
caret | a click or drag left the cursor inside the text (going back to edit). No position stored. |
paste len | a paste, with the pasted length only. |
insert len | a large programmatic insertion (autofill/drag) that didn't fire a paste. |
focus / blur | field gained / lost focus (tab-away to copy is a tell). |
play / seek | audio playback for transcription tasks. |
Interaction tasks add move, down, up, scroll, click, box.
Authentication
A pilot instance requires a worker access code on every submission, supplied as ?pk=CODE on the endpoint (what pilotKey sets) or an X-Sorsh-Pilot: CODE header. Submissions without it are rejected with 403. The code throttles who can post; rotate it by asking Sorsh to change it.
CORS & hosting
- The SDK is plain ES5, no build step, no dependencies. Load it with a normal
<script>tag. - Submissions are a cross-origin
POSTto your Sorsh instance, which returns permissive CORS during a pilot. For production we can lockAccess-Control-Allow-Originto your domain(s). - Everything runs client-side in the worker's browser; you do not need server-to-server calls.
No-code option: the browser extension
If you would rather not touch your tool at all for a pilot, workers can install the Sorsh Trust Capture browser extension. It captures the same telemetry from your existing pages with zero code changes: each worker just sets the answer-field selector once. Ask your Sorsh contact for it. The SDK above is the better long-term integration.
FAQ
Will this slow down our tool?
No. The SDK adds passive event listeners and one POST per submission. No polling, no blocking.
What if a worker never clicks submit?
No telemetry is sent for that task. Wire submit to your real "done" action, or call Sorsh._session.submit() from your own handler.
Does it work in a single-page app?
Yes. Sorsh.embed waits for the answer field to appear, so it works when your UI renders the field after navigation.
Can a worker fake the telemetry?
The events are produced in the browser, so a sophisticated scripted client could forge realistic timing. Sorsh raises the cost of crude forgery and is layered with quality and AI-text signals; per-event signing is on the roadmap for stronger guarantees.
Can Sorsh replace my time tracker?
For the part that matters to a data-labeling team, yes: Sorsh reports genuine hands-on effort per task and per contributor (active vs idle vs away time, and an exportable timesheet) so you can pay fairly and show a client verifiable effort. What Sorsh deliberately does not do is device-level monitoring: no screenshots, no screen recording, no application or website tracking. That is a design choice, not a gap. It keeps the data minimal and defensible, and it avoids the surveillance that regulators and works councils increasingly reject. Two honest caveats on the numbers: a submission with no captured events reports its active time as a floor (up to 30s), not measured work; and for very long sessions (over 8,000 events) the client keeps only the start and end, so a dropped middle reads as idle, never as inflated active time.
