# `BB.Jido.Action.SafetyAware`
[🔗](https://github.com/beam-bots/bb_jido/blob/main/lib/bb/jido/action/safety_aware.ex#L5)

Mixin for actions that should refuse to run unless the robot's safety
controller is `:armed`.

## Usage

    defmodule MyAction do
      use Jido.Action,
        name: "my_action",
        schema: [robot: [type: :atom, required: true]]

      use BB.Jido.Action.SafetyAware

      @impl Jido.Action
      def run(params, context) do
        # only reached when robot is :armed
        {:ok, %{...}}
      end
    end

The robot module is looked up first in `params[:robot]`, then in
`context[:robot]`. If the robot is not `:armed`, the action returns
`{:error, {:safety_not_armed, state}}` without invoking `run/2`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
