@prmichaelsen/remember-mcp 2.6.1 → 2.6.3
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 +62 -0
- package/agent/progress.yaml +163 -13
- package/agent/tasks/task-61-enhance-confirmation-tool-descriptions.md +267 -0
- package/agent/tasks/task-62-fix-confirmation-response-storage.md +323 -0
- package/agent/tasks/task-63-fix-fetchobjectbyid-missing-properties.md +397 -0
- package/dist/server-factory.js +63 -6
- package/dist/server.js +63 -6
- package/dist/tools/confirm.d.ts +12 -0
- package/dist/tools/deny.d.ts +12 -0
- package/dist/weaviate/client.d.ts +16 -0
- package/package.json +1 -1
- package/src/tools/confirm.ts +30 -3
- package/src/tools/deny.ts +23 -1
- package/src/tools/publish.ts +6 -2
- package/src/weaviate/client.ts +47 -0
- package/agent/tasks/task-70-draft.md +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,68 @@ 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.3] - 2026-02-16
|
|
9
|
+
|
|
10
|
+
### 🐛 Fixed
|
|
11
|
+
|
|
12
|
+
- **CRITICAL: Fixed Empty Published Memories Bug**
|
|
13
|
+
- Published memories were empty shells with no content, title, or properties
|
|
14
|
+
- Root cause: `fetchObjectById()` calls missing `returnProperties` parameter
|
|
15
|
+
- Fixed in `remember_publish` and `remember_confirm` (executePublishMemory)
|
|
16
|
+
- All published memories now include complete property data
|
|
17
|
+
|
|
18
|
+
### ✨ Added
|
|
19
|
+
|
|
20
|
+
- **New Utility Function**: `fetchMemoryWithAllProperties()`
|
|
21
|
+
- Centralized helper in `src/weaviate/client.ts`
|
|
22
|
+
- Ensures all memory properties are fetched consistently
|
|
23
|
+
- Prevents future bugs from missing properties
|
|
24
|
+
- Includes `ALL_MEMORY_PROPERTIES` constant (20+ properties)
|
|
25
|
+
|
|
26
|
+
### 🔧 Improved
|
|
27
|
+
|
|
28
|
+
- Enhanced debug logging in publish flow
|
|
29
|
+
- Added property count verification
|
|
30
|
+
- Added hasTitle and hasContent checks
|
|
31
|
+
- Better diagnostics for troubleshooting
|
|
32
|
+
|
|
33
|
+
### 🎯 Impact
|
|
34
|
+
|
|
35
|
+
- **Fixes**: All published memories since v2.4.0 were empty
|
|
36
|
+
- **Search**: Published memories now searchable (have content)
|
|
37
|
+
- **Discovery**: Space functionality now works as designed
|
|
38
|
+
- **Note**: Existing empty memories need to be re-published
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## [2.6.2] - 2026-02-16
|
|
43
|
+
|
|
44
|
+
### 🔒 Security
|
|
45
|
+
|
|
46
|
+
- **Enhanced Confirmation Tool Safety Guidelines**
|
|
47
|
+
- Added critical safety requirements to `remember_confirm` tool description
|
|
48
|
+
- Added critical safety requirements to `remember_deny` tool description
|
|
49
|
+
- Added JSDoc comments emphasizing proper confirmation workflow
|
|
50
|
+
- Prevents agents from bypassing user consent by chaining confirmations
|
|
51
|
+
|
|
52
|
+
### 📝 Changed
|
|
53
|
+
|
|
54
|
+
- Updated `remember_confirm` description with 5 critical safety requirements
|
|
55
|
+
- Updated `remember_deny` description with 5 critical safety requirements
|
|
56
|
+
- Added ⚠️ visual indicators for safety requirements
|
|
57
|
+
- Added detailed JSDoc comments explaining proper workflow
|
|
58
|
+
|
|
59
|
+
### 🎯 Safety Requirements
|
|
60
|
+
|
|
61
|
+
Both confirmation tools now explicitly require:
|
|
62
|
+
1. Token received in PREVIOUS tool response
|
|
63
|
+
2. Details presented to user for review
|
|
64
|
+
3. EXPLICIT user confirmation/denial in SEPARATE message
|
|
65
|
+
4. NEVER chain with other tool calls
|
|
66
|
+
5. ALWAYS treat as standalone, deliberate actions
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
8
70
|
## [2.6.1] - 2026-02-16
|
|
9
71
|
|
|
10
72
|
### 🔧 Improved
|
package/agent/progress.yaml
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
project:
|
|
4
4
|
name: remember-mcp
|
|
5
|
-
version: 2.
|
|
5
|
+
version: 2.6.3
|
|
6
6
|
started: 2026-02-11
|
|
7
7
|
status: in_progress
|
|
8
|
-
current_milestone:
|
|
8
|
+
current_milestone: M12
|
|
9
9
|
last_updated: 2026-02-16
|
|
10
10
|
|
|
11
11
|
milestones:
|
|
@@ -162,7 +162,26 @@ milestones:
|
|
|
162
162
|
✅ No memory duplication across spaces
|
|
163
163
|
✅ All tests passing with multi-space support
|
|
164
164
|
✅ Documentation updated with multi-space examples
|
|
165
|
-
|
|
165
|
+
|
|
166
|
+
- id: M12
|
|
167
|
+
name: Comment System (Phase 1)
|
|
168
|
+
status: in_progress
|
|
169
|
+
progress: 60%
|
|
170
|
+
started: 2026-02-16
|
|
171
|
+
completed: null
|
|
172
|
+
estimated_weeks: 1
|
|
173
|
+
tasks_completed: 3
|
|
174
|
+
tasks_total: 5
|
|
175
|
+
notes: |
|
|
176
|
+
✅ Task 55: Added 3 comment fields to schema (parent_id, thread_root_id, moderation_flags)
|
|
177
|
+
✅ Task 56: Updated remember_search_space with include_comments parameter
|
|
178
|
+
✅ Task 57: Updated remember_query_space with include_comments parameter
|
|
179
|
+
📋 Task 58: Add Comment Unit Tests (pending)
|
|
180
|
+
📋 Task 59: Update Documentation for Comments (pending)
|
|
181
|
+
✅ Zero new tools required - reuses existing infrastructure
|
|
182
|
+
✅ Backward compatible - comments excluded by default
|
|
183
|
+
✅ Released v2.6.0 with comment system foundation
|
|
184
|
+
|
|
166
185
|
- id: M7
|
|
167
186
|
name: Trust & Permissions
|
|
168
187
|
status: not_started
|
|
@@ -406,11 +425,97 @@ tasks:
|
|
|
406
425
|
✅ Context inclusion toggle
|
|
407
426
|
✅ Integrated into server.ts and server-factory.ts
|
|
408
427
|
|
|
428
|
+
milestone_12:
|
|
429
|
+
- id: task-55
|
|
430
|
+
name: Add Comment Fields to Weaviate Schema
|
|
431
|
+
status: completed
|
|
432
|
+
file: agent/tasks/task-55-add-comment-fields-to-schema.md
|
|
433
|
+
estimated_hours: 2
|
|
434
|
+
completed_date: 2026-02-16
|
|
435
|
+
notes: |
|
|
436
|
+
✅ Added 3 fields to Memory schema: parent_id, thread_root_id, moderation_flags
|
|
437
|
+
✅ Added same fields to Memory_public collection
|
|
438
|
+
✅ Enables infinite comment nesting
|
|
439
|
+
✅ Per-space moderation support
|
|
440
|
+
✅ Released in v2.6.0
|
|
441
|
+
|
|
442
|
+
- id: task-56
|
|
443
|
+
name: Update remember_search_space for Comments
|
|
444
|
+
status: completed
|
|
445
|
+
file: agent/tasks/task-56-update-search-space-for-comments.md
|
|
446
|
+
estimated_hours: 2
|
|
447
|
+
completed_date: 2026-02-16
|
|
448
|
+
notes: |
|
|
449
|
+
✅ Added include_comments parameter (default: false)
|
|
450
|
+
✅ Comments excluded from search by default
|
|
451
|
+
✅ Opt-in via include_comments: true
|
|
452
|
+
✅ Backward compatible
|
|
453
|
+
✅ Released in v2.6.0
|
|
454
|
+
|
|
455
|
+
- id: task-57
|
|
456
|
+
name: Update remember_query_space for Comments
|
|
457
|
+
status: completed
|
|
458
|
+
file: agent/tasks/task-57-update-query-space-for-comments.md
|
|
459
|
+
estimated_hours: 1
|
|
460
|
+
completed_date: 2026-02-16
|
|
461
|
+
notes: |
|
|
462
|
+
✅ Added include_comments parameter (default: false)
|
|
463
|
+
✅ Same filtering logic as search_space
|
|
464
|
+
✅ Backward compatible
|
|
465
|
+
✅ Released in v2.6.0
|
|
466
|
+
|
|
467
|
+
- id: task-58
|
|
468
|
+
name: Add Comment Unit Tests
|
|
469
|
+
status: not_started
|
|
470
|
+
file: agent/tasks/task-58-add-comment-unit-tests.md
|
|
471
|
+
estimated_hours: 3
|
|
472
|
+
notes: |
|
|
473
|
+
📋 Pending: Schema tests, filtering tests, edge cases
|
|
474
|
+
📋 Test infinite nesting support
|
|
475
|
+
📋 Test moderation flags
|
|
476
|
+
|
|
477
|
+
- id: task-59
|
|
478
|
+
name: Update Documentation for Comments
|
|
479
|
+
status: not_started
|
|
480
|
+
file: agent/tasks/task-59-update-documentation-for-comments.md
|
|
481
|
+
estimated_hours: 2
|
|
482
|
+
notes: |
|
|
483
|
+
📋 Pending: README updates, CHANGELOG entry, examples
|
|
484
|
+
📋 Document comment creation workflow
|
|
485
|
+
📋 Add threading examples
|
|
486
|
+
|
|
487
|
+
- id: task-60
|
|
488
|
+
name: Standardize Structured Logging
|
|
489
|
+
status: completed
|
|
490
|
+
file: agent/tasks/task-60-standardize-structured-logging.md
|
|
491
|
+
estimated_hours: 3
|
|
492
|
+
completed_date: 2026-02-16
|
|
493
|
+
notes: |
|
|
494
|
+
✅ Replaced 54 console.log/error/warn calls with structured logger
|
|
495
|
+
✅ Updated 8 files: confirmation-token.service, publish, confirm, deny, weaviate client/schema/space-schema, firestore init, config
|
|
496
|
+
✅ All logs include context objects (service, module, tool names)
|
|
497
|
+
✅ Fixed circular dependency in config.ts with dynamic import
|
|
498
|
+
✅ Released in v2.6.1
|
|
499
|
+
|
|
500
|
+
- id: task-61
|
|
501
|
+
name: Enhance Confirmation Tool Safety Guidelines
|
|
502
|
+
status: completed
|
|
503
|
+
file: agent/tasks/task-61-enhance-confirmation-tool-descriptions.md
|
|
504
|
+
estimated_hours: 1
|
|
505
|
+
completed_date: 2026-02-16
|
|
506
|
+
notes: |
|
|
507
|
+
✅ Enhanced remember_confirm tool description with 5 critical safety requirements
|
|
508
|
+
✅ Enhanced remember_deny tool description with same safety guidelines
|
|
509
|
+
✅ Added JSDoc comments explaining proper workflow
|
|
510
|
+
✅ Prevents agents from bypassing user consent
|
|
511
|
+
✅ Visual indicators (⚠️) for critical requirements
|
|
512
|
+
✅ Released in v2.6.2
|
|
513
|
+
|
|
409
514
|
documentation:
|
|
410
515
|
design_documents: 23
|
|
411
|
-
milestone_documents:
|
|
516
|
+
milestone_documents: 11
|
|
412
517
|
pattern_documents: 5
|
|
413
|
-
task_documents:
|
|
518
|
+
task_documents: 61
|
|
414
519
|
|
|
415
520
|
progress:
|
|
416
521
|
planning: 100%
|
|
@@ -418,6 +523,33 @@ progress:
|
|
|
418
523
|
overall: 50%
|
|
419
524
|
|
|
420
525
|
recent_work:
|
|
526
|
+
- date: 2026-02-16
|
|
527
|
+
description: Comment System, Structured Logging, and Safety Guidelines (v2.6.0-v2.6.2)
|
|
528
|
+
items:
|
|
529
|
+
- 🎉 M12 STARTED: Comment System (Phase 1) - 60% complete (3/5 tasks)
|
|
530
|
+
- ✅ Task 55: Added 3 comment fields to Weaviate schema
|
|
531
|
+
- ✅ parent_id, thread_root_id, moderation_flags fields added
|
|
532
|
+
- ✅ Enables infinite comment nesting with no depth limit
|
|
533
|
+
- ✅ Per-space moderation flags support
|
|
534
|
+
- ✅ Task 56: Updated remember_search_space with include_comments parameter
|
|
535
|
+
- ✅ Comments excluded by default for clean discovery
|
|
536
|
+
- ✅ Opt-in via include_comments: true
|
|
537
|
+
- ✅ Task 57: Updated remember_query_space with include_comments parameter
|
|
538
|
+
- ✅ Same filtering logic as search_space
|
|
539
|
+
- ✅ Released v2.6.0 with comment system foundation
|
|
540
|
+
- ✅ Task 60: Standardized structured logging across 8 files
|
|
541
|
+
- ✅ Replaced 54 console.log/error/warn calls with logger.info/error/warn/debug
|
|
542
|
+
- ✅ All logs include context objects (service, module, tool names)
|
|
543
|
+
- ✅ Fixed circular dependency in config.ts with dynamic import
|
|
544
|
+
- ✅ Released v2.6.1 with structured logging
|
|
545
|
+
- ✅ Task 61: Enhanced confirmation tool safety guidelines
|
|
546
|
+
- ✅ Added 5 critical safety requirements to remember_confirm and remember_deny
|
|
547
|
+
- ✅ Prevents agents from chaining confirmations without user consent
|
|
548
|
+
- ✅ Visual indicators (⚠️) and JSDoc comments added
|
|
549
|
+
- ✅ Released v2.6.2 with safety enhancements
|
|
550
|
+
- 📋 Next: Complete M12 with Tasks 58-59 (tests + documentation)
|
|
551
|
+
- 📋 6 commits ready to push to origin
|
|
552
|
+
|
|
421
553
|
- date: 2026-02-16
|
|
422
554
|
description: ACP Initialization Complete - Multi-Space Architecture Verified (v2.5.1)
|
|
423
555
|
items:
|
|
@@ -743,18 +875,21 @@ recent_work:
|
|
|
743
875
|
- ✅ Build successful
|
|
744
876
|
|
|
745
877
|
next_steps:
|
|
746
|
-
-
|
|
747
|
-
-
|
|
748
|
-
-
|
|
749
|
-
-
|
|
750
|
-
-
|
|
751
|
-
-
|
|
878
|
+
- Complete Task 58: Add Comment Unit Tests (3 hours)
|
|
879
|
+
- Complete Task 59: Update Documentation for Comments (2 hours)
|
|
880
|
+
- Push 6 commits to origin (v2.6.0, v2.6.1, v2.6.2)
|
|
881
|
+
- Deploy v2.6.2 to Cloud Run
|
|
882
|
+
- Test comment system end-to-end (create, search, thread fetching)
|
|
883
|
+
- Test structured logging in Cloud Run logs
|
|
884
|
+
- Verify confirmation tool safety guidelines in production
|
|
885
|
+
- Complete M12: Comment System (Phase 1)
|
|
752
886
|
- Start M5: Template System (15 default templates + auto-suggestion)
|
|
753
887
|
- Optional: Create integration tests (Task 6)
|
|
754
888
|
- Optional: Add development documentation (Task 7)
|
|
755
889
|
- Consider M6: Auth & Multi-Tenancy
|
|
756
890
|
|
|
757
891
|
notes:
|
|
892
|
+
- 🚀 Milestone 12 (Comment System Phase 1) IN PROGRESS - 60% complete!
|
|
758
893
|
- 🎉 Milestone 11 (Unified Public Collection) COMPLETED!
|
|
759
894
|
- 🎉 Milestone 10 (Shared Spaces & Confirmation Flow) COMPLETED!
|
|
760
895
|
- 🎉 Milestone 4 (User Preferences) COMPLETED!
|
|
@@ -769,6 +904,10 @@ notes:
|
|
|
769
904
|
- ✅ M4: 2/2 preference tools complete (100% progress)
|
|
770
905
|
- ✅ M10: 10/10 shared space tools complete (100% progress)
|
|
771
906
|
- ✅ M11: 9/9 multi-space architecture tasks complete (100% progress)
|
|
907
|
+
- 🚀 M12: 3/5 comment system tasks complete (60% progress)
|
|
908
|
+
- ✅ Comment system foundation implemented (v2.6.0)
|
|
909
|
+
- ✅ Structured logging standardized (v2.6.1)
|
|
910
|
+
- ✅ Confirmation tool safety enhanced (v2.6.2)
|
|
772
911
|
- ✅ Complete memory CRUD operations (create, read, update, delete)
|
|
773
912
|
- ✅ Complete relationship CRUD operations (create, read, update, delete)
|
|
774
913
|
- ✅ Advanced search capabilities (hybrid, similarity, RAG queries)
|
|
@@ -833,8 +972,10 @@ build_status:
|
|
|
833
972
|
- ✅ Source maps generated
|
|
834
973
|
- ✅ Type definitions generated (.d.ts files)
|
|
835
974
|
- ✅ Package exports configured for both entry points
|
|
836
|
-
- ✅ Version 2.
|
|
837
|
-
- ✅
|
|
975
|
+
- ✅ Version 2.6.2 published (patch release - safety guidelines)
|
|
976
|
+
- ✅ Version 2.6.1 published (patch release - structured logging)
|
|
977
|
+
- ✅ Version 2.6.0 published (minor release - comment system)
|
|
978
|
+
- ✅ 30 TypeScript source files
|
|
838
979
|
- ✅ All 12 tools implemented
|
|
839
980
|
- ✅ Weaviate v3 filter API implemented
|
|
840
981
|
- ✅ Or/And operator validation implemented
|
|
@@ -857,6 +998,12 @@ tools_status:
|
|
|
857
998
|
preference_tools:
|
|
858
999
|
- ✅ remember_set_preference (src/tools/set-preference.ts)
|
|
859
1000
|
- ✅ remember_get_preferences (src/tools/get-preferences.ts)
|
|
1001
|
+
space_tools:
|
|
1002
|
+
- ✅ remember_publish (src/tools/publish.ts) - Multi-space support
|
|
1003
|
+
- ✅ remember_confirm (src/tools/confirm.ts) - Enhanced safety guidelines
|
|
1004
|
+
- ✅ remember_deny (src/tools/deny.ts) - Enhanced safety guidelines
|
|
1005
|
+
- ✅ remember_search_space (src/tools/search-space.ts) - Comment filtering
|
|
1006
|
+
- ✅ remember_query_space (src/tools/query-space.ts) - Comment filtering
|
|
860
1007
|
|
|
861
1008
|
implementation_notes:
|
|
862
1009
|
- All 12 core tools implemented and integrated
|
|
@@ -899,3 +1046,6 @@ task_20_completion:
|
|
|
899
1046
|
releases:
|
|
900
1047
|
- v1.0.0: Major release with breaking change (async createServer)
|
|
901
1048
|
- v1.0.1: Patch release with Or operator bug fix
|
|
1049
|
+
- v2.6.0: Minor release with comment system foundation
|
|
1050
|
+
- v2.6.1: Patch release with structured logging
|
|
1051
|
+
- v2.6.2: Patch release with confirmation tool safety guidelines
|
|
@@ -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
|