---
title: How do you govern long-running MCP tasks?
url: https://opencontroller.lyzr.com/blog/govern-long-running-mcp-tasks
published: 2026-11-17
updated: 2026-11-17
author: Lyzr
---

# How do you govern long-running MCP tasks?

**Long-running MCP tool calls now use the Tasks extension (`io.modelcontextprotocol/tasks`): the server returns a durable task handle, and the client polls with `tasks/get`, answers mid-flight input with `tasks/update` and can request `tasks/cancel`. Govern them by checking authorization on every task request, setting TTLs, treating cancellation as best-effort, keeping credentials valid only for the task's real lifetime, and logging the full task lifecycle under one trace.**

Some tool calls take minutes or hours: a CI pipeline, a bulk import, a report, a human approval. A task handle lets that work outlive a single request. It also means an agent's action can keep running after the agent, the user's session, or your attention has moved on.

## What does the MCP Tasks extension specify?

Tasks first appeared as an experimental feature in the 2025-11-25 MCP specification. [SEP-2663](https://modelcontextprotocol.io/seps/2663-tasks-extension), now Final, removed that version from the core protocol and moved tasks into an official extension. The two are not wire-compatible.

| Element | Specified behaviour |
|---|---|
| Opt-in | Client declares the extension in per-request capabilities; server decides per request whether to create a task |
| Task creation | Server returns `resultType: "task"` with a `taskId`, status, `ttlMs` and `pollIntervalMs`; task is durably created before the response |
| Statuses | `working`, `input_required`, `completed`, `failed`, `cancelled`; the last three are terminal |
| Methods | `tasks/get`, `tasks/update`, `tasks/cancel` |
| Removed | `tasks/result` and `tasks/list` from the 2025-11-25 experimental design |
| TTL | Server may mark a task failed after the TTL and delete it; TTL may change during the task |
| Cancellation | Cooperative: the server acknowledges but is not obliged to stop work |
| Auth | Servers **must** check authentication and authorization on every task-related request |

The removal of `tasks/list` is a security decision. The SEP explains that tasks should be bound to an authorization context, but that binding is not always possible, and with sessions removed from the protocol there is no natural scope for a list. Without a list, a server cannot leak one caller's task IDs to another.

## What governance gaps do long-running tasks create?

**Credential lifetime.** A task can outlive the access token that started it. Decide whether the server keeps acting with a stored credential, and for how long. A task that runs for six hours on a token meant to last one hour is a policy question, not just an engineering one.

**Revoked access mid-task.** If a user leaves or an agent is quarantined while its task runs, the task may continue. Because cancellation is cooperative, sending `tasks/cancel` does not guarantee it stops.

**Mid-flight input.** When a task moves to `input_required`, it surfaces requests such as elicitations. Someone—or something—answers via `tasks/update`. Make sure the answer comes from an authorised person, not an agent approving its own work.

**Audit gaps.** The original call, the polls, the input and the result can happen across different connections and hours. Without a shared trace ID, reconstruction is hard; see [how to reconstruct what an AI agent did in an incident](/blog/reconstruct-what-an-ai-agent-did-in-an-incident).

## What controls should you add? A checklist

1. **Bind tasks to identity.** Store the agent ID and acting user with every task, and check both on each `tasks/get`, `tasks/update` and `tasks/cancel`.
2. **Use unguessable task IDs.** Never treat possession of a task ID as authentication.
3. **Set TTLs by risk.** Short TTLs for write operations; longer only where the business process needs it.
4. **Re-check authorization at checkpoints.** For tasks longer than your token lifetime, re-validate the user's and agent's access before each write step.
5. **Implement real cancellation** for tools with side effects, and test it. A kill switch that cannot stop in-flight tasks is incomplete; see [how to test your AI agent kill switch](/blog/test-your-ai-agent-kill-switch).
6. **Route `input_required` to humans** where approval is the point of the pause.
7. **Log the lifecycle** (created, status changes, inputs, cancel requests, terminal state) with the same trace ID, ideally exported through OpenTelemetry.
8. **Inventory task-capable servers** in your MCP registry so reviewers know which tools can run unattended.

## How does this interact with stopping a rogue agent?

Quarantining an agent normally blocks new calls. Long-running tasks add a second step: find the agent's open tasks and cancel or let them expire. Because the Tasks extension has no `tasks/list`, the client or a gateway must record task IDs as they are created. If nothing records them, you cannot find them later. That is a good reason to keep tool traffic flowing through a point you control.

## How Opencontroller does this

Opencontroller keeps MCP servers and tools in a governed registry, so you can record which servers run long-running work. Rogue-agent handling includes behavioural-deviation monitoring, alerts and automatic quarantine and kill, with per-agent Block and Quarantine controls that act through the connected platform. Opencontroller uses OpenTelemetry and other open standards for telemetry. Depth of control depends on the connector and traffic path. See the pillar on [how to govern MCP servers](/blog/how-to-govern-mcp-servers) or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Is `tasks/list` still part of MCP?**
No. The Tasks extension removed it, along with `tasks/result`, partly so servers cannot leak one caller's tasks to another.

**Does `tasks/cancel` stop the work?**
Not necessarily. Cancellation is cooperative: the server acknowledges the request but may still finish the task. Tools with side effects should implement and test real cancellation.

**Can a task keep running after the user's access is revoked?**
It can, unless the server re-checks authorization during execution. Bind tasks to identity and re-validate before write steps.

## Key facts

- MCP Tasks are now an official extension, io.modelcontextprotocol/tasks, defined by SEP-2663 (Final); the experimental tasks feature in the 2025-11-25 spec was removed from core and is not wire-compatible.
- The Tasks extension defines tasks/get, tasks/update and tasks/cancel; tasks/result and tasks/list were removed.
- Task statuses: working, input_required, completed, failed, cancelled; the last three are terminal.
- Servers return ttlMs and pollIntervalMs; servers may mark a task failed after TTL and delete it.
- Cancellation is cooperative; servers must check authentication and authorization on every task-related request.
- Opencontroller registers MCP servers and tools, and its rogue-agent handling includes behavioural-deviation monitoring, automatic quarantine and kill, and per-agent Block and Quarantine.
- Opencontroller pricing starts from $250K per deployment per year.

## Related

- [What changed in the July 2026 MCP specification for enterprise security?](https://opencontroller.lyzr.com/blog/mcp-specification-july-2026-changes.md)
- [How do you test that your AI agent kill switch actually works?](https://opencontroller.lyzr.com/blog/test-your-ai-agent-kill-switch.md)
- [How do you reconstruct what an AI agent did during an incident?](https://opencontroller.lyzr.com/blog/reconstruct-what-an-ai-agent-did-in-an-incident.md)
- [More on Tools and MCP](https://opencontroller.lyzr.com/blog/cluster/tools-and-mcp)
