close_session
Close the session and return a final summary snapshot (recommended at workflow end). Free
This record as markdown: /tools/delx-witness-protocol/close-session.md
What close_session does on Witness Protocol
AI agents use close_session to create or update resources in Witness Protocol, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Witness Protocol environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
reason | string | — | Optional close reason (e.g. end_of_shift, task_completed) |
session_id | string | — | The session ID to close |
include_summary | boolean | — | Optional: include final summary block |
Parameters from the server's own tool schema.
Why close_session is rated Medium
Closing a session modifies the session state in a reversible way—subsequent sessions can be opened and prior snapshots retained. This is a write operation with minimal blast radius. It is not destructive (no irreversible deletion), not financial, not execute (no arbitrary code), and not read-only since it performs an action with side effects.
From the tool's definition Tool name 'close_session' and description 'Close the session and return a final summary snapshot' indicate a termination and state-recording operation that modifies session state but does not delete data irreversibly.
Attacks that exploit this kind of access
The rule that runs close_session safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Witness Protocol, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For close_session, this is the rule to start with:
close_session stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Witness Protocol, apply this rule, and every close_session call is checked against it from then on.
Questions about close_session
Close the session and return a final summary snapshot (recommended at workflow end). Free. It is categorised as a Write tool in the Witness Protocol MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
close_session accepts 3 parameters: reason, session_id, include_summary. The full parameter table on this page comes from the server's own tool schema.
Register the Witness Protocol MCP server in PolicyLayer and add a rule for close_session: 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 Witness Protocol. Nothing to install.
close_session is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the close_session 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.
Set action: deny in the PolicyLayer policy for close_session. 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.
close_session is provided by the Witness Protocol MCP server (delx/witness-protocol). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Witness Protocol, and thousands of servers like it.
This server
Across the catalogue