cancel_run

Cancel a run and all of its non-terminal tasks and active leases.

Server State Trace agent-pattern-labs/state-trace
Category Destructive
Risk class Critical
Parameters 00 required

What cancel_run does on State Trace

AI agents call cancel_run to permanently remove resources in State Trace — typically in cleanup and lifecycle workflows. It does its job in a single call, and there is no undo.

Why cancel_run needs a policy

Cancelling a run along with all non-terminal tasks and active leases is an irreversible operation that terminates in-progress work and invalidates leases. This cannot be undone — cancelled tasks and leases are gone, making it Destructive. The blast radius is high because a single call can wipe out an entire run's worth of active work.

From the tool's definition Cancel a run and all of its non-terminal tasks and active leases

Questions about cancel_run

What does the cancel_run tool do? +

Cancel a run and all of its non-terminal tasks and active leases. It is categorised as a Destructive tool in the State Trace MCP Server, which means it can permanently delete or destroy data. Block by default and require explicit approval.

How do I enforce a policy on cancel_run? +

Register the State Trace MCP server in PolicyLayer and add a rule for cancel_run: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches State Trace. Nothing to install.

What risk level is cancel_run? +

cancel_run is a Destructive tool with critical risk. Critical-risk tools should be blocked by default and only enabled with explicit human approval.

Can I rate-limit cancel_run? +

Yes. Add a rate_limit block to the cancel_run rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block cancel_run completely? +

Set action: deny in the PolicyLayer policy for cancel_run. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides cancel_run? +

cancel_run is provided by the State Trace MCP server (agent-pattern-labs/state-trace). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// LOOK UP ANOTHER SERVER

Every MCP server has a record like this.

Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.