All posts

MCP Gateway Security: What to Check Before Deployment

MCP gateway security depends on verifying who is making a request, limiting the actions it can perform, protecting credentials and recording decisions. A gateway provides a place to apply these controls, but its effectiveness depends on implementation, configuration and whether the relevant tool traffic actually passes through it.

Security and platform teams can use these checks to evaluate a gateway before connecting AI tools to company systems. The review should cover the gateway, its connected servers and the permissions in the systems behind them.

For an introduction, read What Is an MCP Gateway?

What security controls should an MCP gateway provide?

AreaWhat to check and whyEvidence to request
Identity and scopeA valid login does not establish permission for every action. Check whose identity is used and which tools, operations and resources it can access.An identity map and a test with two users who have different permissions.
Credentials and tokensCheck where secrets are decrypted, which components can read them, how tokens are validated and how access is revoked.A credential-flow diagram, token-validation documentation and a revocation test.
Policy before executionCheck whether the gateway evaluates the tool, action and relevant parameters before execution. Ask whether the final decision uses deterministic rules, a model-based assessment or both.An allowed read and blocked write; a call rejected for exceeding a configured limit.
Human approvalFor sensitive actions, check what the reviewer sees and whether approval is bound to the exact request that executes.A demonstration with changed parameters, an expired approval and a denied approval.
Failure behaviourCheck whether protected actions stop when required checks cannot complete. This is fail-closed behaviour.A controlled test of unavailable dependencies, timeouts and retries.
Coverage and server trustIdentify direct routes outside the gateway. Check who maintains each server, what permissions it has, and whether changes to its tools, descriptions or implementation trigger another review.Connection inventory, routing restrictions and the server onboarding process.
Audit evidenceCheck whether records connect the caller, requested action, decision and execution outcome without exposing secrets.Redacted records for allowed, denied and held calls; retention, access and tamper-protection settings.

How should an MCP gateway enforce access decisions?

ALLOWHOLDAI toolMCP serverMCP gatewayDENYREQUIRE APPROVALRequests an actionIdentity and policy checksCalls the connected systemNo downstream callAwait an authorised reviewerIf approved,recheck requestDeclined or expired: stopRecord decisions and downstream execution outcomes.Illustrative flow. Available controls depend on the implementation and configuration.

A successful connection does not demonstrate action-level control. If reading and merging use the same connection, the evaluation needs enough detail to distinguish them.

For deterministic rules, the same request with the same policy and context should produce the same decision. Check which inputs influence that decision and whether the logs explain it.

For example, suppose a team is testing access to a repository called payments-service. The team permits reading issues, blocks changes to repository settings and requires a reviewer before a pull request is merged. A useful demonstration would show all three paths, using the same caller and connection.

For the approval path, change the approved branch or commit and check that the altered request cannot use the earlier approval. Test declines, expiry and unavailable dependencies. Approval should not override other required access checks.

Finally, inspect the records. A policy allowing a request and the connected service successfully executing it are different events. The evidence should make that distinction visible. A useful record identifies the request, caller, target, relevant parameters, policy decision, approval reference where applicable, timestamp and execution outcome. Sensitive values should be redacted.

Where can credentials be exposed in an MCP gateway setup?

Ask where plaintext credentials can exist: in the AI client, gateway process, connected server or downstream service. Encryption at rest alone does not explain who can read a secret during execution. Ask the vendor to show the relevant components and trust boundaries. The MCP security guidance also covers risks such as consent failures and compromised local servers. Central routing does not replace review of those components. Authorizing a tool call does not prove that the connected server is trustworthy or that its implementation has no unsafe side effects.

The MCP authorization specification requires servers using its HTTP authorization model to validate that tokens are intended for them. It also prohibits passing the token received from an MCP client through to a downstream API. Downstream APIs should be accessed using credentials intended for those APIs, rather than forwarding the token used to authenticate to the MCP server. Check which component performs each validation and where downstream credentials are used.

A secure enclave is one possible isolation mechanism. If a vendor claims one, ask which code and secrets it protects, how the running software is verified and what data leaves the boundary. Check attestation against the specific claim.

Frequently asked questions about MCP gateway security

Does an MCP gateway automatically secure all AI tool access?

No. It can enforce controls on the traffic it handles. Direct API connections, local tools and alternative credentials can create routes outside that boundary. Inventory the relevant paths and establish which are governed, restricted or explicitly excluded.

Is keeping credentials away from the AI tool sufficient?

It reduces one exposure path, but leaves questions about gateway-side access, downstream credentials and the permissions attached to them. Request a credential-flow explanation and test both access restriction and revocation.

Does gateway policy prevent prompt injection?

A gateway can limit permitted actions even when an AI tool receives malicious instructions. That does not establish that every harmful request will be detected: an action can be allowed by policy and still be misused. OWASP recommends limiting privileges, requiring human approval for high-risk actions and testing trust boundaries.

Can gateway controls replace downstream permissions?

Use both. Keep the connected system’s permissions as narrow as practical, then apply any additional gateway policy needed for the workflow. Check what the downstream system can independently enforce if a request reaches it through another route.

How should a team verify security claims before deployment?

Use a defined workflow and agreed expected outcomes. Test an allowed action, a denied action, an approval, a changed request and a control failure. Review the corresponding evidence. Include the gateway, identity configuration and connected systems in the assessment.

Sources

Security for what you can least afford to loseLearn how Station70 protects keys, identities, and access.
Learn more