> This page is for version 0.7.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.sandbox.failures

Shared sandbox failure-event construction from facts classified by each provider.

## Module Contents

### Functions

| Name                                                            | Description                                                               |
| --------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [`sandbox_failure`](#nemo_gym-sandbox-failures-sandbox_failure) | Build a sandbox event from explicit facts; callers raise it `from cause`. |

### API

```python
nemo_gym.sandbox.failures.sandbox_failure(
    operation: str,
    failure_kind: str,
    sandbox_id: str | None = None,
    cause: BaseException | None = None,
    reason: str | None = None,
    execution_id: str | None = None,
    provider: str | None = None,
    provider_status_reason: str | None = None,
    exit_code: int | None = None,
    http_status: int | None = None
) -> nemo_gym.core.typed_exceptions.NgFailureEvent
```

Build a sandbox event from explicit facts; callers raise it `from cause`.

This shared factory does not classify SDK exceptions or choose policy actions.
Each provider translates its SDK errors into a registered kind before calling
it (for example, `opensandbox_failure`). HTTP status must describe this
operation, not a child failure; causes retain their own evidence.