fix(mcp): neutralize agent-visible tool metadata - #340
Merged
Conversation
There was a problem hiding this comment.
1 issue found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/agent-metadata-policy.mjs">
<violation number="1" location="scripts/agent-metadata-policy.mjs:10">
P2: Neutral operational descriptions using `over` as a transport preposition are rejected as native-tool displacement when both names occur. Restrict `over` to a comparison involving the native/built-in tool instead of treating every occurrence as displacement.</violation>
</file>
Tip: instead of fixing issues one by one fix them all with cubic
Re-trigger cubic
| '\\b(?:us(?:e|es|ed|ing)|choos(?:e|es|ing|en)|select(?:s|ed|ing)?|call(?:s|ed|ing)?|invok(?:e|es|ed|ing)|rout(?:e|es|ed|ing)|prioriti[sz](?:e|es|ed|ing)|prefer(?:s|red|ring)?|default\\s+to)\\b'; | ||
| const MANDATORY = | ||
| '\\b(?:must|mandatory|required|always|only|need(?:s)?\\s+to|have\\s+to)\\b'; | ||
| const DISPLACEMENT = |
There was a problem hiding this comment.
P2: Neutral operational descriptions using over as a transport preposition are rejected as native-tool displacement when both names occur. Restrict over to a comparison involving the native/built-in tool instead of treating every occurrence as displacement.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/agent-metadata-policy.mjs, line 10:
<comment>Neutral operational descriptions using `over` as a transport preposition are rejected as native-tool displacement when both names occur. Restrict `over` to a comparison involving the native/built-in tool instead of treating every occurrence as displacement.</comment>
<file context>
@@ -0,0 +1,306 @@
+ '\\b(?:us(?:e|es|ed|ing)|choos(?:e|es|ing|en)|select(?:s|ed|ing)?|call(?:s|ed|ing)?|invok(?:e|es|ed|ing)|rout(?:e|es|ed|ing)|prioriti[sz](?:e|es|ed|ing)|prefer(?:s|red|ring)?|default\\s+to)\\b';
+const MANDATORY =
+ '\\b(?:must|mandatory|required|always|only|need(?:s)?\\s+to|have\\s+to)\\b';
+const DISPLACEMENT =
+ '\\b(?:instead\\s+of|rather\\s+than|over|in\\s+preference\\s+to|replace(?:s|d|ment|ing)?|substitut(?:e|es|ed|ing|ion)?|supersede(?:s|d|ing)?|take(?:s)?\\s+precedence(?:\\s+over)?|prioriti[sz]e|choose|select|prefer)\\b';
+const NEGATED_NATIVE_SELECTION =
</file context>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Marks the neutral-metadata surface with a distinct version and syncs the stale server.json top-level version (3.7.5) with the package. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
erikengervall
approved these changes
Jul 29, 2026
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.
OpenAI remediation scope
This is a focused, compatibility-preserving remediation for the OpenAI tool-metadata review. It keeps all existing MCP tool names, schemas, routes, and the full
/v2/mcptool surface unchanged. It removes promotional/comparative, native-tool-displacing, and coercive routing language from the renderedinitializeinstructions and tool descriptions, replacing it with neutral operation boundaries: what the tool does, when it applies, side effects, and what it returns.It intentionally does not include the selector/
alwaysLoadwork from #337 and does not modify that PR.Final v3 lineage and behavior
c090912->ca2b689->a4221e8(not the historical branch wholesale).2c6b9cathroughd0f57f6: it blocks promotion/comparison, Firecrawl-vs-native displacement, always/default coercion, critical mandatory routing, and feedback-for-credit/refund inducement (including split-sentence forms); it permits neutral operational terms such asbest for,not recommended, accounting fields, and critical status.AX R02: immutable hosted-MCP confirmation
The candidate was evaluated against the production-baseline hosted-MCP state in EXP-032 R02:
z5rhuwx4dcfg3zajn5o8; dispatch reached 100 concurrent physical E2B sandboxes. Per-trace initialized/tools-list state matched the frozen condition fingerprint.scoped_equivalent. Candidate minus baseline task success: +2.78pp; preregistered 90% bootstrap CI [0.00pp, +5.56pp], wholly within the ±10pp equivalence margin.Evidence bindings
607ee86944d6b1fdb7ea621d27cf1a1f33f83310697e1cb57d103bfa4df44ee212578212de0cec00064ac426d844f477689e77bccb0e09d93a75552ed40813ed2ee805f18ecf85a57569dd8ebe62528bf70da47e7ee5a2700346de3ce9595a33ca05d2067748b6329d50667223062736bd2678e3fc45840a3947e863d904a9ed51f2fe37f6bdf2fbf128079470cb8716f1f57a706027249719770c7d8497d41dc1894a7dcb10fe35696527053e2cbbf24c2710056e1e036c4357f15e0fc2a530Disclosure
R02 had four Codex traces whose actual model cost exceeded the original
$1per-trace acceptance cap: C04 baseline r0, C04 baseline r1, C04 v3 r1, and B16 baseline r2. The runner records these as scoreable policy failures, not missing/provenance-invalid traces; all 360 raw trace identities, pairs, and fingerprints remained complete. They are included in the formal outcome. A preflight-invalid R01 is explicitly excluded from this evidence.Validation
pnpm run buildnode --test tests/agent-metadata-policy.test.mjs tests/mcp-smoke.test.mjs tests/mcp-search-profile.test.mjs(50 passing)pnpm run lintgit diff --checkReview
Code review: APPROVE. Nonblocking P2 follow-up: persist the baked-template verifier JSON directly in raw trace documents; current persisted state fingerprints already provide equivalent R02 integrity evidence, so this does not require a rerun.
Additional nonblocking code-review follow-up:
firecrawl_interactaccurately discloses that form submission can persist, while its pre-existingdestructiveHint: falseannotation remains inconsistent. Correct that annotation in a separate safety-focused change before general marketplace resubmission; it is outside this neutral-copy remediation.