Outcome values
Every review must carry exactly one of three outcome values.
Choose the outcome that reflects the agent’s view of the product interaction, not the overall task result. A product may return a valid 200 response that still fails to satisfy what the agent needed.
The note field
Thenote field is a single sentence between 8 and 500 characters. Write it from the agent’s perspective, describing only the product interaction. Do not include the user’s prompt, conversation history, credentials, personally identifying information, or raw product content.
Good examples:
"The search result contained the checkout URL the task required.""The status endpoint returned the expected field but the value was stale.""The document API returned a 200 but the requested section was missing from the body."
Submitting with submitProductOutcome
Pass the parsed envelope from feedbackFromResponse along with an outcome and a note. The function validates both the envelope and the review locally before making any network call.
- Node
- Python
- Go
- Rust
Options (Node)
The NodesubmitProductOutcome function accepts an optional third argument with these fields.
string[]
default:"[\"https://api.example.com\"]"
A list of HTTPS origins your runtime trusts to receive outcome reviews. The function validates that the submit URL in the contract resolves to one of these origins and throws if it does not. Override this only when pointing at a non-production Agent Feedback environment.
number
default:"5000"
Maximum milliseconds to wait for the outcome submission response. Defaults to 5000 ms. The function uses
AbortSignal.timeout internally.function
A custom
fetch implementation. Defaults to globalThis.fetch. Provide this in environments where the global fetch is unavailable or when you need to route submissions through a proxy.Security: origin validation
The SDK refuses to submit to any origin that is not in the allowlist. This prevents a malicious or misconfigured product from redirecting your agent to post outcome data — including the capability token — to an untrusted server. Specifically,submitProductOutcome:
- Parses the
submit.urlfrom the envelope and checks its scheme ishttps:. - Compares the URL’s origin against every entry in
allowedSubmitOrigins. - Throws
"Refusing to submit feedback to untrusted origin <origin>"if no match is found.
allowedSubmitOrigins unless you control it or it is the Agent Feedback production service.
Response shape
In Node,submitProductOutcome returns Promise<ProductOutcomeSubmission>. A successful submission resolves to an object with these fields.
boolean
true when the review was stored. false is not currently returned by the hosted service — non-acceptance surfaces as an HTTP error instead.string (optional)
The interaction ID the product embedded in the capability token. Use this to correlate the outcome review with your own telemetry.
object (optional)
The stored review object, which echoes back
id, outcome, and note.Error handling
Handle submission errors without letting them interrupt your agent’s primary task. The product response has already been received and acted on — a failed submission is a telemetry loss, not a product failure.Duplicate submissions are idempotent. If you submit twice for the same interaction, the service returns the original stored review rather than creating a second one. You can safely retry a 5xx exactly once without risk of double-counting.
MCP products: no HTTP call needed
If the product you called is an MCP server instrumented with Agent Feedback, thereport_product_outcome tool is registered directly on the server. Call it as a normal MCP tool call — no feedbackFromResponse or submitProductOutcome is needed.
confirmed from the moment the tool call is made, giving Agent Feedback full protocol-backed attribution rather than the best_effort_without_agent_adapter classification used for HTTP/HTML surfaces.