[#158] feat: trust context plugin — trusted/untrusted message distinction #159
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Competitor
Kind/Documentation
Kind/Enhancement
Kind/Epic
Kind/Feature
Kind/Security
Kind/Story
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Scope/Core
Scope/Cross-Plugin
Scope/Plugin-System
Scope/Single-Plugin
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ultanio/cobot!159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/trust-plugin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #158
What
Pure plugin that introduces trust boundaries to LLM conversations using the message role field (
system= trusted,user= untrusted).How
loop.transform_system_promptloop.on_messageloop.transform_historyrole: systemat index 1Message Flow
Design Decisions
Tests
21 tests covering:
Reviewed by plugin-reviewer sub-agent (NEEDS-REVISION → addressed all feedback).
34bba0f902to17bd085411PR Review - Trust Context Plugin
Summary
✅ Story: #158 - Trust Context Plugin
❌ Status: REQUEST_CHANGES (Critical extension point bug)
AC Compliance
🚨 Critical Issue - Extension Point Mismatch
File:
cobot/plugins/trust/plugin.py:82Problem: Trust plugin expects
"peer"but loop passes"sender"Impact: Trust context will always show sender as "unknown", defeating the purpose.
Fix: Change line 82 to:
Extension Point Verification
loop.on_message: Field name mismatch (critical)loop.transform_system_prompt: Correctctx.get("prompt")loop.transform_history: Correctctx.get("messages")Code Quality
✅ Strengths
⚠️ Concerns
self._current_metadatainstance variable in concurrent environment"peer"vs actual"sender")Test Results
But: Tests use mocked data that doesn't match the real loop interface, masking the bug.
Required Changes
🔴 Must Fix (Blocking)
"peer"→"sender"🟡 Should Fix
Overall Assessment
Excellent plugin design and implementation, but a critical integration bug prevents it from working. The mismatch between expected and actual extension point signatures is a blocking issue.
Once the field name is fixed, this will be a solid addition that properly implements trusted context boundaries using LLM message roles.
Priority: High (addresses security concern #158)
Architecture: Sound (pure extension points, no core changes)
Testing: Comprehensive but needs integration coverage
4f64c397a6to7a4e33ba087a4e33ba08b39bf60745Second Round Review - APPROVE ✅
Previous Issues RESOLVED:
✅ Fixed field name mismatch: The plugin now correctly uses
ctx.get("sender")incapture_metadatato match whatloop.on_messageactually passes (verified inloop.py:255)✅ Fixed test field names: Tests now use
"sender"field consistently instead of"peer"Verification Results:
🔍 Extension point field validation:
loop.on_messagepasses:sender,sender_id,channel_type,channel_id,event_idloop.transform_system_promptpasses:prompt,peer,messagesloop.transform_historypasses:messages,peersenderfor theon_messagehook🧪 Tests: All 21 tests pass
📋 Code Quality:
📖 Documentation: README.md is comprehensive and accurate
Minor Observation (non-blocking): The plugin uses instance variable
_current_metadatato pass data between hooks, which works correctly in the current sequential message processing but could theoretically be a concern if concurrent processing were added in the future. However, this is not an issue with the current implementation.Verdict: APPROVE - All previous REQUEST_CHANGES items have been resolved. The implementation is solid and follows Cobot plugin patterns correctly.