> This page is for version 0.5.0.
> For other versions, use one of these documentation indexes:
> - Main (default): https://docs.nvidia.com/nemo/gym/main/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo/gym/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo/gym/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo/gym/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo/gym/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo/gym/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo/gym/v0.3.0/llms.txt
> - 0.2.1: https://docs.nvidia.com/nemo/gym/v0.2.1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/gym/_mcp/server.

# nemo_gym.agents.agent_outcome

Agent-reported causes, independent of environment grading and retry policy.

## Module Contents

### Classes

| Name                                                                                  | Description                                                                 |
| ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [`AgentOutcome`](#nemo_gym-agents-agent_outcome-AgentOutcome)                         | Additional evidence distinguishing causes of a failed agent response.       |
| [`AgentOutcomePolicyConfig`](#nemo_gym-agents-agent_outcome-AgentOutcomePolicyConfig) | Existing Environment Server defaults for classified failed agent responses. |

### Functions

| Name                                                                                                    | Description                                                                            |
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [`agent_outcome_policy`](#nemo_gym-agents-agent_outcome-agent_outcome_policy)                           | Apply configured grading/retry rules to a classified failed response.                  |
| [`confirmed_policy_response_timeout`](#nemo_gym-agents-agent_outcome-confirmed_policy_response_timeout) | Whether the selected model operation timed out after upload on every observed attempt. |
| [`policy_timeout_failure`](#nemo_gym-agents-agent_outcome-policy_timeout_failure)                       | The agent's policy-timeout failure for a failed model reply, or `None`.                |

### Data

[`AGENT_OUTCOME_METADATA_KEY`](#nemo_gym-agents-agent_outcome-AGENT_OUTCOME_METADATA_KEY)

[`POLICY_TIMEOUT_OPERATION`](#nemo_gym-agents-agent_outcome-POLICY_TIMEOUT_OPERATION)

### API

```python
class nemo_gym.agents.agent_outcome.AgentOutcome()
```

**Bases:** `BaseModel`

Additional evidence distinguishing causes of a failed agent response.

Ordinary completion and limits already use response.status. HTTP status here
belongs to the upstream model request, not the agent endpoint's HTTP 200.

**`failure_kind`** `str`

---

**`model_config`** `= ConfigDict(extra='forbid', frozen=True)`

---

**`status_code`** `int | None = Field(default=None, ge=400, le=599, strict=True)`

---

```python
nemo_gym.agents.agent_outcome.AgentOutcome.require_registered_kind(
    value: str
) -> str
```

classmethod

Accept the shared vocabulary plus an explicitly undetermined cause.

```python
nemo_gym.agents.agent_outcome.AgentOutcome.require_request_status() -> nemo_gym.agents.agent_outcome.AgentOutcome
```

```python
class nemo_gym.agents.agent_outcome.AgentOutcomePolicyConfig()
```

**Bases:** [OutcomePolicyConfig](/nemo/gym/nemo-gym/nemo_gym/core/outcome_policy#nemo_gym-core-outcome_policy-OutcomePolicyConfig)

Existing Environment Server defaults for classified failed agent responses.

**`by_failure_kind`** `dict[str, OutcomeAction]`

---

**`by_status_code`** `dict[Annotated[int, Field(ge=400, le=599)], OutcomeAction]`

---

**`classification`** `FailureClassificationConfig = Field(default_factory=FailureClassificationConfig)`

---

**`default_action`** `OutcomeAction = OutcomeAction.FAIL`

---

**`supported_actions`** `frozenset[OutcomeAction]`

---

```python
nemo_gym.agents.agent_outcome.agent_outcome_policy(
    response: nemo_gym.core.responses_api_types.NeMoGymResponse,
    config: nemo_gym.agents.agent_outcome.AgentOutcomePolicyConfig | None = None,
    classification: nemo_gym.core.failure_kinds.FailureClassificationConfig | None = None
) -> nemo_gym.core.outcome_policy.OutcomeAction
```

Apply configured grading/retry rules to a classified failed response.

Unclassified legacy responses retain their existing grading behavior; malformed
metadata is an ungraded, nonretryable failure regardless of configuration.

```python
nemo_gym.agents.agent_outcome.confirmed_policy_response_timeout(
    report: nemo_gym.core.failure_records.FailureReport | None
) -> bool
```

Whether the selected model operation timed out after upload on every observed attempt.

Unidentified, mixed, omitted or connecting attempts do not establish a final response timeout.

```python
nemo_gym.agents.agent_outcome.policy_timeout_failure(
    error: aiohttp.ClientResponseError
) -> nemo_gym.core.typed_exceptions.NgFailureEvent | None
```

The agent's policy-timeout failure for a failed model reply, or `None`.

The reply's report must show that the final model call timed out after its upload on every attempt
(`confirmed_policy_response_timeout`). The failure is caused by `error`, so its reply keeps the model's
attempts; raise it `from error`.

```python
nemo_gym.agents.agent_outcome.AGENT_OUTCOME_METADATA_KEY = 'ng_agent_outcome'
```

```python
nemo_gym.agents.agent_outcome.POLICY_TIMEOUT_OPERATION = 'agent.policy_request'
```