> This page is for version 0.5.1.
> 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.testing.agent_session_conformance

Integration test for how an agent refuses an agent session seed it cannot serve.

`check_agent_seed_rejected` posts the seed through the app's real `/v1/agent_sessions` route, in process, the
way an Environment Server calls a deployed agent. Call it from an agent's own tests with a seed that agent does not
support, such as a sandbox or a required grant it cannot use.

## Module Contents

### Functions

| Name                                                                                                        | Description                                                                                  |
| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [`check_agent_seed_rejected`](#nemo_gym-agents-testing-agent_session_conformance-check_agent_seed_rejected) | Seed `seed` through `app`, and raise AssertionError unless the agent refuses it as terminal. |

### API

```python
nemo_gym.agents.testing.agent_session_conformance.check_agent_seed_rejected(
    app: fastapi.FastAPI,
    seed: nemo_gym.agents.base_responses_api_agent.AgentSeedSessionRequest
) -> str
```

Seed `seed` through `app`, and raise AssertionError unless the agent refuses it as terminal.

The refusal must be HTTP 422 with a string `detail`, which is what `AgentSeedRejectedError` gives, so the
Environment Server fails the episode once with the agent's reason. A plain `ValueError` gives 500, which is
retried. Returns the refusal's detail for the caller to check.