Skip to content

Commit 3407971

Browse files
committed
fix: auto-approve tools for non-quarantined servers on upgrade
The auto-approve logic was only triggered when global quarantine was disabled or server had skip_quarantine. Now it also auto-approves for servers that are not quarantined at server-level (trusted servers). Changed tools (rug pull detection) still always blocked when global quarantine is enabled. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dc6cf94 commit 3407971

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

internal/runtime/tool_quarantine.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,21 @@ func (r *Runtime) checkToolApprovals(serverName string, tools []*config.ToolMeta
4949
globalEnabled := cfg.IsQuarantineEnabled()
5050

5151
serverSkipped := false
52+
serverQuarantined := false
5253
for _, sc := range cfg.Servers {
5354
if sc.Name == serverName {
5455
serverSkipped = sc.IsQuarantineSkipped()
56+
serverQuarantined = sc.Quarantined
5557
break
5658
}
5759
}
5860

59-
enforceQuarantine := globalEnabled && !serverSkipped
61+
// Auto-approve new tools when:
62+
// - Global quarantine is disabled, OR
63+
// - Server has skip_quarantine=true, OR
64+
// - Server is NOT quarantined (user trusts this server)
65+
// Changed tools are still blocked regardless (rug pull detection).
66+
enforceQuarantine := globalEnabled && !serverSkipped && serverQuarantined
6067

6168
result := &ToolApprovalResult{
6269
BlockedTools: make(map[string]bool),
@@ -217,7 +224,10 @@ func (r *Runtime) checkToolApprovals(serverName string, tools []*config.ToolMeta
217224
zap.String("current_hash", currentHash),
218225
zap.Bool("quarantine_enforced", enforceQuarantine))
219226

220-
if enforceQuarantine {
227+
// Always block changed tools when quarantine is globally enabled,
228+
// even for trusted (non-quarantined) servers.
229+
// Rug pull detection is a critical security feature.
230+
if globalEnabled {
221231
result.BlockedTools[toolName] = true
222232
result.ChangedCount++
223233
}

0 commit comments

Comments
 (0)