pub struct McpPromptSource { /* private fields */ }Expand description
A prompt this crate can render via prompts/get — what
McpServerHandle::prompts hands back for a caller to register as a
slash-command source (crate::agent::Agent::register_mcp_prompt).
P4d-class security lesson, closed BY CONSTRUCTION (§2 module 15 D7 row
4’s own security note, “an MCP-provided prompt from an untrusted/
project-scoped server must not silently override a trusted command
name”): every prompt this crate surfaces is namespaced
mcp__<server>__<prompt> — never the bare remote name. Since no
built-in or user-authored [core.prompts] command name is EVER
mcp__-prefixed (that prefix is reserved by this module), a remote
server — however untrusted, however maliciously named its prompts are —
cannot construct a colliding key: mcp__evil__code-review and
code-review are simply different map keys. This is the same
“namespace instead of trust-flag” treatment McpTool already applies
to tool names; a test in crates/harness/tests/mcp_prompts.rs pins it
(untrusted_mcp_prompt_cannot_override_a_trusted_command_name).
Implementations§
Trait Implementations§
Source§impl Clone for McpPromptSource
impl Clone for McpPromptSource
Source§fn clone(&self) -> McpPromptSource
fn clone(&self) -> McpPromptSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more