惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Proofpoint News Feed
T
Tailwind CSS Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
G
GRAHAM CLULEY
Engineering at Meta
Engineering at Meta
Blog — PlanetScale
Blog — PlanetScale
量子位
GbyAI
GbyAI
C
Cybersecurity and Infrastructure Security Agency CISA
Know Your Adversary
Know Your Adversary
阮一峰的网络日志
阮一峰的网络日志
P
Privacy International News Feed
T
Tenable Blog
Cisco Talos Blog
Cisco Talos Blog
P
Privacy & Cybersecurity Law Blog
T
Tor Project blog
L
Lohrmann on Cybersecurity
S
Secure Thoughts
Y
Y Combinator Blog
S
Securelist
H
Hackread – Cybersecurity News, Data Breaches, AI and More
有赞技术团队
有赞技术团队
月光博客
月光博客
Cyberwarzone
Cyberwarzone
H
Heimdal Security Blog
博客园 - 聂微东
Latest news
Latest news
The Hacker News
The Hacker News
小众软件
小众软件
T
Troy Hunt's Blog
Google Online Security Blog
Google Online Security Blog
D
DataBreaches.Net
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Martin Fowler
Martin Fowler
罗磊的独立博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
U
Unit 42
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
SecWiki News
SecWiki News
MongoDB | Blog
MongoDB | Blog
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学

Towards AI

