Repository navigation
DEV-5902: Harden ctx for untrusted transcript analysis - #1
Merged
ytspar merged 4 commits intoJul 10, 2026
Merged
Conversation
ytspar
deleted the
feature/DEV-5902-harden-ctx-for-untrusted-transcript-analysis
branch
July 11, 2026 17:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Simple Description
This hardens the public Enrich Layer fork of ctx for analyzing untrusted agent transcripts. It makes networked and executable behavior opt-in, limits default search and MCP access to a validated Git worktree, and clearly marks transcript-derived output as untrusted data. It also closes upgrade, model-cache, export, and MCP-configuration trust gaps found during adversarial review.
Closes DEV-5902.
What Changed
Why This Change
The upstream tool indexes highly sensitive local transcripts and is intended to be called by agents that may encounter prompt-injection payloads inside those transcripts. Its prior defaults could send analytics, check/apply upgrades, acquire models, execute plugins, expose cross-workspace data, or present transcript text without a strong trust label. This fork needs a fail-closed local-analysis posture before it is suitable for Enrich Layer use. See DEV-5902.
Alternatives Considered
Testing Instructions
TMPDIR=/private/tmp cargo test --workspace -- --test-threads=1.cargo clippy --workspace --all-targets --locked -- -D warnings -A dead-code.bash scripts/check-docs.shandgit diff --check.ctx search --help,ctx mcp serve --help, and the new security documentation.Expected Result: All tests and checks pass. Search fails closed outside a Git worktree unless
--all-workspacesis explicit; scoped MCP exposes only status/search; networked and plugin behavior remains disabled by default.Loom Video (if applicable): Not applicable; no UI changes.
AI observations
The adversarial review ran multiple focused passes and found boundary bypasses in synthetic scope markers, custom data-root plugin execution, semantic cache verification/use, legacy MCP migration, and a debug-only all-workspaces hook. Each finding was fixed with regression coverage; the final focused re-review returned PASS. The PR-template guard rejected the initial non-template body, so this description was rewritten into the required review structure.
Additional Context
Residual boundaries are explicit:
show,locate, and read-only SQL remain broader capabilities; scoped MCP intentionally excludes themThe changed diff passed
gitleaks. Strict clippy is clean with only the repository's existing macOS platform-gated dead-code category allowed.Checklist