All articles

1 November 2026

Guardrails in the data path: how MCP Connect plugins work

Put guardrails where every call passes. How MCP Connect plugins run in the data path, what the library covers, how you control their behaviour and how to see them act.

By MCP Connect

Put guardrails where every call passes

If every AI assistant has its own guardrails, you end up with as many policies as assistants, each a little different, and each one has to be kept up to date. If every assistant reaches your systems through one gateway, the guardrail can sit there instead: written once, applied to every call, whichever AI client or model is behind it.

In MCP Connect, guardrails are plugins in the data path. This article explains where they run, what the library covers, how you control their behaviour, and how to see them act, using the MCP Connect example environment.

Hooks: where a plugin runs

A plugin attaches to one or more hooks, fixed points in the life of a request. The ones that matter most for AI traffic:

HookRunsTypical use
tool_pre_invokeBefore a tool call is forwardedValidate arguments, block dangerous operations, apply rate limits
tool_post_invokeAfter the tool returns, before the assistant sees the resultMask PII, filter or reshape the result
prompt_pre_fetch / prompt_post_fetchAround prompt template retrieval and renderingScan arguments, filter rendered content
resource_pre_fetch / resource_post_fetchAround resource readsValidate URIs, redact sensitive content
agent_pre_invoke / agent_post_invokeAround calls to A2A agentsFilter messages, moderate responses
http_auth_resolve_user / http_auth_check_permissionDuring authentication and permission checksPlug in a custom identity or permission source

The PII filter in the example environment, for instance, attaches to four hooks: before and after prompts, and before and after tool calls.

The plugin library, by job

The example environment lists 44 plugins on its Plugins page. Grouped by what they do:

JobPlugins
Protect dataPIIFilter, PIIFilterPlugin, SecretsDetection, EncodedExfilDetector
Check contentContentModeration, HarmfulContentDetector, DenyListPlugin, ReplaceBadWordsPlugin
Check inputsSQLSanitizer, SchemaGuardPlugin, ArgumentNormalizer, SPARCStaticValidator
Check links and filesURLReputationPlugin, VirusTotalURLCheckerPlugin, FileTypeAllowlistPlugin, SafeHTMLSanitizer
Control accessUnifiedPDPPlugin, JwtClaimsExtractionPlugin, VaultPlugin
Keep things reliableRateLimiterPlugin, CircuitBreaker, RetryWithBackoffPlugin, Watchdog, OutputLengthGuardPlugin
ObserveToolsTelemetryExporter, SpanAttributeCustomizer, WebhookNotification

The rest reshape results, for example by repairing JSON, converting HTML to Markdown, caching tool results or summarising long text. Plugins can run inside the gateway or as external services that the gateway calls.

Plugins page listing the guardrail plugins

(1) UnifiedPDPPlugin, a policy decision point for access control. (2) RateLimiterPlugin. (3) PIIFilter, for PII detection and masking.

Modes, order and targeting

Mode decides what happens on a violation. Each plugin runs in one of these modes:

ModeOn a violation
enforceBlocks the request
enforce_ignore_errorBlocks violations, but lets a request through if the plugin itself fails
permissiveLogs the violation and lets the request continue
disabledThe plugin is loaded but never runs

Priority decides the order. Plugins run in ascending priority, so a lower number runs first. Plugins with the same priority can run in parallel if you switch that on.

Conditions decide where. A plugin can be limited to specific virtual servers, tools, prompts, resource URIs or user patterns. A strict PII filter can cover the Customer Service Copilot without applying to the SRE Copilot.

In the example environment, the PII filter runs in enforce mode at priority 50.

Seeing guardrails act

A guardrail that acts silently is hard to trust and hard to tune. In MCP Connect, guardrail actions appear in the activity feed as warnings, so you can filter for them and see exactly what was changed or stopped.

Activity feed filtered to warnings

The Warnings filter in the example environment's activity feed: a masked phone number, an API key pattern removed from a tool argument, and an agent held back by a rate limit.

With export to a SIEM switched on, the gateway also sends its security, auth and audit events to your security monitoring.

Rolling guardrails out

  1. Start a new plugin in permissive mode, so it logs violations without blocking anything.
  2. Watch the activity feed for a while and tune the plugin's settings until the warnings are the ones you expect.
  3. Limit it with conditions to the virtual servers and tools it is meant for.
  4. Switch it to enforce.
  5. Set priorities so cheap checks, such as rate limits, run before expensive ones.

Open the interactive demo to browse the plugin library and the activity feed's warnings.

Make AI part of your operations.

Tell us what you want your agents to reach, and how you want that access governed.