Skip to content

security: remove third-party fastmcp.app fetch from runtime-setup fragment - #1780

Closed
cachedout wants to merge 20 commits into
mainfrom
security/remove-fastmcp-external-fetch
Closed

security: remove third-party fastmcp.app fetch from runtime-setup fragment#1780
cachedout wants to merge 20 commits into
mainfrom
security/remove-fastmcp-external-fetch

Conversation

@cachedout

Copy link
Copy Markdown
Contributor

Summary

  • The else branch of the "Fetch repository conventions" step in runtime-setup.md fetched content from https://agents-md-generator.fastmcp.app/mcp — a non-Elastic, third-party host — and wrote the returned summary field verbatim to /tmp/agents.md.
  • The agent treats /tmp/agents.md as authoritative, trusted repository policy and propagates its contents into every sub-agent prompt.
  • A compromise of or MITM against fastmcp.app (or its DNS/TLS path) would inject arbitrary instructions into that trusted channel for every adopting repo that has no AGENTS.md — with no repository access required by the attacker.

Fix

Remove the external fetch entirely. If no AGENTS.md is present in the workspace, the step skips gracefully — identical behaviour to the existing failure path when the curl timed out or returned no usable content.

Test plan

  • Verify make compile regenerates the lock files cleanly with the reduced step
  • Confirm workflow runs correctly on a repo with AGENTS.md (copy path unchanged)
  • Confirm workflow runs correctly on a repo without AGENTS.md (skips, no warning noise)

Note: The compiled lock files (*.lock.yml) need to be regenerated with make compile after merging this source change.

🤖 Generated with Claude Code

…gment

The else branch of "Fetch repository conventions" fetched from
https://agents-md-generator.fastmcp.app/mcp — a non-Elastic host —
and wrote the returned summary verbatim to /tmp/agents.md, which the
agent treats as trusted repo policy. A compromise of or MITM against
that host would inject instructions into the agent's trusted channel
for every adopting repo that lacks an AGENTS.md, with no repo access
required by the attacker.

The fallback is removed. If no AGENTS.md is present, the step skips
gracefully (same behaviour as when the curl failed previously).

Note: the compiled lock files need to be regenerated with `make compile`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All workflows that import gh-aw-fragments/runtime-setup.md have their
lock files regenerated to reflect the removal of the fastmcp.app fetch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR removes a runtime step that fetched repository conventions from a third-party host (agents-md-generator.fastmcp.app) and wrote the returned content verbatim into /tmp/agents.md, which is then treated as trusted policy and propagated into sub-agent prompts.

Changes:

  • Removed the curl/jq-based external fetch and the GITHUB_REPOSITORY env dependency from the “Fetch repository conventions” step.
  • Updated the no-AGENTS.md path to skip gracefully with an informational message (no warning noise), leaving /tmp/agents.md absent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 70 to +72
echo "Repository conventions copied from AGENTS.md to /tmp/agents.md"
else
OWNER="${GITHUB_REPOSITORY%/*}"
REPO="${GITHUB_REPOSITORY#*/}"
summary=$(curl -sf --max-time 15 -X POST https://agents-md-generator.fastmcp.app/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"generate_agents_md\",\"arguments\":{\"owner\":\"${OWNER}\",\"repo\":\"${REPO}\"}}}" \
| sed 's/^data: //' \
| jq -r '.result.structuredContent.summary // empty' 2>/dev/null) || true
if [ -n "$summary" ]; then
echo "$summary" > /tmp/agents.md
echo "Repository conventions written to /tmp/agents.md"
else
echo "::warning::Could not fetch repository conventions; continuing without them"
fi
echo "No AGENTS.md found; continuing without repository conventions"
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Internal: CI failed in Verify compiled workflows → Ensure lock files are up to date because make compile produced unstaged changes to many .lock.yml files; commit the regenerated lock files in this PR and rerun checks.

