Skip to content

google-workspace battery: writes can expose internal data through file or folder sharing #747

Closed

Description

@shvma

In marketplace/batteries/google-workspace/appa.toml (main @ af1303d, v0.37.0), create_file, copy_file and update_file require only trusted data that internal may see (L65–83):

requires = { trust = "trusted", audience = { contains = ["internal"] } }

The header of the same file says "a file's sharing never reaches the policy" (L4–5). The write rules therefore assume the target is readable by internal at most. If the target file or its folder is shared outside the organization, nothing in the policy notices.

The Limits section of the battery README and of the docs page mentions this for reads only.

In the connector's tools/list, create_file and copy_file both take a parentId. Drive gives files the sharing of their folder: "When you share a folder, all files and subfolders inside it inherit those same sharing permissions" (Google Drive Help).

Example. I worked this out from the rules and have not recorded a run.

  1. The user asks: "Summarize the diff from Linear issue X and save it to this folder: ". The folder is shared as "Anyone with the link".
  2. The agent calls mcp/linear/get_diff. The trajectory label becomes trusted + internal (linear/appa.toml L43–46).
  3. The agent calls create_file with title, textContent and parentId set to that folder. The data is trusted and its audience contains internal, so the monitor returns allow. The new file gets the folder's sharing, so anyone with the link can read the diff.

copy_file and update_file have the same rule.

So internal data ends up with readers outside internal, and no attention mark or remedy comes up on the way. share_file is guarded by google-workspace-review; the write tools are not. I read this as a limit of the contract, since the policy cannot see the target's sharing. The engine does what the rules say.

Options. Pick whichever fits the project.

  • (a) Add a line about writes to Limits in the README and on the docs page: a write can reach readers outside internal when the target file or its parent folder is shared outside the organization.
  • (b) Require a review mark on writes, as share_file does with google-workspace-review.
  • (c) Before a write, ask Drive who can read the target and check that with contains. The connector's own get_file_permissions already returns the grantee type (user, group, domain, anyone), so an annotator or context provider could fetch the same data over a trusted path.

Happy to send a PR for (a).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions