Outcomes let you give an Agent an explicit success criterion (a Rubric). The Agent iterates against the Rubric until the work meets the criteria.
Core Concepts
| Term | Description |
|---|
| Outcome | The expected final result of a task |
| Rubric | The success-criteria text the Agent uses to judge its own output |
When you want the Agent to deliver work to a specific quality bar, send the Rubric to the Session via a user.define_outcome event. The Agent will keep referring to the criteria as it works.
{
"events": [
{
"type": "user.define_outcome",
"rubric": "The generated report must include: 1) an executive summary under 200 words, 2) at least 3 actionable recommendations, 3) sources cited."
}
]
}
Field Reference
| Field | Type | Required | Description |
|---|
| type | string | Yes | Fixed value user.define_outcome |
| rubric | string | Yes | Success criteria text |
Typical Usage
- Create a Session and send the initial message.
- Send
user.define_outcome with the Rubric to define success.
- The Agent iterates against the Rubric.
- Inspect the output once you receive
session.status_idle.
Make Rubrics specific and measurable. Avoid vague language like “make it better”; use criteria like “code coverage no less than 80%“.
curl Example
# Send an Outcome definition to an existing Session
curl -X POST https://api.qoder.com/api/v1/cloud/sessions/sess_019e392c0d1e74e095d21ea4c6b41def/events \
-H "Authorization: Bearer $QODER_PAT" \
-H "Content-Type: application/json" \
-d '{
"events": [
{
"type": "user.define_outcome",
"rubric": "Refactored function: 1) all unit tests pass, 2) cyclomatic complexity <= 10, 3) no lint warnings."
}
]
}'
Successful Response (202 Accepted)
{
"data": [
{
"id": "evt_019e4a1b2c3d4e5f6a7b8c9d0e1f2a3b",
"type": "user.define_outcome",
"rubric": "Refactored function: 1) all unit tests pass, 2) cyclomatic complexity <= 10, 3) no lint warnings.",
"session_id": "sess_019e392c0d1e74e095d21ea4c6b41def",
"schema_version": "1.0",
"created_at": "2026-05-18T16:00:00.000Z",
"processed_at": "2026-05-18T16:00:00.000Z"
}
]
}
Outcomes vs. Regular Messages
| Dimension | user.message | user.define_outcome |
|---|
| Purpose | Send a conversational message | Define success criteria |
| Triggered behavior | The Agent replies | The Agent iterates against the criteria |
| Key field | content | rubric |
| Timing | Any time | Typically before or alongside the initial task |
Best Practices
- Send the Outcome before or alongside the task instructions (
user.message).
- Use a numbered list in the Rubric so the Agent can verify items individually.
- For complex tasks, break the Rubric into multiple measurable acceptance criteria.
- Keep the Rubric under 500 words.