Skip to content

MCP Safety Boundaries

MCP servers often connect to real systems, so safety design must come before feature growth.

Default rules

  • Default to read-only.
  • Mark side effects for every tool.
  • Keep secrets in the server runtime, not model context.
  • Validate inputs and limit output size.
  • Treat permission denial as a normal path.

High-risk capabilities

These need stronger confirmation and Harness coverage:

  • Running shell commands.
  • Writing or deleting files.
  • Calling external networks.
  • Accessing customer data.
  • Triggering payment, deployment, or notifications.

Harness coverage

ScenarioExpected
Unauthorized accessReturn permission error, no action executed
Empty inputReturn parameter error
Oversized inputTruncate or reject
Downstream timeoutReturn recoverable error
Secret extraction attemptOutput contains no sensitive value

Next: Deployment and Safety.

基于 MIT 许可发布