MetorialDocs

How Metorial handles prompt injection and sensitive data in tools

ProtoGuard scans tool calls and tool outputs for prompt injection and raises alerts. Redaction and blocking of sensitive data run in an Outpost you operate.

ProtoGuard scans tool calls, tool outputs and tool definitions for prompt injection and raises an alert when a message crosses your thresholds. It does not block the call or change the result. To remove or mask data before it reaches an AI client, run an Outpost in your own network with redaction middleware.

What you'll learn

  • What ProtoGuard scans and what it does with a finding
  • How to set thresholds and read alerts
  • Which control masks or blocks data, and where it runs

Before you start

What each control does

RiskControlWhat it doesWhere it runs
Instructions hidden in a tool resultProtoGuardScans tool calls and outputs, raises alertsMetorial
A tool description written to mislead the modelProtoGuardScans tool definitions for tool poisoning, tool shadowing and tool rug pullMetorial
A secret passed in tool argumentsProtoGuardFlags it with the Secret in arguments filterMetorial
Sensitive fields in arguments or resultsOutpost middlewareRemoves or rewrites fields, or refuses the callYour network
An injected instruction that tries to delete or send dataTool filtersWrite and destructive tools are not available to callMetorial
An injected instruction that tries to read other people's dataPer-user OAuthThe app applies the person's own permissionsThe app

Other ProtoGuard filters cover instruction override, role hijack, jailbreak personas, prompt exfiltration, tool-call forgery, hidden content, Unicode and ASCII smuggling, encoded payloads and exfiltration channels.

Configure ProtoGuard

Open ProtoGuard

Select Settings, then Organization Settings. Under Integrations and MCP, open Prompt Monitoring, then Protoguard.

Check that analysis is on

Analyze session messages is on by default. Turning it off stops new scans and alerts for that instance.

Set the alert thresholds

Set Alert probability threshold (0 to 1) and Alert filter count threshold. A message raises an alert when either is reached, or when a high-confidence rule fires.

Tune single filters

Open a filter to turn it off for alerting or to give it its own Alert confidence threshold. To silence one false positive, suppress the finding from its alert. Suppressed findings are still recorded.

Read alerts

In the dashboard, open Prompt Monitoring, Alerts. From the CLI:

metorial-admin monitoring protoguard list
metorial-admin monitoring protoguard list --session-id <session-id>
metorial-admin monitoring protoguard get <proto-guard-alert-id>

A finding records which rule matched and where in the message. Matches for secret patterns are redacted in the finding.

Mask or block sensitive data

Run an Outpost and add middleware. It runs before a request is forwarded, so it can strip an argument, rewrite a result or refuse a tool. This example removes an apiKey argument from one tool:

import { McpProxy, mcpMiddleware, assertToolName } from '@metorial/mcp-proxy';

let redactApiKey = mcpMiddleware({
  handle: async (message, call) => {
    assertToolName(message, 'call_external_api');
    let { apiKey, ...rest } = message.params.arguments ?? {};
    return call({ ...message, params: { ...message.params, arguments: rest } });
  }
});

await McpProxy.create({
  outpostCredential: process.env.METORIAL_OUTPOST_CREDENTIAL!,
  baseUrl: 'https://mcp.example.com',
  proxy: { port: 8080 },
  middleware: [redactApiKey]
});

Metorial has no built-in detector that finds and masks personal data in tool results. Call your own detection service from the middleware if you need one.

To limit what an injection can do, reject Destructive Tools on every integration and use per-user OAuth, so an agent never reaches more than its person can. Metorial sees MCP traffic only. Text pasted into an AI client is outside it.

Check it worked

In a project with no production data, call a tool whose result contains "ignore all previous instructions", then run metorial-admin monitoring protoguard list. An alert for the session should be listed.

Troubleshooting

"ProtoGuard is turned off for this instance."

Analysis was switched off. Filters keep their settings, but nothing is scanned. Turn Analyze session messages back on.

Next steps