You Can’t Prompt Your Away Your LLM Problems | Towards AI The Free Agent Trap | Towards AI Your Agentic Loop Will Drift. Here Is the KL Divergence Equation That Measures How Far It Has Wandered From Its Original Instruction. | Towards AI Beyond Chat: Processing Images, PDFs, and Documents with the OpenAI Adapter in Oracle Integration Cloud | Towards AI Building AI Agents in Rust — part 3 | Towards AI Self-Hosting Airflow at Home: Automating Stock Price Data Collection | Towards AI The 76-Hour Frontier: How the Takedown of Claude Fable 5 Birthed the Military-Industrial-AI Complex | Towards AI I Trained a Markdown File to Boost GPT-5.5 by 23 Points — It Shouldn't Work | Towards AI We Replaced ChatGPT With a Local AI Server. Six Months of Honest Data. | Towards AI What Really Makes Cars Pollute? A Data Science Deep Dive into CO₂ Emissions | Towards AI Training GPT-2 From Scratch on a GTX1050 | Towards AI Principal Component Analysis (PCA): Theory, Mathematics, and Applications Build a Zero-Cost Web Automation Pipeline With OpenRouter, OpenClaw, and MediaUse I Gave Qwen3.7-Plus a Screenshot and It Found the Exact Pixel to Click for $0.40 Beyond the Prompt: Why Autonomous AI Agents Are Replacing the Chatbot Moonshot Cracked Claude Code’s Playbook with an MIT Terminal Agent and a $0.60 Model Connections, Roles, and Warehouses: Getting CoCo Desktop Production-Ready from Day One My First $5,000 Month Writing About AI Engineering on Medium Google Shrank Gemma 4 by 72% and Unsloth Fixed the 4-Bit Bug Nobody Else Caught on One 4090, and 4-Bit Shouldn’t Be This Good LangChain Explained: Understanding Models, Prompts, Chains, Memory, Indexes, and Agents TOON: Beyond JSON for LLMs Claude Code Casual, Pro, Elite: The Three Working Personas of Claude Code Mastery MiniMax M3 Decodes 1M Tokens 15x Faster — and It Shouldn’t Be This Cheap Using Amazon SQS for AI Agent Orchestration I Ran a 1.5B-Active Model on My Laptop That Embarrassed a 26B by 46 Points How to Build a Self-Improving Company with AI Part 3 — Implementation/Engine-Level: Choosing the Runtime That Gives You These for Free Part 2 — Serve-Level Speed: System Design That Stabilizes P95/P99 3-Part Series: LLM Latency in Production (Part 1) Claude Code: The AI Coding Partner Changing How Developers Build Software Claude Code Pitfalls: Claude Code Won’t Do What You Told It: A Troubleshooting Catalog Full-Stack Data Scientists for the Agentic Coding World Building Production-Grade AI Skills with Snowflake Cortex AI Function Studio I Tried 10 AI Agent Frameworks in 2026 — Here’s the Honest Guide I Wish I Had Earlier How One Spring Boot Optimization Saved Our Startup $30,000 a Year Inside Palantir AIP: How the World’s Most Controversial AI Platform Actually Works What Is a Reverse Proxy? (And Why Every Backend Developer Should Care) What Claude Opus 4.8 Actually Changes If You’re Building Agents QWEN 3.7 Max Worked For 35 Hrs Straight And The Results Were Mind-blowing When LLMs Meet Knowledge Graphs on the Battlefield Fine-Tuning is Dead: Why Context Orchestration Won in 2026 5 Things Broke When I Shipped a RAG + MCP Agent to Production. Google Co-Scientist: Hyper Scaling Research and Discovery Microsoft Just Embarrassed Browser Web Agents — 1,000 Lines Made GPT-5.4 Beat Opus 4.6 on 200 Web Tasks The Modern Data Stack Is Broken — Here’s How to Fix It With AI, Governance, and Real Architecture Building Production MCP Servers: What the Spec Won’t Tell You When Should an Agent Stop? The Anatomy of Termination Harness Engineering: The Layer That Matters More Than the Model AI Engineers Who Can’t Debug Are Getting Fired (Here’s How I Debug with Claude Code) Claude Code Memory: Why You Keep Explaining the Same Thing to Claude (and the Five Layers That Fix It) Claude Code Subagents: The Claude Code Feature You Skip Every Day (And Why It Quietly Wrecks Your Sessions) Agentic AI and the SMB Banking Advantage Claude Code: Spec-Driven Development — Why Your AI Coding Sessions Fall Apart at Hour Three The Real Cost of Agentic AI Nobody Budgets For SVM : 40 must visit Interview Questions (Part 2) Your AI Agent Works Perfectly in the Demo. Here Are the 6 Ways It Dies in Production. Unleashing the Power of ONNX for Speedier SBERT Inference Terraform vs CI/CD for Serverless Deployments Merve Noyan Stopped Writing Training Scripts — Her Agent Just Fine-Tuned 18 Models Solo for $11.40 Why Your Sales Forecast Is Always 20% Wrong (And How To Make It 12% Wrong) Genetic Cubic n{C/A} Ratios For Elementary Robotics Design Top 20 AdaBoost Interview Questions & Answers (Part 2 of 2) Agentic AI Vs AI Agents — What Are the Key Differences? LAI #127: The Infrastructure Layer of AI Is Becoming the Product Anthropic Caught Its Own AI Planning to Blackmail Engineers RNNs Cannot Think What Transformers Think Cheaply. ICLR 2026 Proved the Gap Is Exponential. Time Series Made So Easy My Aunt Got It on the Second Read Claude Cowork 101 | Towards AI Is 3-Bit KV Cache the Holy Grail? A Reality Check on Google’s TurboQuant LangGraph Multi-Agent Architecture: Building a Self-Critiquing AI Debate System AutoML on Autopilot | Towards AI I Ran This Open-Source AI Tool on a Messy Codebase and Got 71x Fewer Tokens — Here Is Exactly What Happened Month in 4 Papers (April 2026) AI Kept Forgetting My Notes. Fixing That Taught Me How It Actually Works. How ChatGPT Makes You Addicted Crack ML Interviews with Confidence: K-Nearest Neighbors (KNN 20 Q&A) The Event-Driven Blueprint: How I Scaled a Spring Boot System to 10 Million Kafka Messages/Day Building Vector Search? Why FAISS Alone Isn’t Enough TAI #202: GPT-5.5 Moves Codex Into Real Work Machine Learning System Design -The Model Serving Triangle, With One Forward Pass Flowing Through Every Trade-off (Part3) AI Orchestration in Action: How MuleSoft and LLMs Fuel the Future of Enterprise AI GPT-4 Has 1.8 Trillion Parameters. It Uses 2% of Them Per Token. Part 20: Data Manipulation in Multi-Dimensional Aggregation A Fundamental Introduction to Genetic Algorithm -Part Two TAI #200: Anthropic’s Mythos Capability Step Change and Gated Release From Notebook to Production: Running ML in the Real World (Part 4) Sqribble’s Template‑Driven Document Automation Anthropic Just Shipped the Layer That’s Already Going to Zero Long-Term vs Short-Term Memory for AI Agents: A Practical Guide Without the Hype The L1 Loss Gradient, Explained From Scratch Your Postcode Is Deciding Your Care. I Built a Pipeline to Prove It. I Directed AI Agents to Build a Tool That Stress-Tests Incentive Designs. Here’s What It Found. Your System Prompt Is the Product — Not the Feature The LLM Wiki Trend Has a Retention Problem Nobody Mentions Top 20 Data Preparation Interview Questions and Answers (Part 2 of 2) LAI #122: Word Embeddings Started in 1948, Not With Word2Vec Top 15 Computer Vision Datasets [2026] 40 Generative AI Interview Questions That Actually Get Asked in 2026 (With Answers)
The Verified Identity Agent Bridge | Towards AI
N Selvaraj · 2026-06-18 · via Towards AI

Originally published on Towards AI.

Verify the human at the trusted edge, then carry that identity as explicit context to every downstream agent. Never collapse a user-initiated action into a shared service principal.

The problem

An enterprise wants its employees to reach an internal assistant from a commercial AI platform they already use every day. The assistant is a low-code agent: a Copilot Studio bot wired to an enterprise search index and a set of Power Automate flows. The integration looks simple. The host platform calls a proxy, the proxy calls the agent, the agent answers. A working prototype ships in a week.

Then the question that matters arrives. An employee asks the assistant to act on something only they should see, and someone asks who, exactly, made that request. The proxy authenticated to the downstream agent with a single application credential. Every call the agent received that month carries the same actor: the proxy’s service principal. The humans who actually asked the questions are nowhere in the agent’s context or its flow run history. Personalization is impossible because the agent never learned who is asking. Authorization is impossible for the same reason. The identity was present at the front door and discarded one hop later.

This is the default failure mode when a consumer-facing AI platform is bridged into an enterprise agent. The host platform verifies a human. The proxy in the middle, built for speed, authenticates downstream with client credentials because that is the path of least resistance. Identity terminates at the proxy.

The claim

When integrating a host AI platform with a downstream enterprise agent through a proxy, the proxy should verify the human identity using the enterprise identity provider’s delegated flow, resolve the canonical identity claims from the provider’s own source of truth, and forward that verified identity to the downstream agent as explicit per-request context. The app-only service-principal path is reserved for genuinely user-less work and logged as an exception, never used as the default for a user-initiated action. Preserving verified human identity across this bridge is the precondition for any US enterprise to adopt a third-party AI front end over internal systems without losing user-level accountability, which is what governs whether regulated organizations can use commercial AI platforms at all.

There is a wrinkle that defines the pattern. The downstream agent here is a low-code SaaS agent. It cannot validate a user-audience OAuth token the way a custom API can. So identity cannot be propagated by token exchange alone. It has to be verified at the bridge and asserted downstream as trusted context. That constraint is the reason this is a distinct pattern rather than a footnote to delegated-token forwarding.

The pattern: Verified Identity Agent Bridge

The bridge is the one component on the path that both authenticates the human and speaks to the downstream agent. It carries the identity across the gap. Five constraints define it:

  1. Verify the human at the bridge with a delegated flow. Use the enterprise IdP’s Authorization Code flow with PKCE [1][3], not the host platform’s opaque session and not a static API key shared across users. The bridge ends up holding a token that was issued to the actual caller.
  2. Resolve identity from the IdP’s source of truth. Do not trust identity self-asserted by the host platform. Call the directory (Microsoft Graph /me) with the user's delegated token and read the canonical claims [4]: object id, user principal name, display name. The identity is what the IdP says it is.
  3. Hold no standing user credential. Tokens are request-scoped. Cache an access token only within its own lifetime and only keyed to its own user. Never share a token across users, never persist one past expiry.
  4. Assert the verified identity downstream under an explicit trust contract. The bridge forwards the resolved claims to the agent as per-request context. Because the agent cannot itself validate a user token, the channel between bridge and agent must be authenticated so the agent can trust that the asserted identity came from the bridge and not from an arbitrary caller.
  5. Gate the service-principal path. When no user token is present, the temptation is to fall back to app-only client credentials [2]. That silently re-terminates identity. Reserve it for user-less operations, gate it, and log every use as an exception.
The Verified Identity Agent Bridge
Source: Image by the author.

VIAB flow: identity is verified at the bridge, resolved from the directory, and asserted downstream as per-request context over an authenticated channel. Source: Image by the author.

The downstream agent cannot validate a user token, so the bridge does not forward one. It verifies the human, then vouches for them over a channel the agent already trusts.

Implementation

The worked example bridges ChatGPT Enterprise to a Microsoft Copilot Studio agent through a Node.js MCP proxy. ChatGPT Enterprise is the host AI platform, the Copilot Studio bot is the low-code downstream agent reached through a Power Automate flow [5], and the enterprise IdP is Microsoft Entra ID. This is the exact case VIAB is built for: ChatGPT Enterprise verifies the employee, but the Copilot Studio agent on the far side cannot validate a user-audience token, so the bridge has to verify the human and assert the identity across to it. The pattern was validated experimentally against a live integration between these two systems, with a ChatGPT Enterprise action invoking the Copilot Studio agent through the proxy.

Verify the human at the bridge

The delegated flow starts with PKCE so the authorization code cannot be replayed by an interceptor. The bridge builds the authorization URL, the user signs in against Entra, and the returned code is exchanged for a token issued to that user.

import { randomBytes, createHash } from "crypto";
export function generatePKCE() {
const codeVerifier = randomBytes(32).toString("base64url");
const codeChallenge = createHash("sha256").update(codeVerifier).digest("base64url");
return { codeVerifier, codeChallenge };
}
export function getAuthorizationUrl(scope: string, redirectUri: string) {
const { codeVerifier, codeChallenge } = generatePKCE();
const state = randomBytes(16).toString("base64url");
const params = new URLSearchParams({
client_id: process.env.CLIENT_ID!,
response_type: "code",
redirect_uri: redirectUri,
scope, // "openid profile offline_access User.Read"
state,
code_challenge: codeChallenge,
code_challenge_method: "S256",
});
const base = `https://login.microsoftonline.com/${process.env.TENANT_ID}/oauth2/v2.0`;
return { url: `${base}/authorize?${params}`, codeVerifier, state };
}

The code-for-token exchange is the moment the bridge obtains a credential that belongs to the human, not to itself:

export async function exchangeCodeForToken(code: string, redirectUri: string, codeVerifier: string) {
const base = `https://login.microsoftonline.com/${process.env.TENANT_ID}/oauth2/v2.0`;
const res = await axios.post(`${base}/token`, new URLSearchParams({
client_id: process.env.CLIENT_ID!,
client_secret: process.env.CLIENT_SECRET!,
code,
redirect_uri: redirectUri,
grant_type: "authorization_code",
code_verifier: codeVerifier,
}), { headers: { "Content-Type": "application/x-www-form-urlencoded" } });

const { access_token, refresh_token, expires_in } = res.data;
return { accessToken: access_token, refreshToken: refresh_token, expiresIn: expires_in };
}

Resolve identity from the source of truth

A token is not an identity. The bridge resolves the canonical claims by calling the directory with the delegated token [4]. The delegated path uses /me. The app-only path has to be told which user to look up, which is the first sign it has lost the human.

export async function getUserProfile(token: string, isAppToken: boolean, userEmail?: string) {
// Delegated token -> /me resolves the authenticated human.
// App-only token -> caller must name the user, because the token has no human in it.
const url = isAppToken
? `${GRAPH_BASE}/users/${encodeURIComponent(userEmail ?? throwMissingUser())}`
: `${GRAPH_BASE}/me`; const res = await axios.get(url, { headers: { Authorization: `Bearer ${token}` } });
return {
id: res.data.id, // Entra object id (oid)
displayName: res.data.displayName,
email: res.data.mail ?? res.data.userPrincipalName, // UPN as fallback
};
}

That fork is worth pausing on. The instant the bridge uses an app-only token, identity resolution requires the caller to say who the user is. Self-asserted identity is exactly what the pattern refuses for user-initiated actions.

Assert the verified identity downstream

The downstream agent is reached through an HTTP-triggered automation flow [5]. It cannot validate a user-audience token, so the bridge does not send one as proof of identity. It sends the resolved claims as explicit context and authenticates the channel itself so the flow can trust the source.

export async function sendMessageToAgent(input: SendMessageInput, identity: ResolvedIdentity) {
const body = {
message: input.message.trim(),
// Verified identity asserted as explicit per-request context.
userId: identity.id, // Entra oid, resolved from the directory
userName: identity.displayName,
userEmail: identity.email,
};

const url = new URL(process.env.FLOW_URL!);
url.searchParams.set("api-version", "1");

return axios.post(url.toString(), body, {
headers: {
// The flow trigger is configured for Entra ("Tenant") auth, so it can
// verify the call came from this bridge, not an arbitrary poster.
Authorization: `Bearer ${await getChannelToken()}`,
"Content-Type": "application/json",
},
timeout: 60000,
});
}

The agent now has the human in context. Its flows can route, filter, and personalize on the verified userId and userEmail. Its run history attributes each interaction to a named person rather than to the bridge.

When this pattern fits / when it doesn’t

The decision turns on one axis above all: can the downstream consume a delegated token, and do user-initiated actions need to be attributable to a human?

Source: Image by the author.

Fits when: the integration sits between a human-facing AI platform and an enterprise agent, individual user attribution matters for authorization or audit, and the enterprise IdP supports a delegated flow.

