Skip to content

feat(acp): opt-in toggle to allow insecure ws:// for local agents#990

Open
aatchison wants to merge 1 commit into
coding-agent-broker-providerfrom
acp-allow-insecure-ws
Open

feat(acp): opt-in toggle to allow insecure ws:// for local agents#990
aatchison wants to merge 1 commit into
coding-agent-broker-providerfrom
acp-allow-insecure-ws

Conversation

@aatchison

@aatchison aatchison commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Why

A user running a local ACP agent binary connects over cleartext ws://127.0.0.1:<port>. Today the custom-agent dialog accepts ws:// unconditionally (only iOS blocks it). This makes that an explicit, default-off opt-in instead — secure wss:// is required unless the user knowingly enables insecure local agents.

What

  • local-settings-store: new persisted allowInsecureAcp (default false).
  • validateAgentUrl: now takes { isIos, allowInsecure }; rejects ws:// by default with a clear message ("Enable 'Allow insecure local agents' in Developer Settings"). wss:// always allowed; iOS still rejects ws:// regardless (Apple ATS).
  • Add-custom-agent dialog: reads the setting and passes it through.
  • Developer Settings → Agents: a toggle to enable it (with a localhost/local-binary explanation).
  • Tests: updated for the new signature + gating (default-deny, opt-in allow, iOS-still-rejects).

bun run type-check clean, eslint clean, 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 on main yet. Re-targets main once #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 allowInsecureAcp flag (default false) is added to the local settings store. validateAgentUrl now takes { isIos, allowInsecure } and rejects ws:// unless opted in, with copy pointing to Developer Settings; iOS still blocks ws:// 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.

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>
@github-actions

Copy link
Copy Markdown

Semgrep Security Scan

No security issues found.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 26029c1. Configure here.

@github-actions

Copy link
Copy Markdown

PR Metrics

Metric Value
Lines changed (prod code) +48 / -6
JS bundle size (gzipped) 🟡 682.3 KB → 727.0 KB (+44.7 KB, +6.6%)
Test coverage 🟡 78.09% → 76.71% (-1.4%)
Performance (preview) Preview not ready — Render deploy may have timed out
Accessibility
Best Practices
SEO

Updated Tue, 16 Jun 2026 22:23:26 GMT · run #1929

@cjroth

cjroth commented Jun 17, 2026

Copy link
Copy Markdown
Member

Thoughts:

  • This would only work on desktop because the browser will block ws:// due to insecure mixed content
  • This is probably something regular (non-dev) users will run into when running local agents
  • Can we remove the toggle and instead just allow ws:// but show a warning under the text input if it's ws:// that says something like "This is an insecure URL, only proceed if you know what you are doing"?
  • I can't recall if we added the connection check when adding ACP agents, but we should confirm that it works in desktop + web for ws:// as well as wss://

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants