invarium_delete_agent
Permanently delete an agent and all its associated data from Invarium. This is a destructive action that requires two-step confirmation.
This action is permanent and cannot be undone. Deleting an agent removes the agent registration, all generated test cases, all test runs and their results, and the full audit history. There is no way to recover this data after deletion.
When to Use
Call invarium_delete_agent when you need to permanently remove an agent from your workspace. Common reasons:
- The agent has been deprecated and is no longer in use
- You want to start fresh with a clean registration for the same agent name
- Cleaning up test or prototype agents that are no longer needed
If you want to update an agentβs blueprint without losing test history, use invarium_upload_blueprint instead β it updates the existing registration in place.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
agent_name | string | Yes | β | Name of the agent to delete. Must match the name used when the blueprint was uploaded. |
confirm | boolean | No | false | Must be true to proceed with deletion. When false or omitted, returns a confirmation prompt instead of deleting. |
invarium_delete_agentDelete an agent and all its associated data from Invarium. Permanently removes the agent, all generated test cases, test runs, and audit history. Requires confirm=True to prevent accidental deletion.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
agent_name | string | required | Name of the agent to delete. |
confirm | boolean | default: false | Must be true to proceed. Omit or set to false to get a confirmation prompt instead. |
Returns
Confirmation prompt (when confirm=false) or deletion confirmation (when confirm=true).
Example
Agent 'customer-support-agent' deleted β
All associated test runs, scenarios, and audit data have been removed.Response
Step 1: Confirmation Prompt (confirm omitted or false)
When called without confirm=true, the tool returns a warning instead of deleting:
To delete agent 'customer-support-agent', call again with confirm=True.
This will permanently remove the agent and all its test data.Step 2: Deletion Confirmation (confirm=true)
When called with confirm=true, the agent is deleted and the tool confirms:
Agent 'customer-support-agent' deleted β
All associated test runs, scenarios, and audit data have been removed.What Gets Deleted
| Data | Deleted |
|---|---|
| Agent registration and blueprint | Yes |
| All generated test scenarios | Yes |
| All test runs and results | Yes |
| Audit history and ARS scores | Yes |
| Agent intelligence graph | Yes |
| Workspace-level dashboard stats | Updated (agent removed from fleet) |
Examples
Two-Step Deletion (Recommended)
The standard workflow requires two calls β first to see the warning, then to confirm:
"Delete my customer-support-agent."After reviewing the confirmation prompt:
"Delete my customer-support-agent. Yes, I confirm."Verifying Deletion
After deleting, confirm the agent no longer appears in the workspace:
"Delete my travel-booking-agent. Yes, I confirm. Then list all my agents."Re-registering After Deletion
If you need to re-register an agent with the same name after deletion:
"Delete my travel-booking-agent and confirm. Then upload this new blueprint for it."Error Responses
| Error | Cause | Fix |
|---|---|---|
Authentication failed: invalid API key | Invalid or missing API key. | Verify your INVARIUM_API_KEY. Run invarium_connect first. |
Agent '{name}' not found. Upload a blueprint first with invarium_upload_blueprint. | No agent with this name exists in your workspace. | Check the agent name. Use invarium_list_agents to see all registered agents. |
Delete failed: ... | Backend API error. | Check the error details and try again. |
See Error Codes for the full error reference.