Skip to content

Restore MCP secret chat guardrails - #485

Merged
kentcdodds merged 2 commits into
mainfrom
cursor/restore-secret-chat-guardrails-cb08
May 15, 2026
Merged

kentcdodds merged 2 commits into
mainfrom
cursor/restore-secret-chat-guardrails-cb08

Conversation

@kentcdodds

@kentcdodds kentcdodds commented May 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Restores explicit MCP guidance to never ask users to paste secrets, tokens, API keys, passwords, or credentials into chat.
  • Keeps the capability-level guardrail centralized in the secrets domain description instead of repeating it on every secret capability.

Testing

  • npx vitest run --project node-unit packages/worker/src/mcp/server-instructions.node.test.ts packages/worker/src/mcp/tools/execute.node.test.ts packages/worker/src/mcp/tools/open-generated-ui.node.test.ts
  • npm run format:check
  • Earlier before the test deletion cleanup: npm run validate
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Documentation
    • Enhanced security guidance clarifying that users should never be asked to paste secrets, tokens, API keys, passwords, or credentials into chat.
    • Clarified proper credential handling procedures using designated connection pages for OAuth and API key integrations.

Review Change Stack

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented May 15, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e1978cb6-b7a3-48ca-b6a9-2acd3545cb78

📥 Commits

Reviewing files that changed from the base of the PR and between 4056143 and 77ba5c7.

📒 Files selected for processing (4)
  • packages/worker/src/mcp/capabilities/secrets/domain.ts
  • packages/worker/src/mcp/server-instructions.ts
  • packages/worker/src/mcp/tools/execute.ts
  • packages/worker/src/mcp/tools/open-generated-ui.ts

📝 Walkthrough

Walkthrough

This PR adds explicit credential-handling safety instructions across the MCP layer. It updates the secrets domain definition, server-wide conventions, and tool descriptions to consistently prohibit users from pasting raw secrets/tokens/API keys into chat and directs them to use dedicated credential endpoints instead.

Changes

MCP Credential Safety Guidance

Layer / File(s) Summary
Core domain and server-wide conventions
packages/worker/src/mcp/capabilities/secrets/domain.ts, packages/worker/src/mcp/server-instructions.ts
The secretsDomain description and MCP server instruction conventions both add explicit text forbidding users from pasting secrets/tokens/credentials into chat and directing credential setup through standard connect pages.
Tool-specific credential handling guidance
packages/worker/src/mcp/tools/execute.ts, packages/worker/src/mcp/tools/open-generated-ui.ts
Execute and open_generated_ui tool descriptions are updated to clarify credential handling: OAuth uses /connect/oauth, API keys/PATs use /connect/secret, and users must never be asked to paste secrets into chat.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • kentcdodds/kody#232: Updates MCP credential guidance text and adjusts flow options for /connect/secret vs secret_backed_integration credential handling.
  • kentcdodds/kody#476: Also edits server-instructions.ts and execute tool descriptions to surface MCP integration guidance, overlapping with credential and instruction text surfaces.
  • kentcdodds/kody#103: Updates the execute tool description text for argument handling and metadata context.

Poem

🐰 A careful guard against the hasty paste,
Keep secrets safe, not shared in haste,
Connect via OAuth, via /secret too,
We whisper: never ask users to spill what's true!
✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Restore MCP secret chat guardrails' clearly and specifically summarizes the main objective of the pull request, which is to restore security guardrails preventing users from pasting secrets into chat.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/restore-secret-chat-guardrails-cb08

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kentcdodds
kentcdodds marked this pull request as ready for review May 15, 2026 21:22
@github-actions

github-actions Bot commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-485.kentcdodds.workers.dev

Worker: kody-pr-485
D1: kody-pr-485-db
KV: kody-pr-485-oauth-kv

Mocks:

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kentcdodds
kentcdodds merged commit f21518f into main May 15, 2026
5 of 6 checks passed
@kentcdodds
kentcdodds deleted the cursor/restore-secret-chat-guardrails-cb08 branch May 15, 2026 21:51
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