All posts

Agent security

Where Does Sensitive Data Go in an MCP Workflow? A Worked Data-Flow Review

Trace sensitive data through an MCP client, tool server, downstream service and recipient. Review authorization, minimization and supported action checks.

Harden cover: MCP Data Flow. A right-column source to tool to recipient diagram illustrates the workflow. Conceptual editorial artwork; no measured result is depicted.

Executive summary

Sensitive data in an MCP workflow can pass through a client, model request, tool server, downstream service, local file, and operational log. The actual route depends on the configured integration. Map each transfer, identity, and recipient before approving the connection. Our worked review uses a synthetic support ticket to show how authorization, data minimization, and action checks answer different questions. It does not claim that every MCP deployment shares the same architecture.

Draw the route before judging the server

Assume an engineer asks an agent to summarize a staging support ticket and inspect the related test records. The agent can call a ticket tool and a database tool through MCP. The approved outcome is a short diagnosis using synthetic staging data.

Start the review with the systems involved. Identify where the MCP client runs, who operates each server, where credentials are stored, and which downstream service receives requests. Include any proxy, subprocess, or remote execution environment that changes the trust boundary.

Then follow one field: the synthetic customer identifier in the ticket. Does it become a database argument, appear in the returned rows, enter the model context, get written to a local report, or reach another recipient? Mark the actual transfers rather than drawing a single arrow labeled “MCP.”

A protocol name does not establish data residency, retention, or privacy terms. Those questions belong to the actual providers and deployment. Obtain current documentation and applicable organizational approval before allowing real sensitive data through the route.

Separate local execution from remote authorization

The MCP authorization specification describes authorization for HTTP-based transports. It treats stdio separately, with credentials generally obtained from the environment. The linked page is a draft; check the version implemented by your client and server.

A local stdio server is executable code in an environment. Review its package source, launch command, environment variables, filesystem access, and network reach. Calling it “local” does not establish that its downstream requests remain on the machine.

A remote server adds a service boundary. Confirm token audience, scopes, resource selection, and the server's access to downstream systems. Do not forward an unrelated credential merely because a tool can receive it. The MCP security guidance explains the risks of token passthrough and confused-deputy behavior.

Record user identity and service identity separately. A user may authorize the MCP connection while the server authenticates to the database using a shared credential. The database's effective authority still needs review, including which tenant or environment it can reach.

Minimize what each tool receives

Our synthetic ticket contains a title, error code, test-order identifier, and a sample credential deliberately included as a trap. The database lookup needs the test-order identifier. It does not need the credential or the whole ticket body.

Define the minimum arguments for the tool and the minimum result required by the next step. Prefer a scoped lookup over a broad export when it completes the job. Apply result limits and approved data handling at the server and resource where possible.

Tool descriptions help the agent choose an operation, but they are not independent authorization. A description that asks the agent to attach the entire environment file should not gain authority from being displayed as tool documentation. Review both the declared operation and its proposed arguments.

Minimization also improves investigation. If a workflow only needs a synthetic identifier and a status, an evidence record should not retain a full customer row by default. Describe what fields are required, who can inspect them, and when the record can be removed.

Follow results into the next action

The database result may be legitimate input for the diagnosis. The next transfer is a separate decision. Sending a short answer to the requesting engineer differs from uploading raw rows to an unrelated debugging service.

MCP security best practices describe risks across authorization and local-server boundaries. Use that guidance to inspect your route, while keeping task authority explicit. Returned content can provide facts; it cannot authorize a new recipient or a broader export.

Create a simple transfer record for each hop: source field, purpose, recipient, identity, transformation, retention owner, and expected control. Where the model provider receives tool results, consult the actual client configuration and service terms. Do not infer that behavior from the MCP transport alone.

Inspect diagnostic paths too. Error messages, retries, traces, and support attachments can carry data outside the main success path. A diagram that covers only the successful tool response will miss the workflow people use when something breaks.

Verify a narrow set of outcomes

Run the example with synthetic values and a controlled recipient. The expected legitimate outcome is a useful staging diagnosis. The prohibited variation attempts to include the synthetic credential or sends the report to an unapproved recipient. Record both outcomes through the actual client and server.

Inspect the proposed arguments, server-side request, resulting file, and recipient-side receipt where available. A redaction decision should correspond to the modified field in the delivered content. A block should be distinguished from a request that failed for an unrelated reason.

Keep gaps visible. A server may conceal its downstream query, or a hosted tool may expose only limited logs. Mark that boundary as unverified and obtain an owner decision before introducing sensitive data. An attractive architecture diagram cannot supply missing operational evidence.

Repeat relevant cases when tool definitions, server versions, credentials, or recipients change. Treat a new server capability as a changed access path even when the server's display name remains familiar.

Evaluate Harden at the supported call boundary

Harden can evaluate supported agent calls before execution against task context and policy. For an MCP evaluation, first identify whether the configured integration observes the actual tool route and which arguments and context it receives. Do not assume that every connection is covered merely because it uses MCP.

Keep server authorization, least-privilege credentials, minimization, and recipient controls in place. Our MCP authorization guide covers those foundations. Use Control to evaluate a supported workflow, or Book a Call with the transfer map and an allowed/prohibited pair.

FAQs

Does MCP keep all data on my laptop?

MCP does not establish that property for a deployment. A local server may contact remote services, and a client may send tool results to a model provider. Trace the configured route and verify provider handling before making a claim about where information travels.

Does OAuth authorize every tool action?

OAuth contributes to authorization at the service boundary. Review resource permissions, scopes, server behavior, and the purpose of each operation separately. A valid token does not establish that a proposed export or recipient matches the engineer's assignment.

Can a read-only database tool expose sensitive information?

Yes, reads can return information the next step should not disclose. Limit available datasets and returned fields, then inspect subsequent transfers. Read-only database authority reduces write risk; it does not decide every downstream use of the result.

Should we log every tool response in full?

Choose evidence fields deliberately. Full responses can create another sensitive-data store. Preserve enough information to investigate the operation, with appropriate access and retention, and use synthetic payloads for exercises. Confirm what the deployed client and server actually retain.

What should we approve before adding a new server?

Review the operator, executable or endpoint, credentials, exposed tools, downstream resources, update path, data handling, and evidence access. Test a representative useful action and a prohibited variation. Record the supported route and unresolved gaps before broadening the deployment.