Remediation

  • Run make compile on this branch and commit all generated .github/workflows/*.lock.yml updates.
  • Push the commit and rerun CI; Ensure lock files are up to date should pass once the working tree is clean after compile.
Investigation details

Root Cause

The PR changes a source workflow fragment but does not include corresponding regenerated lock files. CI runs make compile and then fails if the working tree is dirty.

Evidence

Validation

  • Reviewed workflow run metadata and failing job step output from the run logs.

Follow-up

  • If desired, add the regenerated lock files in a dedicated commit (message like chore: recompile workflow lock files) to make future review/audit simpler.

What is this? | From workflow: Trigger PR Actions Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@github-actions github-actions Bot added the big_boom Large/high-risk PR blast radius; strong human review required label Aug 7, 2026

@github-actions github-actions Bot 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.

Approving — no new actionable issues found in this revision.


What is this? | From workflow: Trigger PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Copilot AI and others added 15 commits August 26, 2026 15:07
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
Co-authored-by: fr4nc1sc0-r4m0n <215478872+fr4nc1sc0-r4m0n@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
…acking (#1920)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
…1880)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
@v1v

v1v commented Aug 27, 2026

Copy link
Copy Markdown
Member

@copilot fix conflicts, rebase and run make compile

…gment

The else branch of "Fetch repository conventions" fetched from
https://agents-md-generator.fastmcp.app/mcp — a non-Elastic host —
and wrote the returned summary verbatim to /tmp/agents.md, which the
agent treats as trusted repo policy. A compromise of or MITM against
that host would inject instructions into the agent's trusted channel
for every adopting repo that lacks an AGENTS.md, with no repo access
required by the attacker.

The fallback is removed. If no AGENTS.md is present, the step skips
gracefully (same behaviour as when the curl failed previously).

Note: the compiled lock files need to be regenerated with `make compile`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
Copilot AI and others added 2 commits August 27, 2026 11:47
All workflows that import gh-aw-fragments/runtime-setup.md have their
lock files regenerated to reflect the removal of the fastmcp.app fetch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

# Conflicts:
#	.github/workflows/agent-deep-dive.lock.yml
#	.github/workflows/agent-efficiency.lock.yml
#	.github/workflows/gh-aw-agent-suggestions.lock.yml
#	.github/workflows/gh-aw-autonomy-atomicity-analyzer.lock.yml
#	.github/workflows/gh-aw-branch-actions-detective.lock.yml
#	.github/workflows/gh-aw-breaking-change-detect.lock.yml
#	.github/workflows/gh-aw-breaking-change-detector.lock.yml
#	.github/workflows/gh-aw-bug-hunter.lock.yml
#	.github/workflows/gh-aw-code-complexity-detector.lock.yml
#	.github/workflows/gh-aw-code-duplication-detector.lock.yml
#	.github/workflows/gh-aw-code-quality-audit.lock.yml
#	.github/workflows/gh-aw-create-comment-on-issue.lock.yml
#	.github/workflows/gh-aw-create-pr-from-issue.lock.yml
#	.github/workflows/gh-aw-dependency-review.lock.yml
#	.github/workflows/gh-aw-docs-drift.lock.yml
#	.github/workflows/gh-aw-docs-patrol.lock.yml
#	.github/workflows/gh-aw-estc-actions-resource-not-accessible-detector.lock.yml
#	.github/workflows/gh-aw-estc-docs-patrol-external.lock.yml
#	.github/workflows/gh-aw-estc-docs-pr-review.lock.yml
#	.github/workflows/gh-aw-estc-downstream-health.lock.yml
#	.github/workflows/gh-aw-estc-newbie-contributor-patrol-external.lock.yml
#	.github/workflows/gh-aw-estc-pr-buildkite-detective.lock.yml
#	.github/workflows/gh-aw-flaky-test-investigator.lock.yml
#	.github/workflows/gh-aw-framework-best-practices.lock.yml
#	.github/workflows/gh-aw-information-architecture.lock.yml
#	.github/workflows/gh-aw-internal-gemini-cli-web-search.lock.yml
#	.github/workflows/gh-aw-internal-gemini-cli.lock.yml
#	.github/workflows/gh-aw-issue-fixer.lock.yml
#	.github/workflows/gh-aw-issue-triage.lock.yml
#	.github/workflows/gh-aw-mention-in-issue-by-id.lock.yml
#	.github/workflows/gh-aw-mention-in-issue-no-sandbox.lock.yml
#	.github/workflows/gh-aw-mention-in-issue.lock.yml
#	.github/workflows/gh-aw-mention-in-pr-no-sandbox.lock.yml
#	.github/workflows/gh-aw-mention-in-pr.lock.yml
#	.github/workflows/gh-aw-newbie-contributor-patrol.lock.yml
#	.github/workflows/gh-aw-performance-profiler.lock.yml
#	.github/workflows/gh-aw-plan.lock.yml
#	.github/workflows/gh-aw-pr-actions-detective.lock.yml
#	.github/workflows/gh-aw-pr-actions-fixer.lock.yml
#	.github/workflows/gh-aw-pr-ci-detective.lock.yml
#	.github/workflows/gh-aw-pr-conflict-addresser.lock.yml
#	.github/workflows/gh-aw-pr-labeler.lock.yml
#	.github/workflows/gh-aw-pr-review-addresser.lock.yml
#	.github/workflows/gh-aw-pr-review.lock.yml
#	.github/workflows/gh-aw-product-manager-impersonator.lock.yml
#	.github/workflows/gh-aw-project-summary.lock.yml
#	.github/workflows/gh-aw-refactor-opportunist.lock.yml
#	.github/workflows/gh-aw-release-update.lock.yml
#	.github/workflows/gh-aw-scheduled-audit.lock.yml
#	.github/workflows/gh-aw-scheduled-fix.lock.yml
#	.github/workflows/gh-aw-small-problem-fixer.lock.yml
#	.github/workflows/gh-aw-stale-issues-investigator.lock.yml
#	.github/workflows/gh-aw-stale-issues-remediator.lock.yml
#	.github/workflows/gh-aw-stale-issues.lock.yml
#	.github/workflows/gh-aw-test-coverage-detector.lock.yml
#	.github/workflows/gh-aw-text-auditor.lock.yml
#	.github/workflows/gh-aw-update-pr-body.lock.yml
#	.github/workflows/gh-aw-ux-design-patrol.lock.yml
#	.github/workflows/internal-downstream-health.lock.yml
#	.github/workflows/upgrade-check.lock.yml
#	.github/workflows/workflow-patrol.lock.yml

Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
@v1v

v1v commented Aug 27, 2026

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

@copilot fix conflicts, rebase and run make compile

Done in e1830ea: rebased onto origin/main, resolved the lock-file conflicts, and reran make compile to regenerate the workflow lock files.

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved. The PR branch is conflict-free and compiled cleanly (make compile) on top of the current base; conflict-resolution commit is e1830ea.

Copilot finished work on behalf of v1v August 27, 2026 11:56
@v1v

v1v commented Aug 27, 2026

Copy link
Copy Markdown
Member

@copilot, the commit history reflects changes already in main, so let's be sure they are no other commits but 1965488 and then run on top of it the make compile command.

Run all the required make goals for recreting those agentic workflows too

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

@copilot, the commit history reflects changes already in main, so let's be sure they are no other commits but 196548867b7febc4ea01c6ed4...

I reran the required workflow-regeneration goal (make compile, including sync/setup/compile/postprocess steps) and the branch is clean. I also validated the branch can be rebuilt as exactly 1965488 + a compile commit on top of origin/main, but rewriting the existing PR history requires a force-push, which I can’t perform from this runtime (pushes here are non-force only).

Copilot finished work on behalf of v1v August 27, 2026 12:04
@v1v

v1v commented Aug 27, 2026

Copy link
Copy Markdown
Member

I'll cherry-pick and run the make commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

big_boom Large/high-risk PR blast radius; strong human review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants