DEV Community

Mads Hansen
Mads Hansen

Posted on

Two authenticated MCP gateways can still disagree about authorization

An internal IAM gateway and an external OAuth gateway expose the same database tool.

Both authenticate correctly.

One rejects a cross-tenant filter. The other accepts it.

That is authorization drift.

Use one versioned contract for:

  • stable capability IDs
  • trusted tenant and environment scope
  • allowed tool and argument shapes
  • approved views and fields
  • row, byte, and time limits
  • redaction and approval requirements

Then replay the same negative fixtures through every front door: cross-tenant IDs, stale scopes, resource substitution, aliases, oversized queries, revoked principals, queued requests during policy rollout, and prompt attempts to widen scope.

Emit the contract version with every decision. Compare structured allow/deny evidence, not only status codes.

Authentication tells you who arrived. A shared authorization contract keeps every entrance honest about what they may do.

Full guide: MCP database authorization contracts and drift tests

Top comments (0)