[RSM] AI Agent Access toggle for Jetpack Search dashboard#48362
[RSM] AI Agent Access toggle for Jetpack Search dashboard#48362kat3samsin wants to merge 14 commits intotrunkfrom
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 6 files. Only the first 5 are listed here.
1 file is newly checked for coverage.
|
7f32693 to
e4dee7c
Compare
iamchughmayank
left a comment
There was a problem hiding this comment.
Tested well against wpcom trunk
cb8240e to
335c3e3
Compare
Mirrors the Reader Chat toggle pattern from github.com//pull/48144. Lets site owners opt in to allowing WordPress.com-authenticated AI assistants (Claude, ChatGPT, etc.) to answer reader questions using the blog's posts and Content Guidelines. The toggle reads/writes `jetpack_ai_agents_enabled` via /wp/v2/settings. On Atomic/wpcom-hosted sites, an update_option action listener on the wpcom side mirrors the change to the `ai-agents-enabled` blog sticker so the wpcom-mcp BlogStickerOptedInMiddleware (in github.a8c.com/Automattic/wpcom branch add/jetpack-ai-agents-opt-in) can gate ability access in O(1) sticker checks. Related PRs: - wpcom: github.a8c.com/Automattic/wpcom/pull/<TBD> (BlogStickerOptedInMiddleware + sticker mirror) - wpcom: github.a8c.com/Automattic/wpcom/pull/212419 (the underlying jetpack/search-voice ability)
335c3e3 to
96a9c2a
Compare
Fixes RSM
Proposed changes
jetpack_ai_agents_enabledoption for/wp/v2/settingsso site owners can opt in/out.jetpack_ai_agents_enabledto the Jetpack Sync options whitelist so the setting can propagate to WordPress.com permission checks.jetpack/search-voiceMCP ability under Developer & testing in the Jetpack MCP settings UI.Related product discussion/links
Does this pull request change what data or activity we track or use?
Yes. This PR adds an explicit site-owner opt-in that controls whether WordPress.com-authenticated AI assistants may answer reader questions using the site's posts and Content Guidelines via the
jetpack/search-voiceMCP ability.It also records
jetpack_search_ai_agent_access_togglewhen the Search dashboard toggle successfully changes state. The event includesenabled,previous_enabled,is_wpcom, andsurface: jetpack_search_dashboard. It does not include site content, queries, search results, or guidelines.On Atomic/WordPress.com-hosted sites, the companion wpcom PR mirrors the local
jetpack_ai_agents_enabledoption to theai-agents-enabledblog sticker used by the MCP ability gate. For self-hosted Jetpack sites, the option is added to Jetpack Sync's whitelist so the local toggle and WordPress.com permission gate can stay aligned.Testing instructions
Automated tests
pnpm run test-gui -- _inc/client/ai/mcp/test/component.jsfromprojects/plugins/jetpack.pnpm run test-js -- src/dashboard/components/ai-agent-access-control/test/index.test.jsxfromprojects/packages/search.PORT_SMTP=1025 pnpm exec jetpack docker phpunit jetpack -- --filter=AI_Assistant_Plugin_Testfrom the monorepo root.Steps to test
Follow instructions in WPCOM PR 214186