Repository navigation
feat(mcp): add ALLOW_EXTERNAL_ACCESS and ALLOW_PIPELINE_CHANGES policies for Cloud MCP - #1179
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1789678460-safe-mode-blocks-agents' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1789678460-safe-mode-blocks-agents'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
agents tools in Cloud safe mode
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-no-credsThe overall line coverage in commit 0b9eb06 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall line coverage in commit 0b9eb06 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytest-unitThe overall line coverage in commit 0b9eb06 in the Show a line coverage summary of the most covered files.
Updated |
agents tools in Cloud safe modeALLOW_EXTERNAL_ACCESS and ALLOW_PIPELINE_CHANGES policies for Cloud MCP
|
Devin, resolve conflicts please |
|
✅ Done. Merged |
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
|
Devin, rebuild on the release candidate trunk. |
|
👍 On it. Rebuilding this branch on |
…ies for Cloud MCP Co-Authored-By: AJ Steers <aj@airbyte.io>
0b2caf7 to
62ca2c5
Compare
Co-Authored-By: AJ Steers <aj@airbyte.io>
Done. Rebuilt on
Description updated. CI is running. |
Co-Authored-By: AJ Steers <aj@airbyte.io>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
check_cloud_connector and run_cloud_sync need correct external-access policy annotations, and external-access denial guidance should cover header narrowing.
Review effort: Lite
Findings: 1
Open (2)
Resolved since last review (1)
Co-Authored-By: AJ Steers <aj@airbyte.io>
e0ad6f5
into
release-candidate/v1


Overview
👉 TL;DR: Adds two independent on/off switches to the Cloud MCP server: one for whether an agent may reach through Airbyte into a customer's connected SaaS or warehouse, and one for whether it may change Airbyte pipelines. An explicitly declared safe mode also turns off external access as a stopgap, so locked-down deployments gain no new exposure; the unset default does not affect external access.
Specifically, this adds
AIRBYTE_CLOUD_MCP_ALLOW_EXTERNAL_ACCESS(X-MCP-Allow-External-Access) andAIRBYTE_CLOUD_MCP_ALLOW_PIPELINE_CHANGES(X-MCP-Allow-Pipeline-Changes), driven by new@mcp_tool(pipeline_change=..., external_access=...)kwargs and enforced by tool filters plusPolicyGuardMiddleware. Rebuilt onrelease-candidate/v1.Changes
@mcp_toolkwargspipeline_change: bool | None = None(defaultnot read_only) andexternal_access: bool = False, stored in an in-process_TOOL_POLICIESregistry keyed by tool name (fastmcp-extensions 0.33 rejects custom annotation keys, so they stay off the wire). Unregistered tools fall back topipeline_change = not readOnlyHint.airbyte_readonly_mode_filternow hidespipeline_changetools when pipeline changes are disabled; newairbyte_external_access_filterhidesexternal_accesstools when external access is disabled.PolicyGuardMiddlewarerejects the same calls at runtime withAirbytePipelineChangesDisabledError/AirbyteExternalAccessDisabledError(user-facing, with guidance).AirbyteSafeModeErroris now user-facing too.external_access=Trueonexecute_external_api_query,execute_external_sql_query,execute_external_search_query,get_cloud_search_status,get_agent_skill_docs(examples; tool names will change).pipeline_change=Falseonrun_cloud_syncandcancel_cloud_sync: running or cancelling a sync is not a pipeline edit.airbyte/mcp/__init__.py; unit tests for filters, middleware (incl. an in-memory client call), and decorator defaults.Review Spotlight
Reviewers with limited time, please review first:
_tool_utils.pypolicy resolution:_resolve_policy,pipeline_changes_allowed,external_access_allowed,get_tool_policy_policy_middleware.py: call-time enforcementFeature flags:
ALLOW_EXTERNAL_ACCESS,ALLOW_PIPELINE_CHANGES(default unset)Risks
AIRBYTE_CLOUD_MCP_READONLY_MODE=1now leavesrun_cloud_sync/cancel_cloud_syncavailable.AIRBYTE_CLOUD_MCP_SAFE_MODE=1explicitly (e.g. coral-agents) lose external-access tools unless they also setAIRBYTE_CLOUD_MCP_ALLOW_EXTERNAL_ACCESS=1.Follow-ups
DeprecationWarning(not in this PR).Test plan
uv run ruff format . && uv run ruff check .uv run pyrefly check airbyte/mcpuv run pytest tests/unit_tests/test_mcp_policy_middleware.py tests/unit_tests/test_mcp_tool_filters.py tests/unit_tests/test_mcp_tool_utils.py tests/unit_tests/test_mcp_cloud.py tests/unit_tests/test_mcp_guidance.py tests/unit_tests/test_mcp_tool_errors.py tests/unit_tests/test_exceptions.py -qLink to Devin session: https://app.devin.ai/sessions/48a4f92f26b9488b802f9eef9c49b608
Open in Devin Desktop: https://app.devin.ai/desktop/session/48a4f92f26b9488b802f9eef9c49b608?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)