> 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.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# nemoguardrails.actions.actions

## Module Contents

### Classes

| Name                                                           | Description                                      |
| -------------------------------------------------------------- | ------------------------------------------------ |
| [`ActionMeta`](#nemoguardrails-actions-actions-ActionMeta)     | -                                                |
| [`ActionResult`](#nemoguardrails-actions-actions-ActionResult) | Data class representing the result of an action. |

### Functions

| Name                                               | Description                                         |
| -------------------------------------------------- | --------------------------------------------------- |
| [`action`](#nemoguardrails-actions-actions-action) | Decorator to mark a function or class as an action. |

### Data

[`T`](#nemoguardrails-actions-actions-T)

### API

```python
class nemoguardrails.actions.actions.ActionMeta
```

**Bases:** `typing.TypedDict`

```python
class nemoguardrails.actions.actions.ActionResult(
    return_value: typing.Optional[typing.Any] = None,
    events: typing.Optional[typing.List[dict]] = None,
    context_updates: typing.Optional[dict] = dict()
)
```

Dataclass

Data class representing the result of an action.

```python
nemoguardrails.actions.actions.action(
    is_system_action: bool = False,
    name: typing.Optional[str] = None,
    execute_async: bool = False,
    output_mapping: typing.Optional[typing.Callable[[Any], bool]] = None
) -> typing.Callable[[T], nemoguardrails.actions.actions.T]
```

Decorator to mark a function or class as an action.

**Parameters:**

Flag indicating if the action is a system action.

The name to associate with the action.

Whether the function should be executed in async mode.

A function to interpret the action's result.
It accepts the return value (e.g. the first element of a tuple) and return True if the output
is not safe.

**Returns:** `Callable[[T], T]`

The decorated function or class.

```python
nemoguardrails.actions.actions.T = TypeVar('T', bound=(Union[Callable[..., Any], Type[Any]]))
```