Supervisors
Custom Supervisors
Custom supervisors let you run arbitrary code to check on agent actions before they execute
You can create custom supervisors by implementing the Supervisor
protocol. This allows you to define custom logic for approving, rejecting, modifying, or escalating function execution.
The ToolCallSupervisor
Protocol
Asteroid has a very simple protocol that defines the expected signature for supervisor functions:
Creating a Custom Supervisor
Here’s an example of creating a custom supervisor that checks if an email address is in a whitelist:
You can then use this custom supervisor in the @supervise
decorator: