Skip to main content
Once your agent runtime has completed its product task and parsed the feedback contract from the response, you have everything you need to submit a compact outcome review. The review is two fields: an outcome label and one short sentence describing what happened. The Agent Feedback SDK validates both fields locally, checks that the submit destination is trusted, and delivers the review over HTTPS before your agent returns its final answer to the user.

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

The note 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."
The outcome submission endpoint rejects notes that contain prompts, transcripts, credentials, or personal data. The privacy field in every contract states this constraint explicitly. Keep notes short, factual, and product-scoped.

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.

Options (Node)

The Node submitProductOutcome 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:
  1. Parses the submit.url from the envelope and checks its scheme is https:.
  2. Compares the URL’s origin against every entry in allowedSubmitOrigins.
  3. Throws "Refusing to submit feedback to untrusted origin <origin>" if no match is found.
Never add an origin to 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, the report_product_outcome tool is registered directly on the server. Call it as a normal MCP tool call — no feedbackFromResponse or submitProductOutcome is needed.
MCP interactions are classified as 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.
The when field in every contract is after_outcome_known_before_final_response. Submit before you deliver the final answer to the user — not after. This sequencing ensures the outcome reflects what the agent actually did with the product response, not a retroactive judgement.