Introduction
Plug-ins inspect and modify the input or output of an agent run. A plug-in is a tool that is automatically started either before the agent begins generating a response (pre-invoke) or after the agent completes its response (post-invoke). Use plug-ins to adjust the message history before the agent processes it or refine the final output before it is returned to the user. Common use cases include applying guardrails, masking sensitive data, or transforming output such as translation.Email agent
Use this configuration to include an optional tool that the agent can call, such as a tool that simulates sending an email. Other plug-ins in this example run automatically, regardless of the agent’s actions. Code example:YAML
Email masking
The post-invoke plug-in masks email addresses after the agent completes its response. The plug-in runs automatically and modifies the final output before it is sent back to the user. Code example:PYTHON
Guardrail plug-in
The pre-invoke plug-in applies guardrails before the agent processes the request. It can strip or adjust content to enforce compliance or safety requirements. Code example:PYTHON
Import Python tools
Use this command to import Python-based tools for use as plug-ins. The tools can then be configured as pre-invoke or post-invoke plug-ins in the agent workflow. Command example:BASH

