Skip to content

fix(mcp): declare tool annotations and audit discovery subprocesses (#72) - #95

Merged
OBenner merged 1 commit into
mainfrom
fix/72-tool-annotations
Nov 16, 2026
Merged

OBenner merged 1 commit into
mainfrom
fix/72-tool-annotations

Conversation

@OBenner

@OBenner OBenner commented Nov 16, 2026

Copy link
Copy Markdown
Owner

All six participant MCP tools previously omitted effect annotations. They now expose explicit boolean readOnlyHint, destructiveHint, idempotentHint and openWorldHint values through the SDK's tools/list response; the integration test pins every entry.

List/inbox/wait are reads over the configured project's roster/mailbox. Send/reply append messages and conservatively declare open-world interaction because delivery can reach another participant's host chat. Their idempotency hint is qualified by the existing seven-day key/dedup window in the tool descriptions. Ack is conservatively marked destructive because it changes existing delivery state/unread visibility and enables retention; it remains idempotent. Hints do not change authorization, input schemas, or Synloq v1.

The three M8ven-reported shell-out sites were audited at the actual Node boundary:

  • Kimi Work status discovery: retain the host CLI for live endpoint/auth discovery; executable/config/CLI values are separate argv, with a 5-second timeout and 1 MiB cap.
  • OpenCode PATH locator: retain fixed where/which + literal opencode; a replacement would reimplement platform PATH/PATHEXT behavior without resolving executable trust.
  • OpenCode service info: retain the CLI because the SDK requires the URL this step discovers; fixed api get /api/info argv, 10-second timeout and 1 MiB cap.

All three already used execFile, not shell command strings. Both wrappers now explicitly set shell: false; native-boundary tests cover literal metacharacter paths, overrides, both locator platforms, bounds and sanitized errors. No new dependency or host API replacement. The audit also inventories the newer Codex queue wrapper and optional probe scripts, documenting local environment/PATH/executable provenance as a remaining trust boundary.

Evidence and rationale: docs/security/2026-11-16-tool-annotations-shell-outs.md. CTO confirmed that issue #72 contains the available M8ven findings; there is no separate report file. External catalog acceptance and the claimed directory rejection policy were not independently tested. No live host probes or external M8ven contact were performed.

Validation: initial tools/list regression failed because all six annotations were absent; final full pnpm verify after rebasing on main a0e57ed passes 107 test files / 923 tests, including six new cases, plus formatting, import check, typecheck and build. Existing behavior/security tests remain unchanged.

Fixes #72. Review: dev → CTO.

@OBenner

OBenner commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

Review (dev) — ACCEPT

Reviewed the full diff locally before the push (preliminary ACCEPT) and re-verified the published PR — identical after the clean rebase onto a0e57ed.

Tool annotations. All six tools publish the four boolean hints; the matrix is conservative and each non-obvious choice is documented in-code: reads T/F/T/F; send/reply F/F/T/T with openWorldHint: true (delivery can reach other host chats) and the 7-day idempotency window spelled out in the description; ack F/T/T/F with destructiveHint: true justified by state/unread-visibility change and retention eligibility. The SDK tools/list regression (undefined → declared) pins the behavior. Hints are advisory only — authorization stays with the relay; no v1/auth/input-schema changes.

Shell-out audit (M8ven). All three sites reviewed per-site: they are execFile(argv) with separate executable/argv — now with an explicit shell: false and a comment forbidding manual quoting. Existing time/output caps and sanitized failures preserved; five native-boundary tests cover metacharacter paths as literal argv, env overrides, Win/POSIX locators and sanitized errors. The security doc records the per-site inventory, the keep/change rationale, and the residual trust boundary honestly (local PATH/env/executable trust is not eliminated — correctly not claimed).

Verified independently: 24/24 targeted tests in a detached review worktree; author's full verify 107 files / 923 tests; CI 3/3 on a003225.

Passing to CTO for final.

@OBenner
OBenner merged commit 723dd27 into main Nov 16, 2026
3 checks passed
@OBenner
OBenner deleted the fix/72-tool-annotations branch November 16, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Tool annotations (MCP hints) for all 6 tools + audit shell-outs (M8ven findings)

1 participant