Tom Brow
16cc3de6d6
fix(desktop): enforce owner-only access in internal builds (#4053)
## Problem
Managed agents in internal Buzz builds should answer only their owner.
Previously, an agent could keep a broader access setting and respond to
other people, which did not match the access policy for internal builds.
This PR makes owner-only access effective for every managed agent in
internal builds and makes that restriction clear in the Desktop UI. Open
source builds remain configurable.
## Changes
- Enforce owner-only access when any managed agent starts or is deployed
from an internal build.
- Show the agent access control as locked to **Only me** in Desktop,
with an explanation of why it cannot be changed.
- Keep Welcome teammates working under the same rule without triggering
unnecessary restarts.
- Leave open source build behavior unchanged. This changes effective
runtime access without rewriting stored or relay-advertised settings.
The companion [#4064](https://github.com/block/buzz/pull/4064) explains
the restriction in-thread when someone without access mentions an agent.
The enforcement will remain inactive in shipped builds until
[squareup/buzz-releases#74](https://github.com/squareup/buzz-releases/pull/74)
marks internal releases during the build.
## Screenshots
| Before | After |
| --- | --- |
| 
| 
|
## Tests
Added coverage for:
- Runtime enforcement for [locally run
agents](e0165f52b5/desktop/src-tauri/src/managed_agents/runtime/tests.rs (L196))
and [deployed
agents](e0165f52b5/desktop/src-tauri/src/commands/agents_tests.rs (L510)).
- The [current-build deployment
path](e0165f52b5/desktop/src-tauri/src/commands/agents_tests.rs (L455)),
[invalid stored
access](e0165f52b5/desktop/src-tauri/src/managed_agents/access_policy.rs (L98)),
and the [local startup
guard](e0165f52b5/desktop/src-tauri/src/managed_agents/env_vars/tests.rs (L149)).
- Consistent enforcement across [both agent
backends](e0165f52b5/desktop/src-tauri/src/managed_agents/access_policy.rs (L112)).
- Welcome teammates created as [locally
run](e0165f52b5/desktop/src/features/onboarding/welcomeGuide.test.mjs (L384))
or
[deployed](e0165f52b5/desktop/src/features/onboarding/welcomeGuide.test.mjs (L393))
agents, including
[access-only](e0165f52b5/desktop/src/features/onboarding/welcomeKickoff.test.mjs (L202))
and
[runtime-related](e0165f52b5/desktop/src/features/onboarding/welcomeKickoff.test.mjs (L225))
restart behavior.
The full Desktop Rust and JavaScript suites, type checks, formatting,
clippy, and file-size checks passed. Playwright E2E was not run.
---
Originated from Buzz channel
[buzz-agent-control](buzz://channel?id=cf5dada7-e26a-4887-ae41-b3bd5f42d3b2).
Supersedes #2537.
---------
Signed-off-by: Tom Brow <tomb@block.xyz>
Signed-off-by: npub1tquskdu6yc4h8l7xxtceculxw600grekeq0xg2ukqfrwl7vrzg3quz3gmp <58390b379a262b73ffc632f19c73e6769ef40f36c81e642b960246eff9831222@buzz.block.builderlab.xyz>
Co-authored-by: npub1tquskdu6yc4h8l7xxtceculxw600grekeq0xg2ukqfrwl7vrzg3quz3gmp <58390b379a262b73ffc632f19c73e6769ef40f36c81e642b960246eff9831222@buzz.block.builderlab.xyz>
Co-authored-by: Amp <amp@ampcode.com>
2026-08-05 19:58:24 -06:00
..
2026-07-22 13:24:46 -07:00
2026-07-30 11:25:08 -07:00
2026-07-03 15:40:29 +00:00
2026-07-30 12:34:35 -07:00
2026-08-05 11:56:14 -07:00
2026-07-30 13:32:40 +00:00
2026-07-08 18:18:44 -04:00
2026-07-24 01:23:31 +01:00
2026-08-03 18:09:24 -04:00
2026-07-24 01:23:31 +01:00
2026-07-28 15:01:03 -04:00
2026-07-28 15:01:03 -04:00
2026-07-22 13:24:46 -07:00
2026-07-30 11:38:28 -04:00
2026-07-19 11:14:06 -07:00
2026-08-04 15:39:45 +00:00
2026-07-14 11:11:02 -07:00
2026-07-17 11:40:05 +00:00
2026-08-04 15:39:45 +00:00
2026-07-16 18:01:53 +00:00
2026-07-20 14:44:08 -07:00
2026-07-27 15:47:04 -07:00
2026-07-23 13:50:29 -06:00
2026-07-04 11:51:58 -04:00
2026-08-04 15:39:45 +00:00
2026-06-29 06:42:31 -07:00
2026-07-07 07:29:02 -07:00
2026-06-25 09:25:34 -07:00
2026-07-04 11:51:58 -04:00
2026-08-05 11:15:11 -07:00
2026-06-26 18:09:07 +00:00
2026-08-05 22:44:07 +00:00
2026-08-05 15:16:32 -07:00
2026-07-19 15:37:23 -07:00
2026-08-04 16:16:14 -07:00
2026-07-06 16:36:01 -07:00
2026-07-13 16:29:21 -04:00
2026-07-11 13:40:16 -04:00
2026-07-14 11:11:02 -07:00
2026-08-04 20:38:19 +00:00
2026-07-24 19:30:33 -07:00
2026-07-18 23:16:00 -04:00
2026-07-14 16:50:22 +01:00
2026-07-19 19:01:38 +00:00
2026-07-30 17:07:22 -04:00
2026-07-28 19:37:12 +01:00
2026-07-27 16:45:34 -04:00
2026-08-03 12:08:29 -04:00
2026-08-05 19:58:24 -06:00
2026-08-04 17:08:29 -04:00
2026-08-05 15:16:32 -07:00
2026-08-03 14:12:21 -07:00
2026-07-27 11:01:42 -07:00
2026-07-30 20:58:03 -04:00
2026-07-20 00:53:53 +02:00
2026-07-24 19:30:33 -07:00
2026-08-04 13:07:50 -07:00
2026-07-06 06:55:58 -07:00
2026-07-20 08:58:48 -07:00
2026-07-20 15:35:40 +00:00
2026-07-27 09:47:02 -07:00
2026-07-19 11:42:35 -07:00
2026-08-05 15:16:32 -07:00
2026-08-05 18:46:29 -07:00
2026-07-18 00:01:24 +00:00
2026-07-20 00:53:53 +02:00
2026-07-28 14:01:18 -04:00
2026-07-28 16:01:41 -04:00
2026-07-27 16:45:34 -04:00
2026-08-04 10:39:09 -07:00
2026-08-04 10:39:09 -07:00
2026-07-18 15:45:41 +00:00
2026-07-04 11:51:58 -04:00
2026-07-06 17:41:56 -04:00
2026-07-08 14:38:52 -07:00
2026-08-05 11:15:11 -07:00
2026-08-03 14:12:21 -07:00
2026-07-30 07:46:56 -07:00
2026-08-04 07:11:16 -07:00
2026-07-26 13:20:26 -07:00
2026-08-02 14:53:01 -04:00
2026-08-04 12:21:59 -04:00
2026-07-16 12:44:14 -07:00
2026-08-04 16:02:34 -04:00
2026-07-24 12:10:09 -04:00
2026-08-03 13:05:47 -07:00
2026-07-18 15:31:17 -07:00
2026-07-30 20:58:03 -04:00
2026-07-30 20:58:03 -04:00
2026-08-04 07:14:09 -07:00
2026-08-03 21:51:17 -04:00
2026-07-04 11:51:58 -04:00
2026-07-16 16:18:07 -07:00
2026-08-03 11:12:34 -04:00
2026-07-28 15:01:03 -04:00
2026-07-28 15:01:03 -04:00
2026-07-03 15:40:29 +00:00
2026-07-30 11:15:39 -07:00
2026-06-11 15:06:24 +00:00
2026-07-12 18:46:02 -04:00
2026-08-03 09:30:15 -07:00
2026-08-04 17:30:12 -04:00
2026-08-04 17:30:12 -04:00
2026-08-04 17:30:12 -04:00
2026-08-04 17:30:12 -04:00
2026-07-19 14:39:59 -04:00
2026-08-03 14:09:46 -07:00
2026-07-12 08:42:31 -07:00
2026-07-02 19:30:24 +00:00
2026-06-25 09:25:34 -07:00
2026-08-04 18:33:42 +00:00
2026-07-30 11:25:08 -07:00
2026-07-15 07:34:50 -07:00
2026-07-27 16:45:34 -04:00
2026-07-25 16:49:56 -07:00
2026-06-18 20:40:05 -04:00
2026-07-06 13:58:15 -04:00
2026-07-02 20:15:44 +00:00
2026-06-29 09:18:16 -07:00
2026-07-29 15:48:06 -04:00
2026-08-05 11:56:14 -07:00
2026-07-30 20:58:03 -04:00
2026-07-30 15:47:35 -07:00
2026-07-28 15:01:03 -04:00
2026-08-05 15:16:32 -07:00
2026-07-14 12:14:41 -07:00
2026-07-15 18:39:39 -04:00
2026-07-28 15:01:03 -04:00
2026-08-04 11:10:47 -07:00
2026-07-23 23:06:14 -07:00
2026-06-27 06:27:51 -07:00
2026-08-03 09:26:06 -07:00
2026-08-05 15:40:40 -07:00
2026-07-25 16:49:56 -07:00
2026-07-17 11:40:05 +00:00
2026-07-18 00:01:24 +00:00
2026-08-04 15:39:45 +00:00
2026-08-05 15:16:32 -07:00
2026-07-25 17:22:15 -07:00
2026-07-31 11:15:09 -04:00
2026-07-08 14:38:52 -07:00
2026-07-23 13:50:29 -06:00
2026-08-03 07:36:13 -04:00
2026-04-07 12:20:42 -07:00