feat(acp): opt-in toggle to allow insecure ws:// for local agents#990
feat(acp): opt-in toggle to allow insecure ws:// for local agents#990aatchison wants to merge 1 commit into
Conversation
Custom remote-ACP agents previously accepted cleartext ws:// unconditionally
(except on iOS). Require secure wss:// by default and gate ws:// behind a new,
default-off 'Allow insecure local agents' Developer Setting (allowInsecureAcp) —
intended for connecting to a local agent binary on 127.0.0.1.
- local-settings-store: add allowInsecureAcp (default false, persisted).
- validateAgentUrl: options object { isIos, allowInsecure }; reject ws:// unless
allowInsecure; iOS still rejects ws:// regardless (ATS).
- add-custom-agent dialog reads the setting and passes it through.
- dev-settings: 'Agents' section with the toggle.
- tests updated for the new signature + gating (default-deny, opt-in allow, iOS).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Semgrep Security ScanNo security issues found. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 26029c1. Configure here.
| const trimmedUrl = state.url.trim() | ||
| const trimmedDescription = state.description.trim() | ||
| const validation = validateAgentUrl(trimmedUrl, isIos) | ||
| const validation = validateAgentUrl(trimmedUrl, { isIos, allowInsecure }) |
There was a problem hiding this comment.
Add stays enabled after opt-in off
Low Severity
canSubmit still keys off a prior successful connection test, but URL validity now also depends on allowInsecureAcp. If the user disables “Allow insecure local agents” while the dialog still has a tested ws:// URL, the inline error appears yet Add Agent can remain enabled; handleSubmit then no-ops without feedback.
Reviewed by Cursor Bugbot for commit 26029c1. Configure here.
PR Metrics
Updated Tue, 16 Jun 2026 22:23:26 GMT · run #1929 |
|
Thoughts:
|


Why
A user running a local ACP agent binary connects over cleartext
ws://127.0.0.1:<port>. Today the custom-agent dialog acceptsws://unconditionally (only iOS blocks it). This makes that an explicit, default-off opt-in instead — securewss://is required unless the user knowingly enables insecure local agents.What
local-settings-store: new persistedallowInsecureAcp(default false).validateAgentUrl: now takes{ isIos, allowInsecure }; rejectsws://by default with a clear message ("Enable 'Allow insecure local agents' in Developer Settings").wss://always allowed; iOS still rejectsws://regardless (Apple ATS).bun run type-checkclean,eslintclean, 24/24 dialog tests pass.Base
Stacked on #967 (
coding-agent-broker-provider) — that's where the remote-ACP provider + this validation live; there's no ACP code onmainyet. Re-targetsmainonce #967 lands. Pairs with the local shim binary (https://github.com/thunderbird/thunderbolt-coding-agent/pull/115).🤖 Generated with Claude Code
Note
Medium Risk
Changes agent connection URL policy (cleartext WebSocket), but risk is mitigated by default-off opt-in, developer-only toggle, and unchanged iOS ATS rules.
Overview
Cleartext
ws://custom ACP agent URLs are off by default;wss://stays allowed everywhere. Users can enable “Allow insecure local agents” in Developer Settings for localhost-style agents (e.g.ws://127.0.0.1).A persisted
allowInsecureAcpflag (default false) is added to the local settings store.validateAgentUrlnow takes{ isIos, allowInsecure }and rejectsws://unless opted in, with copy pointing to Developer Settings; iOS still blocksws://even when opted in (ATS). The add-custom-agent dialog reads the setting and passes it into validation. Tests cover default-deny, opt-in allow, and iOS behavior.Reviewed by Cursor Bugbot for commit 26029c1. Bugbot is set up for automated code reviews on this repo. Configure here.