Controlling your party in a middle of a larger battle can be difficult - luckily for you, the developers of Pillars of Eternity 2 Deadfire have created a complex AI creator. Thanks to it you can determine how your companions should react in different situations.
Click on a character's portrait and then right-click on the icon with gears to open the window presented above.
 This area allows you to adjust how a given character should act - the available default modes are "Aggressive" and "Cautious". Click on "Open Behavior Editor" to see how these modes work, and to create your own behavior (as described below).
 Here, you can choose auto attack options. The developers have prepared four different variants (you can't create your own):
- Passive - a character won't attack automatically, regardless of circumstances.
- Self-defense - a character won't engage in combat unless they get attacked by an enemy.
- Defensive - a character attacks nearby enemies automatically, regardless of whether they were attacked or not.
- Aggressive - a character attacks all enemies, regardless of whether they were attacked or not.
After clicking on "Open Behavior Editor" you will see the window above:
-  This list contains behaviors available to a character (click on the plus to add new behaviors).
-  Here, you can determine conditions - it could be low health, use of a certain weapon or a situation where your ranged character has been attacked. There are plenty of options here.
-  The last table lets you to choose actions - here you can set which ability should be used, set a target (yourself or an enemy) and a priority of this action (e.g. an enemy with low resistance to frost damage).