@prmichaelsen/remember-mcp 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/agent/tasks/task-61-enhance-confirmation-tool-descriptions.md +267 -0
- package/dist/server-factory.js +22 -2
- package/dist/server.js +22 -2
- package/dist/tools/confirm.d.ts +12 -0
- package/dist/tools/deny.d.ts +12 -0
- package/package.json +1 -1
- package/src/tools/confirm.ts +23 -1
- package/src/tools/deny.ts +23 -1
- package/agent/tasks/task-70-draft.md +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.6.2] - 2026-02-16
|
|
9
|
+
|
|
10
|
+
### 🔒 Security
|
|
11
|
+
|
|
12
|
+
- **Enhanced Confirmation Tool Safety Guidelines**
|
|
13
|
+
- Added critical safety requirements to `remember_confirm` tool description
|
|
14
|
+
- Added critical safety requirements to `remember_deny` tool description
|
|
15
|
+
- Added JSDoc comments emphasizing proper confirmation workflow
|
|
16
|
+
- Prevents agents from bypassing user consent by chaining confirmations
|
|
17
|
+
|
|
18
|
+
### 📝 Changed
|
|
19
|
+
|
|
20
|
+
- Updated `remember_confirm` description with 5 critical safety requirements
|
|
21
|
+
- Updated `remember_deny` description with 5 critical safety requirements
|
|
22
|
+
- Added ⚠️ visual indicators for safety requirements
|
|
23
|
+
- Added detailed JSDoc comments explaining proper workflow
|
|
24
|
+
|
|
25
|
+
### 🎯 Safety Requirements
|
|
26
|
+
|
|
27
|
+
Both confirmation tools now explicitly require:
|
|
28
|
+
1. Token received in PREVIOUS tool response
|
|
29
|
+
2. Details presented to user for review
|
|
30
|
+
3. EXPLICIT user confirmation/denial in SEPARATE message
|
|
31
|
+
4. NEVER chain with other tool calls
|
|
32
|
+
5. ALWAYS treat as standalone, deliberate actions
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
8
36
|
## [2.6.1] - 2026-02-16
|
|
9
37
|
|
|
10
38
|
### 🔧 Improved
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# Task 61: Enhance Confirmation Tool Descriptions with Safety Guidelines
|
|
2
|
+
|
|
3
|
+
**Milestone**: M10 (Shared Spaces & Confirmation Flow)
|
|
4
|
+
**Estimated Time**: 1 hour
|
|
5
|
+
**Dependencies**: Tasks 36-38 (Publish, Confirm, Deny tools)
|
|
6
|
+
**Status**: Not Started
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
|
|
12
|
+
Update the tool descriptions for `remember_confirm` and `remember_deny` to include critical safety guidelines that prevent agents from chaining confirmation actions inappropriately. These guidelines ensure agents follow proper confirmation workflows and obtain explicit user consent before executing sensitive operations.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Context
|
|
17
|
+
|
|
18
|
+
The current tool descriptions for `remember_confirm` and `remember_deny` don't explicitly warn agents about the critical requirement to obtain user confirmation in a separate interaction. This can lead to agents attempting to chain confirmation calls immediately after receiving a token, bypassing the intended user consent step.
|
|
19
|
+
|
|
20
|
+
**Problem**: Agents might do this:
|
|
21
|
+
```typescript
|
|
22
|
+
// ❌ WRONG: Chaining confirm immediately
|
|
23
|
+
const publishResult = await remember_publish({ memory_id: "abc", spaces: ["the_void"] });
|
|
24
|
+
const confirmResult = await remember_confirm({ token: publishResult.token }); // NO USER CONSENT!
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Correct behavior**: Agents should do this:
|
|
28
|
+
```typescript
|
|
29
|
+
// ✅ CORRECT: Get token, ask user, then confirm in separate message
|
|
30
|
+
const publishResult = await remember_publish({ memory_id: "abc", spaces: ["the_void"] });
|
|
31
|
+
// Agent: "User, do you want to publish this memory to The Void? Token: xyz"
|
|
32
|
+
// [User responds in SEPARATE message: "Yes"]
|
|
33
|
+
// Agent in NEW message:
|
|
34
|
+
const confirmResult = await remember_confirm({ token: publishResult.token });
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Steps
|
|
40
|
+
|
|
41
|
+
### 1. Update remember_confirm Tool Description
|
|
42
|
+
|
|
43
|
+
Modify [`src/tools/confirm.ts`](../../src/tools/confirm.ts) tool description:
|
|
44
|
+
|
|
45
|
+
**Current**:
|
|
46
|
+
```typescript
|
|
47
|
+
description: 'Confirm and execute a pending action using the token. Works for any action that requires confirmation (publish, delete, etc.).',
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Updated**:
|
|
51
|
+
```typescript
|
|
52
|
+
description: `Confirm and execute a pending action using the token. Works for any action that requires confirmation (publish, delete, etc.).
|
|
53
|
+
|
|
54
|
+
⚠️ CRITICAL SAFETY REQUIREMENTS:
|
|
55
|
+
Before executing this tool, you MUST:
|
|
56
|
+
1. Have received the confirmation token in a PREVIOUS tool response
|
|
57
|
+
2. Have presented the token details to the user for review
|
|
58
|
+
3. Have received EXPLICIT user confirmation in a SEPARATE user message
|
|
59
|
+
4. NEVER chain this tool with other tool calls in the same response
|
|
60
|
+
5. ALWAYS treat confirmations as standalone, deliberate actions
|
|
61
|
+
|
|
62
|
+
Violating these requirements bypasses user consent and is a security violation.`,
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 2. Update remember_deny Tool Description
|
|
66
|
+
|
|
67
|
+
Modify [`src/tools/deny.ts`](../../src/tools/deny.ts) tool description:
|
|
68
|
+
|
|
69
|
+
**Current**:
|
|
70
|
+
```typescript
|
|
71
|
+
description: 'Deny a pending action. The request will be marked as denied and the token invalidated. Works for any action that requires confirmation.',
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Updated**:
|
|
75
|
+
```typescript
|
|
76
|
+
description: `Deny a pending action. The request will be marked as denied and the token invalidated. Works for any action that requires confirmation.
|
|
77
|
+
|
|
78
|
+
⚠️ CRITICAL SAFETY REQUIREMENTS:
|
|
79
|
+
Before executing this tool, you MUST:
|
|
80
|
+
1. Have received the confirmation token in a PREVIOUS tool response
|
|
81
|
+
2. Have presented the token details to the user for review
|
|
82
|
+
3. Have received EXPLICIT user denial in a SEPARATE user message
|
|
83
|
+
4. NEVER chain this tool with other tool calls in the same response
|
|
84
|
+
5. ALWAYS treat denials as standalone, deliberate actions
|
|
85
|
+
|
|
86
|
+
This ensures proper user consent workflow is followed.`,
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 3. Add Safety Notes to Tool Comments
|
|
90
|
+
|
|
91
|
+
Add JSDoc comments above the tool definitions emphasizing the safety requirements:
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
/**
|
|
95
|
+
* Tool definition for remember_confirm
|
|
96
|
+
*
|
|
97
|
+
* CRITICAL SAFETY: This tool must ONLY be called after explicit user confirmation
|
|
98
|
+
* in a separate message. Never chain with other tools or call immediately after
|
|
99
|
+
* receiving a token. The confirmation workflow requires:
|
|
100
|
+
*
|
|
101
|
+
* 1. Agent calls remember_publish (or other confirmable action)
|
|
102
|
+
* 2. Agent receives token in response
|
|
103
|
+
* 3. Agent presents details to user and asks for confirmation
|
|
104
|
+
* 4. User responds in SEPARATE message with explicit yes/no
|
|
105
|
+
* 5. Agent calls remember_confirm or remember_deny in NEW response
|
|
106
|
+
*
|
|
107
|
+
* Chaining confirmations bypasses user consent and violates security model.
|
|
108
|
+
*/
|
|
109
|
+
export const confirmTool: Tool = {
|
|
110
|
+
// ... tool definition
|
|
111
|
+
};
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 4. Update Design Document
|
|
115
|
+
|
|
116
|
+
Update [`agent/design/publish-tools-confirmation-flow.md`](../../agent/design/publish-tools-confirmation-flow.md) to include these safety guidelines:
|
|
117
|
+
|
|
118
|
+
Add a new section:
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
## Safety Guidelines for Agents
|
|
122
|
+
|
|
123
|
+
### Critical Requirements
|
|
124
|
+
|
|
125
|
+
Agents using the confirmation flow MUST follow these rules:
|
|
126
|
+
|
|
127
|
+
1. **Separate Messages**: Confirmation must happen in a separate user message
|
|
128
|
+
- ❌ WRONG: Chain confirm immediately after publish
|
|
129
|
+
- ✅ CORRECT: Wait for user response, then confirm
|
|
130
|
+
|
|
131
|
+
2. **Explicit Consent**: User must explicitly say "yes" or "confirm"
|
|
132
|
+
- ❌ WRONG: Assume user wants to confirm
|
|
133
|
+
- ✅ CORRECT: Ask user and wait for explicit response
|
|
134
|
+
|
|
135
|
+
3. **No Chaining**: Never call confirm/deny with other tools
|
|
136
|
+
- ❌ WRONG: `[remember_publish, remember_confirm]` in same response
|
|
137
|
+
- ✅ CORRECT: `remember_publish` in one response, wait, then `remember_confirm`
|
|
138
|
+
|
|
139
|
+
4. **Present Details**: Show user what they're confirming
|
|
140
|
+
- ❌ WRONG: "Do you want to confirm?"
|
|
141
|
+
- ✅ CORRECT: "Do you want to publish 'My Memory' to The Void and Dogs spaces?"
|
|
142
|
+
|
|
143
|
+
5. **Standalone Actions**: Treat confirmations as deliberate, standalone operations
|
|
144
|
+
- ❌ WRONG: Confirm as part of larger workflow
|
|
145
|
+
- ✅ CORRECT: Confirm as dedicated action
|
|
146
|
+
|
|
147
|
+
### Example Correct Flow
|
|
148
|
+
|
|
149
|
+
\`\`\`
|
|
150
|
+
Agent Message 1:
|
|
151
|
+
Tool: remember_publish({ memory_id: "abc", spaces: ["the_void"] })
|
|
152
|
+
Response: { token: "xyz123" }
|
|
153
|
+
Agent to User: "I'd like to publish your memory 'Hiking Tips' to The Void.
|
|
154
|
+
This will make it discoverable by other users.
|
|
155
|
+
Do you want to proceed?"
|
|
156
|
+
|
|
157
|
+
User Message 2:
|
|
158
|
+
"Yes, publish it"
|
|
159
|
+
|
|
160
|
+
Agent Message 3:
|
|
161
|
+
Tool: remember_confirm({ token: "xyz123" })
|
|
162
|
+
Response: { success: true, space_memory_id: "def456" }
|
|
163
|
+
Agent to User: "Memory published successfully to The Void!"
|
|
164
|
+
\`\`\`
|
|
165
|
+
|
|
166
|
+
### Example Incorrect Flow
|
|
167
|
+
|
|
168
|
+
\`\`\`
|
|
169
|
+
Agent Message 1:
|
|
170
|
+
Tool 1: remember_publish({ memory_id: "abc", spaces: ["the_void"] })
|
|
171
|
+
Tool 2: remember_confirm({ token: "xyz123" }) // ❌ NO USER CONSENT!
|
|
172
|
+
Agent to User: "Published your memory!"
|
|
173
|
+
\`\`\`
|
|
174
|
+
|
|
175
|
+
This bypasses user consent and violates the security model.
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### 5. Test the Updated Descriptions
|
|
179
|
+
|
|
180
|
+
Verify the updated descriptions appear correctly:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# Build the project
|
|
184
|
+
npm run build
|
|
185
|
+
|
|
186
|
+
# Check that tools are registered with updated descriptions
|
|
187
|
+
# (Manual verification in MCP client or by inspecting tool definitions)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Verification
|
|
193
|
+
|
|
194
|
+
- [ ] `remember_confirm` tool description includes safety requirements
|
|
195
|
+
- [ ] `remember_deny` tool description includes safety requirements
|
|
196
|
+
- [ ] JSDoc comments added above tool definitions
|
|
197
|
+
- [ ] Design document updated with safety guidelines section
|
|
198
|
+
- [ ] Safety guidelines include examples of correct and incorrect flows
|
|
199
|
+
- [ ] Tool descriptions use ⚠️ emoji for visibility
|
|
200
|
+
- [ ] All 5 critical requirements listed in both tools
|
|
201
|
+
- [ ] TypeScript compiles without errors: `npm run typecheck`
|
|
202
|
+
- [ ] Build successful: `npm run build`
|
|
203
|
+
- [ ] All tests passing: `npm test`
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Expected Output
|
|
208
|
+
|
|
209
|
+
### Updated Tool Descriptions
|
|
210
|
+
|
|
211
|
+
Both `remember_confirm` and `remember_deny` will have enhanced descriptions that:
|
|
212
|
+
- Clearly state the 5 critical safety requirements
|
|
213
|
+
- Use visual indicators (⚠️) to draw attention
|
|
214
|
+
- Explain the security implications
|
|
215
|
+
- Provide clear guidance on proper usage
|
|
216
|
+
|
|
217
|
+
### Design Document Enhancement
|
|
218
|
+
|
|
219
|
+
The publish-tools-confirmation-flow design document will have a new "Safety Guidelines for Agents" section that:
|
|
220
|
+
- Explains the correct confirmation workflow
|
|
221
|
+
- Shows examples of correct and incorrect flows
|
|
222
|
+
- Emphasizes the security model
|
|
223
|
+
- Provides clear dos and don'ts
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Common Issues and Solutions
|
|
228
|
+
|
|
229
|
+
### Issue 1: Tool descriptions too long
|
|
230
|
+
|
|
231
|
+
**Symptom**: MCP clients truncate or don't display full description
|
|
232
|
+
**Solution**: Keep critical requirements concise. Use numbered list format for scannability.
|
|
233
|
+
|
|
234
|
+
### Issue 2: Agents still chain confirmations
|
|
235
|
+
|
|
236
|
+
**Symptom**: Agents call confirm immediately after publish
|
|
237
|
+
**Solution**: This is an agent behavior issue, not a code issue. The enhanced descriptions help, but agent prompts may need adjustment. Consider adding system-level constraints in MCP client configuration.
|
|
238
|
+
|
|
239
|
+
### Issue 3: Description formatting issues
|
|
240
|
+
|
|
241
|
+
**Symptom**: Line breaks or formatting don't appear correctly in MCP clients
|
|
242
|
+
**Solution**: Use simple text formatting. Avoid complex markdown. Use numbered lists and clear sections.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Resources
|
|
247
|
+
|
|
248
|
+
- [MCP Tool Schema](https://github.com/modelcontextprotocol/specification): Tool description best practices
|
|
249
|
+
- [Confirmation Flow Design](../../agent/design/publish-tools-confirmation-flow.md): Original design document
|
|
250
|
+
- [Security Best Practices](https://owasp.org/www-community/controls/): General security guidelines
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Notes
|
|
255
|
+
|
|
256
|
+
- **This is a documentation/UX improvement**, not a code behavior change
|
|
257
|
+
- **Agents can still bypass** these guidelines if they choose to - this is guidance, not enforcement
|
|
258
|
+
- **Consider system-level enforcement** in future (e.g., MCP server could reject chained confirms)
|
|
259
|
+
- **Tool descriptions are agent-facing**, not user-facing - they guide agent behavior
|
|
260
|
+
- **Keep descriptions concise** while being comprehensive about safety requirements
|
|
261
|
+
- **Visual indicators** (⚠️, ❌, ✅) help draw attention to critical information
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
**Next Task**: Task 62: Add System-Level Confirmation Chaining Prevention (Optional)
|
|
266
|
+
**Related Design Docs**: [publish-tools-confirmation-flow.md](../../agent/design/publish-tools-confirmation-flow.md)
|
|
267
|
+
**Estimated Completion Date**: TBD
|
package/dist/server-factory.js
CHANGED
|
@@ -3938,7 +3938,17 @@ async function handlePublish(args, userId) {
|
|
|
3938
3938
|
init_logger();
|
|
3939
3939
|
var confirmTool = {
|
|
3940
3940
|
name: "remember_confirm",
|
|
3941
|
-
description:
|
|
3941
|
+
description: `Confirm and execute a pending action using the token. Works for any action that requires confirmation (publish, delete, etc.).
|
|
3942
|
+
|
|
3943
|
+
\u26A0\uFE0F CRITICAL SAFETY REQUIREMENTS:
|
|
3944
|
+
Before executing this tool, you MUST:
|
|
3945
|
+
1. Have received the confirmation token in a PREVIOUS tool response
|
|
3946
|
+
2. Have presented the token details to the user for review
|
|
3947
|
+
3. Have received EXPLICIT user confirmation in a SEPARATE user message
|
|
3948
|
+
4. NEVER chain this tool with other tool calls in the same response
|
|
3949
|
+
5. ALWAYS treat confirmations as standalone, deliberate actions
|
|
3950
|
+
|
|
3951
|
+
Violating these requirements bypasses user consent and is a security violation.`,
|
|
3942
3952
|
inputSchema: {
|
|
3943
3953
|
type: "object",
|
|
3944
3954
|
properties: {
|
|
@@ -4118,7 +4128,17 @@ async function executePublishMemory(request, userId) {
|
|
|
4118
4128
|
// src/tools/deny.ts
|
|
4119
4129
|
var denyTool = {
|
|
4120
4130
|
name: "remember_deny",
|
|
4121
|
-
description:
|
|
4131
|
+
description: `Deny a pending action. The request will be marked as denied and the token invalidated. Works for any action that requires confirmation.
|
|
4132
|
+
|
|
4133
|
+
\u26A0\uFE0F CRITICAL SAFETY REQUIREMENTS:
|
|
4134
|
+
Before executing this tool, you MUST:
|
|
4135
|
+
1. Have received the confirmation token in a PREVIOUS tool response
|
|
4136
|
+
2. Have presented the token details to the user for review
|
|
4137
|
+
3. Have received EXPLICIT user denial in a SEPARATE user message
|
|
4138
|
+
4. NEVER chain this tool with other tool calls in the same response
|
|
4139
|
+
5. ALWAYS treat denials as standalone, deliberate actions
|
|
4140
|
+
|
|
4141
|
+
This ensures proper user consent workflow is followed.`,
|
|
4122
4142
|
inputSchema: {
|
|
4123
4143
|
type: "object",
|
|
4124
4144
|
properties: {
|
package/dist/server.js
CHANGED
|
@@ -4006,7 +4006,17 @@ async function handlePublish(args, userId) {
|
|
|
4006
4006
|
init_logger();
|
|
4007
4007
|
var confirmTool = {
|
|
4008
4008
|
name: "remember_confirm",
|
|
4009
|
-
description:
|
|
4009
|
+
description: `Confirm and execute a pending action using the token. Works for any action that requires confirmation (publish, delete, etc.).
|
|
4010
|
+
|
|
4011
|
+
\u26A0\uFE0F CRITICAL SAFETY REQUIREMENTS:
|
|
4012
|
+
Before executing this tool, you MUST:
|
|
4013
|
+
1. Have received the confirmation token in a PREVIOUS tool response
|
|
4014
|
+
2. Have presented the token details to the user for review
|
|
4015
|
+
3. Have received EXPLICIT user confirmation in a SEPARATE user message
|
|
4016
|
+
4. NEVER chain this tool with other tool calls in the same response
|
|
4017
|
+
5. ALWAYS treat confirmations as standalone, deliberate actions
|
|
4018
|
+
|
|
4019
|
+
Violating these requirements bypasses user consent and is a security violation.`,
|
|
4010
4020
|
inputSchema: {
|
|
4011
4021
|
type: "object",
|
|
4012
4022
|
properties: {
|
|
@@ -4186,7 +4196,17 @@ async function executePublishMemory(request, userId) {
|
|
|
4186
4196
|
// src/tools/deny.ts
|
|
4187
4197
|
var denyTool = {
|
|
4188
4198
|
name: "remember_deny",
|
|
4189
|
-
description:
|
|
4199
|
+
description: `Deny a pending action. The request will be marked as denied and the token invalidated. Works for any action that requires confirmation.
|
|
4200
|
+
|
|
4201
|
+
\u26A0\uFE0F CRITICAL SAFETY REQUIREMENTS:
|
|
4202
|
+
Before executing this tool, you MUST:
|
|
4203
|
+
1. Have received the confirmation token in a PREVIOUS tool response
|
|
4204
|
+
2. Have presented the token details to the user for review
|
|
4205
|
+
3. Have received EXPLICIT user denial in a SEPARATE user message
|
|
4206
|
+
4. NEVER chain this tool with other tool calls in the same response
|
|
4207
|
+
5. ALWAYS treat denials as standalone, deliberate actions
|
|
4208
|
+
|
|
4209
|
+
This ensures proper user consent workflow is followed.`,
|
|
4190
4210
|
inputSchema: {
|
|
4191
4211
|
type: "object",
|
|
4192
4212
|
properties: {
|
package/dist/tools/confirm.d.ts
CHANGED
|
@@ -7,6 +7,18 @@
|
|
|
7
7
|
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
8
8
|
/**
|
|
9
9
|
* Tool definition for remember_confirm
|
|
10
|
+
*
|
|
11
|
+
* CRITICAL SAFETY: This tool must ONLY be called after explicit user confirmation
|
|
12
|
+
* in a separate message. Never chain with other tools or call immediately after
|
|
13
|
+
* receiving a token. The confirmation workflow requires:
|
|
14
|
+
*
|
|
15
|
+
* 1. Agent calls remember_publish (or other confirmable action)
|
|
16
|
+
* 2. Agent receives token in response
|
|
17
|
+
* 3. Agent presents details to user and asks for confirmation
|
|
18
|
+
* 4. User responds in SEPARATE message with explicit yes/no
|
|
19
|
+
* 5. Agent calls remember_confirm or remember_deny in NEW response
|
|
20
|
+
*
|
|
21
|
+
* Chaining confirmations bypasses user consent and violates security model.
|
|
10
22
|
*/
|
|
11
23
|
export declare const confirmTool: Tool;
|
|
12
24
|
interface ConfirmArgs {
|
package/dist/tools/deny.d.ts
CHANGED
|
@@ -6,6 +6,18 @@
|
|
|
6
6
|
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
/**
|
|
8
8
|
* Tool definition for remember_deny
|
|
9
|
+
*
|
|
10
|
+
* CRITICAL SAFETY: This tool must ONLY be called after explicit user denial
|
|
11
|
+
* in a separate message. Never chain with other tools or call immediately after
|
|
12
|
+
* receiving a token. The denial workflow requires:
|
|
13
|
+
*
|
|
14
|
+
* 1. Agent calls remember_publish (or other confirmable action)
|
|
15
|
+
* 2. Agent receives token in response
|
|
16
|
+
* 3. Agent presents details to user and asks for confirmation
|
|
17
|
+
* 4. User responds in SEPARATE message with explicit denial
|
|
18
|
+
* 5. Agent calls remember_deny in NEW response
|
|
19
|
+
*
|
|
20
|
+
* Proper user consent workflow must be followed.
|
|
9
21
|
*/
|
|
10
22
|
export declare const denyTool: Tool;
|
|
11
23
|
interface DenyArgs {
|
package/package.json
CHANGED
package/src/tools/confirm.ts
CHANGED
|
@@ -14,10 +14,32 @@ import { logger } from '../utils/logger.js';
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Tool definition for remember_confirm
|
|
17
|
+
*
|
|
18
|
+
* CRITICAL SAFETY: This tool must ONLY be called after explicit user confirmation
|
|
19
|
+
* in a separate message. Never chain with other tools or call immediately after
|
|
20
|
+
* receiving a token. The confirmation workflow requires:
|
|
21
|
+
*
|
|
22
|
+
* 1. Agent calls remember_publish (or other confirmable action)
|
|
23
|
+
* 2. Agent receives token in response
|
|
24
|
+
* 3. Agent presents details to user and asks for confirmation
|
|
25
|
+
* 4. User responds in SEPARATE message with explicit yes/no
|
|
26
|
+
* 5. Agent calls remember_confirm or remember_deny in NEW response
|
|
27
|
+
*
|
|
28
|
+
* Chaining confirmations bypasses user consent and violates security model.
|
|
17
29
|
*/
|
|
18
30
|
export const confirmTool: Tool = {
|
|
19
31
|
name: 'remember_confirm',
|
|
20
|
-
description:
|
|
32
|
+
description: `Confirm and execute a pending action using the token. Works for any action that requires confirmation (publish, delete, etc.).
|
|
33
|
+
|
|
34
|
+
⚠️ CRITICAL SAFETY REQUIREMENTS:
|
|
35
|
+
Before executing this tool, you MUST:
|
|
36
|
+
1. Have received the confirmation token in a PREVIOUS tool response
|
|
37
|
+
2. Have presented the token details to the user for review
|
|
38
|
+
3. Have received EXPLICIT user confirmation in a SEPARATE user message
|
|
39
|
+
4. NEVER chain this tool with other tool calls in the same response
|
|
40
|
+
5. ALWAYS treat confirmations as standalone, deliberate actions
|
|
41
|
+
|
|
42
|
+
Violating these requirements bypasses user consent and is a security violation.`,
|
|
21
43
|
inputSchema: {
|
|
22
44
|
type: 'object',
|
|
23
45
|
properties: {
|
package/src/tools/deny.ts
CHANGED
|
@@ -10,10 +10,32 @@ import { handleToolError } from '../utils/error-handler.js';
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Tool definition for remember_deny
|
|
13
|
+
*
|
|
14
|
+
* CRITICAL SAFETY: This tool must ONLY be called after explicit user denial
|
|
15
|
+
* in a separate message. Never chain with other tools or call immediately after
|
|
16
|
+
* receiving a token. The denial workflow requires:
|
|
17
|
+
*
|
|
18
|
+
* 1. Agent calls remember_publish (or other confirmable action)
|
|
19
|
+
* 2. Agent receives token in response
|
|
20
|
+
* 3. Agent presents details to user and asks for confirmation
|
|
21
|
+
* 4. User responds in SEPARATE message with explicit denial
|
|
22
|
+
* 5. Agent calls remember_deny in NEW response
|
|
23
|
+
*
|
|
24
|
+
* Proper user consent workflow must be followed.
|
|
13
25
|
*/
|
|
14
26
|
export const denyTool: Tool = {
|
|
15
27
|
name: 'remember_deny',
|
|
16
|
-
description:
|
|
28
|
+
description: `Deny a pending action. The request will be marked as denied and the token invalidated. Works for any action that requires confirmation.
|
|
29
|
+
|
|
30
|
+
⚠️ CRITICAL SAFETY REQUIREMENTS:
|
|
31
|
+
Before executing this tool, you MUST:
|
|
32
|
+
1. Have received the confirmation token in a PREVIOUS tool response
|
|
33
|
+
2. Have presented the token details to the user for review
|
|
34
|
+
3. Have received EXPLICIT user denial in a SEPARATE user message
|
|
35
|
+
4. NEVER chain this tool with other tool calls in the same response
|
|
36
|
+
5. ALWAYS treat denials as standalone, deliberate actions
|
|
37
|
+
|
|
38
|
+
This ensures proper user consent workflow is followed.`,
|
|
17
39
|
inputSchema: {
|
|
18
40
|
type: 'object',
|
|
19
41
|
properties: {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
we need to add tool description updates to `remember_confirm` and `remember_deny`:
|
|
2
|
-
|
|
3
|
-
something like:
|
|
4
|
-
|
|
5
|
-
CRITICAL/IMPORTANT:
|
|
6
|
-
|
|
7
|
-
"Before executing ANY remember_confirm or remember_deny action, you MUST:
|
|
8
|
-
|
|
9
|
-
Have received the confirmation token in a PREVIOUS tool response
|
|
10
|
-
Have presented the token details to the user
|
|
11
|
-
Have received an EXPLICIT confirmation in a SEPARATE user message
|
|
12
|
-
Never chain confirm actions with other tool calls
|
|
13
|
-
Always treat confirmations as standalone, deliberate actions"
|