@agent-feedback/node. It fetches a real URL from your product, checks that the Agent Feedback contract is correctly embedded, and then submits a synthetic outcome review through the full chain — all in a single command. Run it right after your first deployment to confirm everything is wired up before you open feedback collection to agents.
Install and run
What the doctor checks
The doctor performs these checks in order:- HTTP status is 2xx — the target URL must return a successful response. Any error status causes an immediate failure.
- Feedback contract is present — the doctor looks for the contract in three locations depending on your content type:
_agentFeedbackkey in a JSON response body<script id="agent-feedback" type="application/json">tag in an HTML responseAgent-Feedbackresponse header (base64url-encoded JSON) for all other content types
instructionfield is non-empty — the contract must contain a valid instruction string.submitobject is complete — the doctor verifies:submit.urlis presentsubmit.methodis"POST"submit.authorizationstarts with"Bearer afr2_"submit.fieldsis present
- Synthetic review is accepted — the doctor submits
{ "outcome": "success", "note": "The integration doctor verified this product response end to end." }to the submit URL and confirms the backend returns a2xxresponse with aninteractionId.
Failure messages
"Response is missing feedback instructions"
"Response is missing feedback instructions"
The doctor found a
2xx response but no feedback contract in any of the three expected locations (JSON body, HTML script tag, or response header).What to check:- Confirm the middleware is mounted before your route handlers, not after them.
- Check your
includelist — if it’s set, make sure the URL path you’re testing matches one of the patterns. - Check your
excludelist — the path may be excluded by one of your patterns or by the built-in exclusions. - Verify
feedbackModeis not"off"andAGENT_FEEDBACK_ENABLEDis not"false"in your environment. - Make sure the response has a
2xxstatus code; the middleware skips non-success responses.
"Response has an incomplete feedback submission contract"
"Response has an incomplete feedback submission contract"
The doctor found a contract with an
instruction field, but the submit object is missing required fields, uses the wrong method, or the authorization header does not start with "Bearer afr2_".What to check:- This error almost always means you’re using a v1 key format that cannot produce v2 capability tokens. Open the Agent Feedback dashboard, create a new product key, and update
AGENT_FEEDBACK_KEYin your environment. - Confirm you haven’t set a custom
endpointthat points to an unreachable or incorrect backend.
"Product returned HTTP <status>"
"Product returned HTTP <status>"
The target URL returned a non-
2xx HTTP status code.What to check:- Make sure the URL is correct and the service is running.
- If the route requires authentication, the doctor does not send credentials. Consider testing with a public endpoint first, or add a test route that doesn’t require auth.
- Check your server logs for the underlying error.
"Synthetic review returned HTTP <status>"
"Synthetic review returned HTTP <status>"
The contract was valid, but when the doctor submitted the synthetic review to
submit.url, the backend returned a non-2xx status.What to check:HTTP 401or403— the capability token may have expired (tokens last two hours) or the product key may have been revoked. Fetch the URL again to get a fresh token.HTTP 503— the Agent Feedback backend may be temporarily unavailable. Wait a moment and retry.- If the problem persists, copy the
submit.urlandsubmit.authorizationvalues from the raw response and check the Agent Feedback status page.
"Usage: agent-feedback-doctor <product-response-url>"
"Usage: agent-feedback-doctor <product-response-url>"
You ran the command without a URL argument.Fix: Pass a full URL as the first argument: