Generative AI & Agentic AIMCP and integration contracts

Avoid token passthrough in delegated integrations

PK
Pankit Kumar
Sr. Data Scientist at Parexel (a Goldman Sachs–backed company) · 20 September 2026 · 2 min read
Technically reviewed by Ishaan Sharma
In this article (5 sections)

Forwarding a user token through an MCP server to another service can give the wrong audience access, obscure responsibility and leak a reusable credential.

Preserve bounded delegation

The MCP contract lab compares inbound and downstream contexts.

python
from mcp_cases import token_passthrough_case

result = token_passthrough_case()
assert result["raw_token_forwarded"] is False
assert result["exchange_used"] is True
assert result["audience_bound"] is True
print(result["downstream"])

The downstream record references a service credential and bounded on-behalf-of context. These are synthetic strings; no token exchange occurs.

Bind credentials to purpose

Validate issuer, audience, expiry and scopes at each boundary. Use the platform’s approved token-exchange/on-behalf-of pattern or service identity plus explicit user authorization context. Minimize lifetime and downstream scopes.

Keep raw credentials out of prompts, tool descriptions, errors and logs. Do not let a model choose token audience or scopes.

Test misuse

Try replay, wrong audience, expired credentials, cross-tenant scope and service privilege beyond the user. Fail closed and audit identities without token values.

The Generative & Agentic AI course treats delegated authority as an integration contract, not prompt context.

Exercise

Model user→MCP service→downstream API identity. Implement five token validation failures and demonstrate no raw inbound token reaches downstream records.

Continue learning

This article is part of the MCP and integration contracts sequence. Use the neighbouring tasks when you need the prerequisite or the next application.

Reference: OAuth 2.0 Token Exchange RFC 8693.

PK
Pankit Kumar
Lead Instructor, NeuraPath Academy

Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.

This article is part of our Generative & Agentic AI programme — 3 months. Add practical GenAI, retrieval and agent-building skills to your existing toolkit.

Explore Generative & Agentic AI
Counselling is free · no obligation

Not sure which programme fits?

Tell us your background and we will map it to the right entry point — including saying so when a cheaper programme is the better fit. A counsellor replies within one working day.