~ / cases / agentic-authorization-tenant-isolation / agentic-context-cross-tenant-access
Agentic Context Confusion to Cross-Tenant Access
Client-controlled account and workspace context let an agent enumerate another user's organizations and expose or potentially modify cross-tenant resources.
This finding began as a business-logic issue rather than a model exploit. A free account could continue sending agent requests after its workspace identifier was removed, suggesting that credit enforcement trusted a client-controlled context value. The later testing showed a more serious authorization boundary failure: the agent's identity and workspace tools accepted incomplete or attacker-supplied context.
> Initial reconnaissance
I started with ordinary prompts to understand which account, billing, organization and agent operations the assistant could perform. The request body included identifiers such as conversation_id, user_id, workspace_id, account_id and user_email. These values were treated as request context instead of being derived and verified from the authenticated session.
{
"question": "Tell me my balance",
"conversation_id": "REDACTED-CONVERSATION-ID",
"session_id": "REDACTED",
"user_id": "REDACTED",
"workspace_id": "REDACTED",
"account_id": "REDACTED",
"user_email": "REDACTED",
"agent": "training-agent",
"model_tier": "max",
"deep_search": true
}> Business-logic bypass
Removing the workspace_id value did not stop the request. The agent continued to process prompts even though the account had exhausted its free credits. This was a separate logic and quota-enforcement defect: a security-sensitive decision depended on a client-provided field instead of server-side account state.
> Cross-account identity disclosure
In a new conversation, I supplied an email value belonging to another test account while leaving the remaining context blank. The assistant returned personal context such as the email, timezone and channel, demonstrating that the agent trusted user-controlled identity fields and exposed information before establishing authorization.
> Workspace enumeration through agent tools
When asked to find the workspace associated with the supplied identity, the agent invoked its account and workspace tools. The internal reasoning exposed account and workspace identifiers and reported access to multiple organizations. This was not merely prompt disclosure: the tool layer performed cross-tenant discovery using an identity that had not been authorized by the current session.
> Impact
After selecting a workspace by name, the agent could retrieve billing information, agent inventories, user email addresses and other organization data. The same tool path indicated that workspace-level modifications could also be attempted. The combination represents BOLA/IDOR, broken tenant isolation and a confused-deputy pattern in an agentic system.
> Why this belongs in AI security testing
The underlying bug is classic authorization failure, but the AI layer expanded the attack surface. Natural-language requests caused the agent to chain identity-registry, account and workspace tools, infer missing identifiers and make authorization decisions from context it should never have trusted. The model became an access broker without a reliable server-side authorization boundary.
> Remediation: Web and platform
- [+]Derive account and workspace identity from the authenticated session, never from client-supplied fields.
- [+]Enforce server-side object-level authorization, tenant-aware database policies and quota checks for every read and write.
- [+]Block cross-tenant enumeration, require fresh authorization for destructive actions and log every access decision.
> Remediation: AI and agent tools
- [+]Do not let the agent infer missing identities or choose account and workspace context from user-provided email, IDs or names.
- [+]Apply authorization inside every identity, billing and workspace tool; prompts and system instructions are not security boundaries.
- [+]Hide internal reasoning and raw tool arguments, and require explicit confirmation before sensitive or destructive tool calls.
- [+]Use layered guardrails: validate identity context before the agent, enforce authorization at the tool boundary, and apply output DLP to block cross-tenant data.