Doesn’t fit when: there is no human principal, the action is provably non-user-specific, or the downstream can validate a delegated token directly and you should use straight token exchange instead.

Operational considerations: the delegated flow needs a place to complete an interactive sign-in and somewhere to hold refresh tokens for long sessions. The channel between bridge and agent must be authenticated, or the asserted identity is forgeable. Token-endpoint throttling and refresh rotation apply as they do to any OAuth integration.

Where this pattern is incomplete

The bridge verifies identity cryptographically, but the downstream agent consumes that identity as an assertion, not as a token it independently validated. The whole guarantee rests on the channel between bridge and agent being authenticated. If the automation flow’s trigger accepts unauthenticated requests, any caller can post the same context fields and impersonate any user. VIAB is only as strong as the trust contract on that hop. Adopters should treat an unauthenticated downstream trigger as a critical defect, not a convenience.

The pattern also has a gravitational pull back toward the service principal. The moment a user token is missing or expired, the easiest code path is an app-only fallback, and that silently re-terminates identity. The fallback has to be gated and logged as an exception. Left ungated, the system degrades to the very anti-pattern the bridge was built to prevent, and it does so invisibly.

Finally, host-platform constraints can fight the pattern. Some commercial AI platforms manage a single credential per action or per domain, which complicates issuing and refreshing per-user delegated tokens through them. Where the host cannot carry a per-user token, the interactive sign-in has to happen at the bridge directly, and the host platform’s own session becomes a weaker outer layer the bridge does not rely on for identity. VIAB establishes attribution; it does not establish intent. An agent can still be prompted toward actions the user did not mean to authorize, and that gap belongs to human-in-the-loop confirmation and scope minimization, not to the bridge.

How VIAB relates to the wider pattern family: this is the same identity-propagation discipline as the Delegated Boundary OAuth pattern [6], applied to a topology that breaks DBO’s central assumption. DBO forwards a user-audience token because the downstream API can validate one. VIAB exists for the case where it cannot, so the bridge verifies the human and vouches for them instead. And the identity the bridge resolves is precisely the key a retrieval layer needs: the verified userId is what the Security-Trimmed Index [7] consumes as its security-filter principal, so a question asked through a commercial AI platform still returns only the documents that one human is allowed to see.

Adoption checklist

  • Authenticate users at the bridge with the enterprise IdP’s Authorization Code + PKCE flow. Do not rely on the host platform’s session or a shared API key for identity.
  • Resolve canonical claims (object id, UPN, display name) from the IdP’s directory using the delegated token. Never accept self-asserted identity from the host platform for user-initiated actions.
  • Keep tokens request-scoped. Cache only within a token’s own lifetime, keyed per user. Never share or persist across users.
  • Authenticate the channel between the bridge and the downstream agent so the agent can trust the asserted identity. Treat an unauthenticated downstream trigger as a critical defect.
  • Forward verified identity as explicit per-request context (userId, userEmail) the downstream agent and its flows can route and filter on.
  • Gate the app-only service-principal path to genuinely user-less operations and log every use as an exception.

References

[1] Internet Engineering Task Force. RFC 7636 — Proof Key for Code Exchange by OAuth Public Clients.

[2] Internet Engineering Task Force. RFC 6749 — The OAuth 2.0 Authorization Framework.

[3] Microsoft. Microsoft identity platform and OAuth 2.0 authorization code flow.

[4] Microsoft. Microsoft Graph REST API — Get the signed-in user (/me).

[5] Microsoft. Copilot Studio — Trigger a flow from a topic.

[6] Companion pattern: The Delegated Boundary OAuth Pattern.

[7] Companion pattern: A Practical Pattern to Implement Secure Enterprise AI Search.

Published via Towards AI

Towards AI Academy

We Build Enterprise-Grade AI. We'll Teach You to Master It Too.

15 engineers. 100,000+ students. Towards AI Academy teaches what actually survives production.

Start free — no commitment:

6-Day Agentic AI Engineering Email Guide — one practical lesson per day

Agents Architecture Cheatsheet — 3 years of architecture decisions in 6 pages

Our courses:

AI Engineering Certification — 90+ lessons from project selection to deployed product. The most comprehensive practical LLM course out there.

Agent Engineering Course — Hands on with production agent architectures, memory, routing, and eval frameworks — built from real enterprise engagements.

AI for Work — Understand, evaluate, and apply AI for complex work tasks.

Note: Article content contains the views of the contributing authors and not Towards AI.