-
Notifications
You must be signed in to change notification settings - Fork 0
Security Model
⚠️ Read this before enablingpeerPermissions: "allow"on a shared machine.
Same-machine, same-user trust: any process running as your user can read the registry files and therefore talk to your instances' inboxes. The bearer token protects against other users and accidental connections, not against a malicious process with your UID. This matches the trust level of Claude Code's local IPC.
A peer message is untrusted input to the model, exactly like text pasted by a user. Plain text cannot transfer:
- Files or attachments
- Conversation history
- Consent or authorization
- Executable slash commands
With the default peerPermissions: "allow", ordinary tool requests raised during peer-triggered turns are auto-approved. This enables unattended operation but requires trust.
- Plugin listens for
permission.asked/permission.v2.askedbus events - Walks from the event's
tool.messageID(v2:source.messageID) up theparentIDchain - If the walk reaches an injected user message (parts carry
metadata.peerMessage: true), the turn is peer-triggered - Auto-replies
"once"(allow) or"reject"(deny) per thepeerPermissionsoption - Permission requests from your own typed turns get no reply → fall through to opencode's normal prompt flow
Even in allow mode, the plugin withholds auto-approval for requests that mention:
- Permission configuration files
AGENTS.md- Credentials/secrets files (
.env,.npmrc,.netrc,.kube,.docker) - Shell startup files (
.bashrc,.zshrc,.gitconfig) - macOS LaunchAgents, crontab
This is a best-effort text match, not a security boundary. A cleverly phrased request can avoid naming those paths (e.g. npm config set x y writes ~/.npmrc without showing the path).
OpenCode's native deny rules, plugin permission configuration, and AGENTS.md restrictions are evaluated by OpenCode itself and always take precedence over the plugin's auto-approval.
| Mode | Behavior | Use case |
|---|---|---|
"allow" (default) |
Auto-approve ordinary requests; withhold protected categories | Trusted solo workstation |
"ask" |
Leave native prompts untouched for peer turns | Collaborative but cautious |
"deny" |
Reject all peer-triggered permission requests | Lockdown / CI |
| Policy | Behavior |
|---|---|
"accept" (default) |
Deliver immediately |
"auto" |
Accept same-directory peers; hold cross-directory |
"hold" |
Park in /peers-inbox for manual review |
"refuse" |
Reject all inbound messages |
-
Solo workstation: defaults (
accept+allow) are fine -
Shared workstation: use
holdorautofor inbound; useaskfor permissions -
Sensitive codebase: use
holdfor inbound; useaskordenyfor permissions -
CI/CD: use
refuse+denyto effectively disable peer messaging
Messages carry a via hop list. Chains longer than 4 hops are rejected, preventing infinite relay loops between cooperative sessions.