Most multi-tenant AI gateways pass user-delegated OAuth reviews only to introduce a second risk right behind them: a central oauth_credentials database table holding thousands of active Workday Bearer and refresh tokens at rest. Sealed client-held tokens eliminate that central honeypot by encrypting each employee’s user-delegated Workday OAuth grant with AES-256-GCM inside the session token carried by the MCP client itself—so an idle gateway server and its database hold zero Workday credentials.
When a security team evaluates an integration layer sitting in front of Workday HCM, Payroll, and Compensation, “encrypted at rest in RDS” still means a single SQL injection, leaked snapshot, or compromised support credential exposes active tokens for every connected executive, HR Partner, and payroll admin at once. Changing where the encrypted grant lives changes the blast radius completely.
The Central Token Vault Problem in Traditional Integration Gateways
In a conventional SaaS integration broker, OAuth 2.0 works like this:
- An employee signs in to Workday via Authorization Code Grant with PKCE.
- Workday’s token endpoint returns an
access_token(and optionally arefresh_token) scoped to the API Client’s Functional Areas and the employee’s Workday security groups. - The broker generates a random session ID (
sess_98a1...), handssess_98a1...to the AI assistant’s MCP OAuth client, and writes(sess_98a1, tenant_id, user_id, workday_access_token, workday_refresh_token)into a central PostgreSQL or Redis store.
That table becomes the single highest-value target in the vendor’s cloud. Even when the vendor uses disk encryption or column-level envelope encryption, the gateway application tier has standing network access to both the database rows and the decryption key 24 hours a day. An attacker who compromises a background job or reads the token table can silently query GET /common/v1/workers or custom RaaS reports as every HR Partner and executive in your tenant—even for employees who haven’t opened chat in days.
How AES-256-GCM Sealed Client-Held Tokens Work
The Model Context Protocol (MCP) specification already requires remote MCP clients (Claude Desktop, Claude Web, ChatGPT, Gemini) to store and transmit an Authorization: Bearer <mcp_token> header on every tool request made by that specific authenticated user.
Instead of storing the Workday OAuth grant in a server database and putting a lookup pointer in <mcp_token>, a stateless gateway turns <mcp_token> into a cryptographically sealed envelope:
MCP Bearer Token = version || key_id || 96-bit nonce || AES-256-GCM(plaintext_grant, AAD) || 128-bit auth_tagHere is what happens at each step of the cryptographic lifecycle:
1. Sign-In and Sealing (Authorization Code + PKCE)
- The employee completes SSO and MFA directly on Workday’s own sign-in screen in the browser. The gateway never sees the employee’s Workday password or MFA factor.
- The gateway redeems the authorization code + PKCE
code_verifierwith Workday’s token endpoint in memory. - Immediately in RAM, the gateway constructs a compact binary payload containing the Workday grant, expiry timestamp, and tenant binding, then seals it with AES-256-GCM using Additional Authenticated Data (
AAD) binding thetenant_id,client_id, andpolicy_epoch. - The gateway returns this opaque sealed token to the employee’s MCP client and zeroes the plaintext buffer. Nothing is written to a database or disk.
2. Per-Request Ephemeral Unsealing
When the employee asks a question in Claude, ChatGPT, or Gemini:
- The AI assistant’s MCP client sends
Authorization: Bearer <sealed_token>over TLS 1.3 to the gateway. (Note that the LLM itself never sees theAuthorizationHTTP transport header—the host MCP client injects it at the network layer.) - The gateway verifies the 128-bit GCM authentication tag and
AADbinding in memory. Any single-bit tampering, cross-tenant replay, or expiredpolicy_epochfails decryption before any upstream socket opens. - The gateway unseals the Workday Bearer grant in process memory for the 100–300 milliseconds required to call Workday’s REST, WQL, SOAP, or RaaS endpoint, strips any admin-redacted fields from the response, streams the answer back, and drops the request buffer.
3. Zero Credentials at Rest When Idle
The moment the HTTP response finishes streaming, zero copies of the employee’s Workday credential exist anywhere on the gateway. Database backups contain only tenant URLs, tool enablement policies, and payload-free call counts.
Architectural Comparison: Central Token Vault vs. Sealed Client-Held Grants
| Security Property | Central Database Token Vault | Sealed Client-Held Token (AES-256-GCM) |
|---|---|---|
| Security PropertyDatabase breach / SQL snapshot leak | Central Database Token VaultExposes all active employee & HR Partner tokens at once | Sealed Client-Held Token (AES-256-GCM)Database contains zero employee tokens |
| Security PropertyIdle gateway server memory | Central Database Token VaultBackground refresh workers load dormant user grants | Sealed Client-Held Token (AES-256-GCM)Idle workers hold zero customer credentials |
| Security PropertyVisibility to AI assistant / LLM | Central Database Token VaultOpaque reference ID | Sealed Client-Held Token (AES-256-GCM)Opaque AES-256-GCM ciphertext; assistant cannot decrypt |
| Security PropertyTamper resistance | Central Database Token VaultRelies on DB row integrity | Sealed Client-Held Token (AES-256-GCM)128-bit GCM authentication tag + AAD tenant binding |
| Security PropertyHorizontal & multi-region scaling | Central Database Token VaultRequires replicated, low-latency session/token DB | Sealed Client-Held Token (AES-256-GCM)Completely stateless across regions and self-hosted VPCs |
| Security PropertySelf-hosted deployment footprint | Central Database Token VaultRequires customer IT to run & back up a stateful DB | Sealed Client-Held Token (AES-256-GCM)Single stateless container (volumes: [], zero DB) |
Defense in Depth: Pairing Sealed Tokens with Workday IP Restrictions
What if InfoSec asks the next adversarial question: “What if the gateway’s KMS key were compromised AND an attacker intercepted a live request?”
Workday gives administrators a native second lock that binds OAuth token usability to a specific network perimeter:
- Run the Maintain IP Ranges task in Workday and register the dedicated static outbound IPv4 CIDR of your gateway instance (or your own VPC NAT Gateway if self-hosting).
- Open Manage Authentication Policies in Workday, add an authentication rule scoped to your API Client’s users or conditions, and restrict allowed API authentication to that IP range.
- Activate the authentication policy changes (always test in Sandbox first with a break-glass admin session exempted so you do not trigger 401 or invalid_grant lockouts).
With both controls active, stealing the ciphertext from a client laptop is useless without the gateway’s AES-256-GCM key, compromising a database yields zero tokens because no token table exists, and even a raw Workday token cannot be replayed from outside the allowlisted static egress IP.
Handling Token Expiry and Instant Revocation Without a Token Table
Stateless token sealing does not sacrifice administrative revocation:
- Short-lived Workday access tokens: Workday enforces the access token TTL configured on
Register API Client. When a token expires or an employee terminates in Workday, Workday immediately rejects upstream calls with401 Unauthorized. - Epoch-based instant cutover: By storing a lightweight integer
revocation_epochon the tenant’s configuration record (no credentials, just a counter), an IT admin can invalidate every active MCP session across the company in one click—changing theAADepoch so all older sealed envelopes fail GCM verification instantly without touching Workday’sRegister API Clientconfiguration.
How Kiweely Bridge Implements Sealed Client-Held Tokens
Kiweely Bridge (coming next) uses this exact zero-credential-storage design across every deployment tier (see the full trust matrix on /bridge/security):
- Zero token table: Bridge keeps no database table of employee Workday tokens. Each user-delegated
Register API Client(Authorization Code + PKCE) grant is sealed with AES-256-GCM and carried by the MCP client in Claude, ChatGPT, or Gemini. - Opaque to AI vendors: The AI assistant holds only the sealed session token and cannot read the Workday credential inside.
- Three deployment modes: Run on Kiweely Cloud ($499/mo up to 1,000 Workday employees, $1,499/mo for 1,001–5,000, $3,999/mo for 5,001–20,000, unlimited calls, covering Production and all Sandbox/implementation tenants; free for one person on a personal Workday developer tenant), Dedicated single-tenant with a static outbound IP for Workday
Maintain IP Ranges, or Self-hosted stateless container inside your own AWS, GCP, Azure, or Kubernetes perimeter (Enterprise by quote).
Frequently asked questions
Can Claude, ChatGPT, or Gemini read the Workday OAuth token inside a sealed session token?
No. The MCP client holds an opaque ciphertext sealed with AES-256-GCM using a key managed only by the gateway's KMS/HSM boundary. Neither the AI model nor the AI vendor's server can decrypt the underlying Workday Bearer credential.
What happens if an attacker compromises an idle stateless gateway worker or database backup?
There is no oauth_tokens database table to dump, and an idle worker process holds zero employee Workday tokens in RAM. Without an active incoming request presenting a valid sealed envelope, no customer credentials exist on the server.
How do IP allowlists reinforce sealed client-held tokens?
By registering the gateway's dedicated static outbound IP in Workday's Maintain IP Ranges task and binding it in Manage Authentication Policies, even a hypothetically extracted Workday token is rejected by Workday if replayed from any other network.
How does an employee or admin revoke access when tokens are client-held?
Revocation works at two independent layers: deactivating the worker's session or OAuth token in Workday immediately causes upstream API calls to return 401 invalid_grant, and incrementing the tenant or user key-epoch metadata on the gateway immediately invalidates previously sealed envelopes.