myco:mcp-response-redaction-governance

Governs sensitive-field redaction policy across MCP tools and API responses.

777|101|Updated Apr 21, 2025
One-click install
npx skills add https://github.com/sirkirby/unifi-network-mcp --skill myco-mcp-response-redaction-governance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: myco:mcp-response-redaction-governance
Source: https://github.com/sirkirby/unifi-network-mcp/tree/main/.agents/skills/mcp-response-redaction-governance
Command: npx skills add https://github.com/sirkirby/unifi-network-mcp --skill myco-mcp-response-redaction-governance

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents caller-controlled flags like include_sensitive from deciding whether secrets, tokens, or credentials are disclosed in MCP tool and API responses, ensuring disclosure decisions belong to server/operator policy.

Core Features & Use Cases

  • Per-surface redaction configuration: Configure redact_sensitive_fields through the env-var hierarchy (per-surface, global, config, safe-by-default) resolved by should_redact_sensitive_fields in unifi-core.
  • Policy extension guidance: Choose between the PolicyGateChecker allow/deny gate shape and the surface-scoped resolver shape when adding policy for a new domain.
  • Enforcement-point auditing: Distinguish per-tool read-path redaction from the centralized StrictKwargFastMCP write-back marker guard, and migrate legacy include_sensitive caller flags to server-owned policy.
  • Use Case: When a request asks to expose a raw field on a UniFi network tool, use this Skill to remove the caller flag, wire the response through redact_sensitive_fields, and verify the marker guard blocks replayed redacted values.

Quick Start

Review this MCP tool change that adds an include_sensitive parameter and migrate it to server-owned redaction policy.

Frequently Asked Questions about myco:mcp-response-redaction-governance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure sensitive-field redaction for an MCP server?

Set redact_sensitive_fields via the env-var hierarchy: UNIFI_{SURFACE}_REDACT_SENSITIVE_FIELDS overrides UNIFI_REDACT_SENSITIVE_FIELDS, which overrides the config value, defaulting to true. MCP surfaces resolve per tool call, while the API surface resolves once at config load.

How do I migrate an include_sensitive parameter to server-owned policy?

Remove the caller-controlled parameter from the public schema entirely, replace internal uses with should_redact_sensitive_fields and redact_sensitive naming, and derive any internal boolean from server policy only. Optionally return an explicit error naming the replacement env var.

Does changing the redaction env var take effect without a restart?

On MCP surfaces yes, because each tool call re-resolves should_redact_sensitive_fields. On the API surface no, because the value is resolved once in load_config and cached, so a process restart is required.

Why is a redacted field still being returned by a new API route?

Read-path redaction is not applied by middleware; every new tool, route, or resolver must explicitly call redact_sensitive_fields with the resolved boolean. A missing call at the new code path is the most likely cause.

Is there a single PolicyEngine class in unifi-core?

No. Two separate mechanisms exist: PolicyGateChecker for categorized allow/deny gates and the should_redact_sensitive_fields resolver for surface-scoped values. A unified PolicyEngine was proposed but never shipped, so verify with grep before assuming it exists.