Refuse stateful ADB tools unless explicitly allowed#121
Merged
Conversation
The ADB transport executed manifest-flagged confirmation tools (tap, type, clipboard, open-url) with no gate, so any MCP client could drive the device with full input injection. Load each tool's confirmation level from the runtime manifest and refuse state-changing tools by default, with OPENPHONE_ADB_ALLOW_STATEFUL=1 or allowStateful: true as the explicit per-session opt-in. Dry-run precedence is unchanged. Closes #66 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
confirmationlevel fromruntime/protocol/openphone-commands.jsonand refuses state-changing tools (tap, type, clipboard, open-url, send, etc.) by default with a clearstateful_tool_refusederror explaining how to opt in, since ADB has no on-device confirmation UI.OPENPHONE_ADB_ALLOW_STATEFUL=1env var orallowStateful: trueconstructor option (mirroringdryRun). An explicit option overrides the environment.OPENPHONE_DRY_RUNkeeps precedence: nothing executes in dry-run, even with the opt-in.OPENPHONE_DRY_RUNas the safe exploration default andOPENPHONE_ADB_ALLOW_STATEFULfor real device driving in the MCP server README; synced the packaged transport copies inintegrations/cliandintegrations/mcp-server.tests/integrations/adb-stateful-gating-contract.mjs(refused by default, env/option opt-in, option-over-env, dry-run precedence, read-only tools unaffected) and wired it intoscripts/check-runtime-protocol.shandscripts/check.sh.Test plan
node tests/integrations/adb-stateful-gating-contract.mjs./scripts/check-runtime-protocol.sh./scripts/check.shCloses #66
🤖 Generated with Claude Code