Skip to content

Correlation and attestation

Linked agent feedback is only valuable if the rating you stored is the rating for that Langfuse session. Correlation integrity is a security property, not a heuristic.

On the Vercel AI SDK + Langfuse path, you set the session id (for example via Langfuse propagateAttributes({ sessionId }, ...)). UserVane does not invent a parallel id system and does not auto-read an observation-level trace id in v1.

Use the same sessionId in three places:

  1. Langfuse / telemetry attributes for the run
  2. mintFeedbackToken({ sessionId, ... }) on your server
  3. bind({ sessionId, showToken, surveyId }) on the client

POST /v1/sdk/tokens (secret key) mints a v2 show-token with sessionId (and optional observationId / taskType) signed server-side. Only the secret-key holder can mint that binding.

When the respondent submits, POST /v1/sdk/responses may include sessionId / observationId. If the token attested those values, they must match. A token holder cannot rebind feedback onto an arbitrary session in your Langfuse project.

taskType is untrusted display metadata for PM segmentation. It does not move a Langfuse score’s session binding; forging it can only mis-bucket that user’s own row in UserVane’s read of the data.

PathResult
Server mints + client bind + matching submitStored linked; eligible for pending-scores / Langfuse push
Bootstrap-only token, no bindStored unlinked; never mislinked; never enters the push queue

Unlinked is a first-class, honest state. Prefer empty correlation over a guessed id.

When a bound token is installed, the controller uses that token and sessionId at show-decision. Submit reuses the snapshot taken then; it does not re-read a live OTel context that might have moved.

  • Observation-level auto-capture of trace ids is not a documented client API.
  • Framework adapters other than @uservane/vercel-ai are not shipped.

See also Credential-safe round-trip and the agent quickstart.