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.
You own sessionId
Section titled “You own sessionId”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:
- Langfuse / telemetry attributes for the run
mintFeedbackToken({ sessionId, ... })on your serverbind({ sessionId, showToken, surveyId })on the client
Attestation: bound into the show-token
Section titled “Attestation: bound into the show-token”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.
Linked vs unlinked
Section titled “Linked vs unlinked”| Path | Result |
|---|---|
Server mints + client bind + matching submit | Stored linked; eligible for pending-scores / Langfuse push |
| Bootstrap-only token, no bind | Stored unlinked; never mislinked; never enters the push queue |
Unlinked is a first-class, honest state. Prefer empty correlation over a guessed id.
Snapshot at show time
Section titled “Snapshot at show time”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.
What v1 does not do
Section titled “What v1 does not do”- Observation-level auto-capture of trace ids is not a documented client API.
- Framework adapters other than
@uservane/vercel-aiare not shipped.
See also Credential-safe round-trip and the agent quickstart.