def uses_invalid_action(irl_trajectory: dict) -> bool:
    """Return true if an invalid action is used in the IRL trajectory.

    Parameters
    ----------
    irl_trajectory : dict
        dictionary of the IRL trajectory

    Returns
    -------
    bool
        true if an invalid actions is used
    """
    for agent_dict in irl_trajectory["agents"]:
        for trajectory_step in agent_dict["trajectory"]:
            if trajectory_step["features"]["invalidAction"]:
                return True
    return False