Agent management settings let you configure preprocessing logic and manage the agent lifecycle.
Agent Status
Agent status lets you enable or disable an agent without deleting it. Disabled agents remain fully editable and configurable but are excluded from runtime execution. Re-enabling an agent immediately restores normal routing.
Agent status affects runtime behavior only. Configuration and settings are preserved regardless of the agent’s status.
Behavior by Orchestration Pattern
The impact of disabling an agent depends on how your app is orchestrated.
| Orchestration Pattern | Behavior When Agent is Disabled |
|---|
| Supervisor | The agent is hidden from the supervisor and excluded from the available agents list. The supervisor does not route any requests to it. |
| Adaptive Network | If the disabled agent is the initial agent, the app returns an error. If it is a delegated agent, the delegation attempt fails and any agents reachable only through it are also excluded from execution. |
| Single-Agent | The app returns an error to the user. |
Agent Pre-Processor
The Agent Pre-Processor lets you run custom scripts before an agent is invoked. Scripts can access system memory and context variables to perform data transformation, validation, and context preparation. The configured script runs automatically each time the agent is invoked.
This feature is currently enabled on request.
Common Use Cases
| Use Case | Description |
|---|
| Security | Content moderation |
| Validation | Input normalization, schema enforcement, and type checking |
| Enrichment | Adding user metadata, timestamps, and domain tags |
| Customization | Domain-specific prompts and tool filtering |
Available Context Keys
The following keys are available within the script, along with any context and memory variables:
| Key | Description |
|---|
input | The user input being processed |
task_input | The structured payload passed to the agent for this execution |
agent_prompt | The prompt used to guide the agent’s behavior and responses |
available_tools | Metadata about the tools, agents, and events the agent can use. Contents vary based on the app’s orchestration pattern |
Adding a Pre-Processor Script
- In the agent configuration, go to Pre-Processor → Add Script.
- Write your script in JavaScript or Python using the available context keys listed above.
- Click Test Execution to verify the script’s behavior.
- Click Create to save.
There is no execution timeout for scripts. Ensure your script does not introduce unnecessary delays.
Example Script
The following script adds HR-specific guidance to the agent prompt and appends a timestamp to the task input.
// Read values from the execution context
var prompt = $agent_prompt;
var tools = $available_tools;
var input = $input;
var task_input = $task_input;
// Add HR-specific guidance to the prompt
var updatedPrompt = prompt + "\n\nYou are an HR assistant. Answer concisely and use only verified HR policies.";
// Append a timestamp to the task input
var updatedTaskInput = {
...task_input,
timestamp: new Date().toISOString()
};
// Return updated fields to the agent engine
return {
agent_prompt: updatedPrompt,
available_tools: [tools[0]], // Example: restrict to the first tool
task_input: updatedTaskInput,
input: input
};
Execution Mode
Once a script is added, configure when the pre-processor should run during an agent session. Two modes are available:
| Mode | Behavior |
|---|
| Always Run | The script runs every time the agent is invoked, regardless of whether it has run before in the same session. Use this for validations or transformations that must apply to every agent call. |
| Run Once | The script runs only on the first agent call in a session. Subsequent calls within the same session skip the pre-processor. Use this for one-time setup tasks such as loading user context or initialising session state. |
To change the mode, select the appropriate option and save.
Delete Agent
Click Delete Agent to permanently delete the agent and all associated data. This action cannot be undone.