Skip to content

fix(mcp): reject path-like manifest_yaml when trusted execution is off - #1373

Closed
Aaron ("AJ") Steers (aaronsteers) wants to merge 2 commits into
release-candidate/v1from
devin/1791942838-hosted-manifest-path-guard
Closed

Aaron ("AJ") Steers (aaronsteers) wants to merge 2 commits into
release-candidate/v1from
devin/1791942838-hosted-manifest-path-guard

Conversation

@aaronsteers

Copy link
Copy Markdown
Member

Summary

What resolve_manifest_yaml raises AirbyteLibInputError for a single-line, path-shaped manifest_yaml when trusted execution is off, with guidance to pass the manifest content inline
Why Hosted publish_custom_source_definition received 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 files

Changes

  1. New _looks_like_file_path(value) in airbyte/mcp/_arg_resolvers.py: true when the value ends in .yaml / .yml / .json (any case) or starts with /, ~, ./, ../.
  2. In the untrusted branch of resolve_manifest_yaml:
    if _looks_like_file_path(manifest_yaml):
        raise AirbyteLibInputError(
            message="`manifest_yaml` looks like a file path, which this server cannot read.",
            guidance="... cannot read local files. Pass the manifest content inline ...",
        )
  3. Unchanged: multiline YAML, single-line inline JSON, Path inputs (still AirbyteTrustedExecutionRequiredError), 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 now not-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 parametrized test_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)

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This PyAirbyte Version

You 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 Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
📚 Show Repo Guidance

Helpful Resources

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread airbyte/mcp/_arg_resolvers.py
@github-code-quality

github-code-quality Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Python

Python / code-coverage/pytest-no-creds

The overall line coverage in commit 8df6d69 in the devin/1791942838-hos... branch is 79%. The line coverage in commit d9f652f in the release-candidate/v1 branch is 65%.

Show a line coverage summary of the most impacted files.
File release-candidate/v1 d9f652f devin/1791942838-hos... 8df6d69 +/-
airbyte/mcp/cloud.py 52% 83% +31%
airbyte/_util/api_util.py 36% 68% +32%
airbyte/cloud/connectors.py 34% 75% +41%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/_user_identity.py 0% 93% +93%
airbyte/_direct...ctors/models.py 0% 94% +94%
airbyte/mcp/_telemetry.py 0% 94% +94%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 97% +97%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest

The overall line coverage in commit 8df6d69 in the devin/1791942838-hos... branch is 81%. The line coverage in commit d9f652f in the release-candidate/v1 branch is 71%.

Show a line coverage summary of the most impacted files.
File release-candidate/v1 d9f652f devin/1791942838-hos... 8df6d69 +/-
airbyte/cloud/connectors.py 51% 80% +29%
airbyte/mcp/cloud.py 52% 83% +31%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/mcp/_user_identity.py 0% 93% +93%
airbyte/_direct...ctors/models.py 0% 94% +94%
airbyte/mcp/_telemetry.py 0% 94% +94%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 97% +97%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest-unit

The overall line coverage in commit 8df6d69 in the devin/1791942838-hos... branch is 76%. Line coverage data for the release-candidate/v1 branch is not yet available.

Show a line coverage summary of the most covered files.
File release-candidate/v1 devin/1791942838-hos... 8df6d69 +/-
airbyte/cloud/models.py — 97% —
airbyte/mcp/_sso_auth.py — 96% —
airbyte/_direct...ctors/models.py — 94% —
airbyte/cloud/client.py — 90% —
airbyte/exceptions.py — 89% —
airbyte/mcp/cloud.py — 83% —
airbyte/progress.py — 80% —
airbyte/cloud/connectors.py — 75% —
airbyte/_util/api_util.py — 68% —
airbyte/shared/...ql_processor.py — 68% —

Updated October 14, 2026 02:13 UTC

@aaronsteers

Copy link
Copy Markdown
Member Author

Devin, I think this has already been superseded. Please confirm and close this PR if so.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

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.

2 participants