Repository navigation
fix(mcp): reject path-like manifest_yaml when trusted execution is off - #1373
Aaron ("AJ") Steers (aaronsteers) wants to merge 2 commits into
Conversation
Co-Authored-By: AJ Steers <aj@airbyte.io>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 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/1791942838-hosted-manifest-path-guard' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791942838-hosted-manifest-path-guard'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. |
There was a problem hiding this comment.
🟡 Changes recommended
The MCP tool schemas still describe the old behavior and contradict the new validation.
1 open finding
What changed in this PR
Adds early validation for path-like manifest strings in untrusted MCP execution.
Changes:
- Detects common manifest path patterns.
- Raises actionable input errors for untrusted paths.
- Updates resolver tests for the new behavior.
| File | Description |
|---|---|
airbyte/mcp/_arg_resolvers.py |
Adds path detection and rejection. |
tests/unit_tests/test_mcp_trusted_execution.py |
Tests untrusted path rejection. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: AJ Steers <aj@airbyte.io>
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-no-credsThe overall line coverage in commit 8df6d69 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall line coverage in commit 8df6d69 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytest-unitThe overall line coverage in commit 8df6d69 in the Show a line coverage summary of the most covered files.
Updated |
|
Devin, I think this has already been superseded. Please confirm and close this PR if so. |

Summary
resolve_manifest_yamlraisesAirbyteLibInputErrorfor a single-line, path-shapedmanifest_yamlwhen trusted execution is off, with guidance to pass the manifest content inlinepublish_custom_source_definitionreceived client-local paths (e.g./private/tmp/.../bill_manifest.yaml) and failed later with "Manifest must be a dictionary", which doesn't tell the agent that the server can't read its filesChanges
_looks_like_file_path(value)inairbyte/mcp/_arg_resolvers.py: true when the value ends in.yaml/.yml/.json(any case) or starts with/,~,./,../.resolve_manifest_yaml:Pathinputs (stillAirbyteTrustedExecutionRequiredError), and trusted-mode string paths.Review Spotlight
Behavior change in untrusted mode: path-like single-line strings used to pass through as "inline YAML" and fail downstream; now they fail fast. Two existing tests asserted the old pass-through and were updated:
test_resolve_manifest_yaml_preserves_inline_values_when_untrusted: the single-line case is nownot-a-manifest.test_resolve_manifest_yaml_does_not_read_file_when_untrusted: asserts the error and that file content isn't echoed.Test plan
ruff check/ruff format: clean.pytest tests/unit_tests/test_mcp_trusted_execution.py test_mcp_cloud.py test_mcp_tool_errors.py: 322 passed, including the new parametrizedtest_resolve_manifest_yaml_rejects_path_like_text_when_untrusted.Link to Devin session: https://app.devin.ai/sessions/8fbdc1e4380941958b0bed24914614f2
Open in Devin Desktop: https://app.devin.ai/desktop/session/8fbdc1e4380941958b0bed24914614f2?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)