# VS Code 1.148 让 agent 在聊天里问你 sudo 密码，我建议先关掉再说

**URL:** <https://geekicool.com/t/topic/32>\
**Category:** 常规\
**Created:** [2026 年11 月 30 日 12:48 UTC](https://geekicool.com/t/topic/32 "2026-11-30T12:48:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

作者： ![tech\_daily](https://geekicool.com/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@tech\_daily](https://geekicool.com/u/tech_daily)\
发布日期： [2026 年11 月 30 日 12:48 UTC](https://geekicool.com/t/topic/32/1 "2026-11-30T12:48:24Z")

</div>

VS Code 1.148（11 月 25 日）基本全是给 agent 的：首响应平均快约 30%，实验性的 Create Dev Containers 能让 agent 自己开个隔离的 Ubuntu 容器干活，还有 sessions.keepAwakeWhileWorking 防止 agent 跑一半电脑睡过去（默认只在插电时生效）。

我最想说的是一条不起眼的：agent 执行 sudo、ssh、git 要密码时，现在会在聊天里弹出来让你填，官方说答案只给那个程序、不发给模型。

我的看法：机制本身也许没问题，但它训练的是一种危险习惯——“对话框要密码我就填”。agent 为什么需要 sudo？这一步本该停下来想。不想被问的话，可以关 chat.agentHost.copilot.shellAuthentication.enabled。更稳的姿势是配合那个容器功能，让 agent 在容器里折腾，根本碰不到宿主机密码。

顺带一个对所有人有用的：diffEditor.diffAlgorithm 设成 advanced-wasm，新 diff 算法中位数快 2 倍以上。

来源：

- [https://www.codeworlds.com/en/collections/news/vs-code-1-148-whats-new-2026-11-25](https://www.codeworlds.com/en/collections/news/vs-code-1-148-whats-new-2026-11-25)

---

<div class="post-metadata">

作者： ![climan](https://geekicool.com/letter_avatar_proxy/v4/letter/c/3ab097/32.png) [@climan](https://geekicool.com/u/climan)\
发布日期： [2026 年11 月 30 日 13:59 UTC](https://geekicool.com/t/topic/32/2 "2026-11-30T13:59:11Z")

</div>

看到聊天框里弹出 sudo 密码输入框我也吓了一跳，哪怕官方说不走模型上下文，心理上还是过不去这关。我直接把相关权限关了，需要提权的操作还是自己切到 tmux 里敲。

---

<div class="post-metadata">

作者： ![lurker](https://geekicool.com/user_avatar/geekicool.com/lurker/32/61_2.png) [@lurker](https://geekicool.com/u/lurker)\
发布日期： [2026 年11 月 30 日 15:00 UTC](https://geekicool.com/t/topic/32/3 "2026-11-30T15:00:16Z")

</div>

同感，万一哪天手滑或者提示词注入混进去了呢，安全边界还是别交出去好。
