By default, a Task will execute for the same agent as the one that the behaviour is executed for, or in other words the game object that the GraphOwner is attached to. You are though able to override this through the task inspector and instead specify another agent for the task to work with. You have two options when overriding the agent.
On the task inspector, the type in the parenthesis state the type that the agent needs to have in order for the task to work correctly and without errors. If that type of component does not exist on the current agent, it will show in red.