> This page is for version Latest (default).
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo/guardrails/latest/llms.txt
> - v0.25.0: https://docs.nvidia.com/nemo/guardrails/v0.25.0/llms.txt
> - v0.24.1: https://docs.nvidia.com/nemo/guardrails/v0.24.1/llms.txt
> - v0.24.0: https://docs.nvidia.com/nemo/guardrails/v0.24.0/llms.txt
> - v0.23.0: https://docs.nvidia.com/nemo/guardrails/v0.23.0/llms.txt
> - v0.22.0: https://docs.nvidia.com/nemo/guardrails/v0.22.0/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/guardrails/llms.txt.

# nemoguardrails.library.tool_safety_check.actions

## Module Contents

### Functions

| Name                                                                                                               | Description                                                                                |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| [`tool_safety_check_tool_call`](#nemoguardrails-library-tool_safety_check-actions-tool_safety_check_tool_call)     | Checks a tool call's arguments against per-tool safety instructions using a specified LLM. |
| [`tool_safety_check_tool_result`](#nemoguardrails-library-tool_safety_check-actions-tool_safety_check_tool_result) | Checks a tool result's content against per-tool safety instructions using a specified LLM. |

### Data

[`_DEFAULT_TEMPERATURE`](#nemoguardrails-library-tool_safety_check-actions-_DEFAULT_TEMPERATURE)

### API

```python
nemoguardrails.library.tool_safety_check.actions.tool_safety_check_tool_call(
    llms: typing.Dict[str, nemoguardrails.types.LLMModel],
    llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
    tool_call: nemoguardrails.types.ToolCall,
    tool_definition: typing.Optional[nemoguardrails.guardrails.tool_schema.Tool],
    model_name: typing.Optional[str] = None,
    variant: typing.Optional[str] = None,
    argument_name: typing.Optional[str] = None,
    kwargs = {}
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Checks a tool call's arguments against per-tool safety instructions using a specified LLM.

**Parameters:**

**`tool_call`** `ToolCall`

[`ToolCall`](/nemo/guardrails/guardrails-python-sdk/nemoguardrails/types#nemoguardrails-types-ToolCall) — The tool call to check.

---

**`tool_definition`** `Optional[Tool]`

`Optional[` [`Tool`](/nemo/guardrails/guardrails-python-sdk/nemoguardrails/guardrails/tool_schema#nemoguardrails-guardrails-tool_schema-Tool) `]` — The declared tool, used only by @tool_call_validation.

---

**`model_name`** `Optional[str]` — default: None

The judge model, from `$model=` on the flow.

---

**`variant`** `Optional[str]` — default: None

Selects which `config.prompts` task to render, from `$variant=` on the flow.

---

**`argument_name`** `Optional[str]` — default: None

Narrows the arguments sent to the judge to one named argument, from
`$argument=` on the flow. Absent, the full arguments dict is sent.

---

```python
nemoguardrails.library.tool_safety_check.actions.tool_safety_check_tool_result(
    llms: typing.Dict[str, nemoguardrails.types.LLMModel],
    llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
    tool_call: nemoguardrails.types.ToolCall,
    tool_result: nemoguardrails.guardrails.tool_schema.ToolResult,
    model_name: typing.Optional[str] = None,
    variant: typing.Optional[str] = None,
    kwargs = {}
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Checks a tool result's content against per-tool safety instructions using a specified LLM.

**Parameters:**

**`tool_call`** `ToolCall`

[`ToolCall`](/nemo/guardrails/guardrails-python-sdk/nemoguardrails/types#nemoguardrails-types-ToolCall) — The prior call this result answers, used to resolve the tool name.

---

**`tool_result`** `ToolResult`

[`ToolResult`](/nemo/guardrails/guardrails-python-sdk/nemoguardrails/guardrails/tool_schema#nemoguardrails-guardrails-tool_schema-ToolResult) — The tool result to check.

---

**`model_name`** `Optional[str]` — default: None

The judge model, from `$model=` on the flow.

---

**`variant`** `Optional[str]` — default: None

Selects which `config.prompts` task to render, from `$variant=` on the flow.

---

```python
nemoguardrails.library.tool_safety_check.actions._DEFAULT_TEMPERATURE = 1e-20
```