buzz icon indicating copy to clipboard operation
buzz copied to clipboard

owner_only channel-add policy has no admin override, and the rejection doesn't say who can act — intended?

Open jdrolls opened this issue 4 months ago • 1 comments

Question / design clarification

With channel_add_policy = owner_only, a community owner/admin cannot add the agent to a channel — only the agent's NIP-OA owner can. Is that intended? And if so, can the rejection say who can act?

Where (verified on main @ ac4fa13, 2026-08-01)

crates/buzz-relay/src/handlers/side_effects.rs:421-434 — the kind:9000 third-party-add path checks the target's policy and requires actor_bytes == owner_bytes, with no elevated-role bypass, even though the surrounding code has already computed the actor's role and applies elevated-role checks for other operations.

Observed

relay error 400: invalid: policy:owner_only — only the agent owner can add this agent

…returned to a relay/community owner attempting to add a bot to a private channel.

Why this may be intended

Agent sovereignty: the entity that vouched for an agent decides where it participates, and an admin shouldn't be able to conscript someone else's agent into a channel. If that's the reasoning, it's a defensible line — it just isn't stated anywhere.

Why it's worth revisiting

  • An admin cannot remediate an agent whose owner key is unavailable — there is no break-glass.
  • The error names the policy but not the actor who can satisfy it (the owner pubkey is known at rejection time), which makes it hard to act on.
  • Operationally it forces owner-key signing into provisioning automation that may otherwise never need the human key online.

Suggested outcomes (any one of these resolves it)

  1. Confirm intended and improve the message: include the required owner pubkey in the error.
  2. Allow community owners (not admins) as a documented, audited break-glass.
  3. Add an explicit "owner delegates channel management to admins" flag on the kind:10100 policy record.

Environment

Self-hosted relay, ghcr.io/block/buzz:main @ sha256:13ddb4c12f4c0b8147cece717a57013a45fdb1610bd072d7e383ac79a070ddd9, require_relay_membership = true, allow_nip_oa_auth = true; Ubuntu 24.04.

Related issues

Searched open and closed — none found. Closest by keyword, but different problems: #3663 (set-add-policy clobbers the kind:10100 record), #3277 (mentionability of managed agents). Note: in our deployment this policy interacts with #4223 (NIP-OA owner never recorded on closed relays for direct members), which turns owner_only from "restrictive" into "nobody can ever satisfy it."

jdrolls avatar Aug 02 '26 01:08 jdrolls

Shipped: https://github.com/block/buzz/pull/4264

policy:owner_only — only the agent owner (<hex-pubkey>) can add this agent — the rejection now names which key is authorized instead of just saying "the agent owner". Unit-tested via a pure helper, the existing kind:9000 e2e gate is strengthened to require the actor-naming, and policy:owner_only remains the stable downstream tag.

iroiro147 avatar Aug 02 '26 06:08 iroiro147