Skip to content

Writing changes

Every change the plugin owns is one dry-run plan and one commit of the same class. The plan writes nothing; it shows what the commit would send or write, and returns a single-use planId. The commit takes only that id.

The six classes

Class Plan Commit What it reaches
write plan_write write creates or updates a document, a sheet, a file, an event, a task or another record
send plan_send send sends a message or a reaction in Chat, or comments on an approval
share plan_share share a Drive permission, a calendar ACL entry, a Chat member or a delegate
delete plan_delete delete deletes a message, a file, a calendar, a list entry or another record
export plan_export export copies provider data out to a file
admin plan_admin admin an admin-class operation, with a reason

A plan refuses an operation of another class and names the plan to use. A commit refuses a plan of another class, and takes no account: the register runs it as the account the plan recorded.

What the preview shows

  • the redacted command, with no token and no URL query string;
  • the recipients a send or a share reaches;
  • the destination of an export;
  • Google's dry-run answer.

The preview is the answer the person confirms, so it carries everything the commit will write. Private plan data holds only what the preview cannot show: the exact commit argv, the staged uploads and the account.

The commit

  1. The register mints the public planId and stores the plan for policy.planTtlSeconds (15 minutes by default).
  2. The commit checks its own permission gate, re-reads the recipients and refuses one that was added after the preview.
  3. The commit is made once. A second use is PLAN_USED; an expired plan or another class's tool is PLAN_INVALID.
  4. The handler audits the outcome and emits rpc.gws.changed when a declared source changed.

In an agent session, a change asks through OpenCode's permission rules. Over RPC, an allow rule is not a confirmation: the call needs an answered ask, and a saved "Always allow" from a tool call never confirms an RPC write.

Google's Gmail tools are not in this flow

Google's Gmail MCP server owns its mailbox actions. The manifest gives each tool its class and effect: "ask", so the plugin's access level still decides, and Google's own form elicitation is the confirmation. The plugin's own read, plan_write, plan_send and plan_delete refuse a Gmail operation the server covers and name the tool that replaces it. plan_export and plan_admin keep those operations, because an export to a file and an admin audit are acts the server does not offer.

The mail actions

A client that shows the attention feed calls gws.mail.reply or gws.mail.archive through the contract's action route. Each is a preview and then a commit, as a plan and its commit are, but the pair is its own: the action's input is one thread (and, for a reply, the person's text), not a provider operation.

  • plan_reply_mail reads the thread's newest message, takes the recipients from the policy's own resolution for the reply, names the subject and plans the gmail.reply helper through the same pipeline: the policy, the dry run and the audit. The confirmation lists up to twenty recipients and its change sentence counts any more. reply_mail sends that plan.
  • plan_archive_mail names the thread, its subject and its sender, and plans gmail.users.threads.modify with the inbox label removed. archive_mail runs that plan.

Both commits are denied to agents (effect: "deny"): the action route is the client's door, and an agent's Gmail changes stay Google's Gmail MCP tools. The register still requires the person's confirmation on every commit grant.

Policy

policy is deny-only: rules constrain services, categories, operations, recipients, public sharing, file roots and page sizes. The admin gate is separate, with admin.enabled, admin.allowedServices and a required reason on every admin plan. No rule widens access. Security has the full model; Configuration has every option.