What the collection policy controls
Every time your middleware processes a request, it decides whether to embed a_agentFeedback object in the response. The collection policy is the dashboard-side half of that decision:
- Route patterns —
includeandexcludeglob patterns set in the dashboard, scoped to a single product. These mirror the same wildcard syntax as the SDK options (*for a single path segment,**for multiple). - FeedbackMode override — you can change the feedback mode for a subset of routes directly from the dashboard without touching your deployed code.
outcome (one of success, partial, or failure) and note (one short sentence). The collection policy only governs which responses embed the feedback request in the first place.
How SDK filtering and the collection policy interact
Filtering happens in two sequential steps:- SDK-level evaluation — the
includeandexcludearrays you pass toagentFeedback()are checked first. If the request path does not pass SDK-level filtering, it is excluded immediately and the dashboard policy is never consulted. - Dashboard policy evaluation — for requests that pass SDK-level filtering, the dashboard policy applies additional scoping. A response is instrumented only when both layers allow it.
The SDK’s built-in exclusions (health endpoints, metrics, assets, and Agent Feedback’s own endpoints) are applied before both layers and cannot be overridden from the dashboard.
FeedbackMode options
The feedback mode controls how the instruction is phrased inside the_agentFeedback envelope. You can set a default mode in your SDK options and override it per route in the dashboard.
auto (default)
The instruction tells the agent to submit its outcome review autonomously before delivering its final response to the user. The requested field in the envelope is true. Use auto for endpoints where you want deterministic collection from feedback-aware agent runtimes.
ask
The instruction requests feedback but does not command the agent. The requested field is false. Use ask for sensitive product areas — such as endpoints that handle emotionally difficult topics — where a softer tone is more appropriate.
off
Disables the feedback contract on matching responses entirely. No _agentFeedback field is embedded and no telemetry opportunity is enqueued for that interaction. Use off to carve out specific routes within a broader include pattern.
Setting
feedbackMode: "off" in your SDK options disables instrumentation for all routes in that middleware instance. Use the dashboard policy to disable specific routes within an otherwise instrumented surface.Best practices
- Validate before expanding — confirm each instrumented route passes the doctor check before adding more routes to your
includelist. - Use
askmode for sensitive areas — any endpoint that returns emotionally sensitive content, legal advice, or medical information is a good candidate foraskinstead ofauto. - Layer your filters thoughtfully — keep broad patterns in the dashboard policy and precise exclusions in your SDK
excludearray, where they’re reviewed during code changes. - Review the policy after major route changes — if you rename or restructure your API routes, revisit both your SDK options and your dashboard policy to make sure the patterns still match correctly.
Privacy
The collection policy determines which responses request feedback. It has no effect on the data that is stored when feedback is submitted. Agent Feedback enforces privacy at the submission layer:- Only
outcomeandnoteare accepted. - Notes are whitespace-normalized and must be between 8 and 500 characters.
- Fields containing prompts, transcripts, credentials, personal data, or raw product content are rejected by the backend.
- Capability tokens contain only protocol version, interaction ID, issuance and expiry timestamps, and a random nonce — never customer data or product content.
Disabling the collection policy on a route does not delete previously collected feedback for that route. It only stops new feedback contracts from being embedded going forward.