Join our Newsletter — 33% off our NHI Course
Home› FAQ› Architecture & Implementation› How should security teams bind each agent tool…
Architecture & Implementation

How should security teams bind each agent tool call to the signed-in user in multi-user applications?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated November 2, 2026 Domain: Architecture & Implementation

Build the tool surface per request and capture the acting user in a closure, not in a tool parameter. Resolve identity server-side from the session, then let every tool call run with that captured context. This prevents prompt injection or malformed input from switching tenants, because the model never gets a field it can use to name a different user.

Binding each tool call to the signed-in user

The safest pattern is to treat the signed-in user as server-side context, not as user-supplied data. Build the tool surface per request, capture the acting user in a closure, and resolve identity from the session before any tool executes. That keeps the model focused on intent while the application owns the authority to decide whose data and actions are in scope.

That design matters because multi-user agent systems fail when the user identity becomes just another argument the model can manipulate. If a prompt injection or malformed input can change the named user, the tool layer has already lost the trust boundary. Binding the user outside the tool signature removes that attack path and makes tenant switching a server decision, not a model decision.

In practice, this is strongest when the tool implementation also checks tenant scoping on every state-changing action. Read-only tools may still leak data if they accept a user field, but write tools are the larger risk because they can move funds, alter records, or create side effects under the wrong principal. The same closure-based pattern also makes audit logs more trustworthy because every call can be stamped with the session identity that actually authorized it.

Risk and Threat Considerations

Multi-user agent applications are exposed to tenant breakout, confused-deputy behaviour, and cross-account action if the tool layer trusts a model-provided user identifier. Prompt injection does not need to break authentication to be dangerous here, it only needs to steer the model toward a different target identity that the backend mistakenly accepts.

Failure mechanism: The application passes user identity through a tool parameter, the model or prompt content rewrites that field, and the tool executes under the wrong tenant or account context.

Impact: A single compromised prompt path can produce unauthorized reads, writes, or privileged actions across tenants, and the resulting audit trail may misleadingly show a valid tool invocation instead of a policy failure.

What Good Implementation Looks Like

Good implementations separate intent from authority. The model can choose which tool to call, but the server determines which user the call belongs to and what that user may touch. That means the tool contract should not expose a free-form actor field, and the backend should reject any attempt to override the server-captured principal.

For higher-risk workflows, teams should also bind tool execution to an explicit session state, not just a username. That helps when the same person has multiple concurrent sessions, when step-up authentication is required, or when an app uses delegated access to act on behalf of a user.

Where the workflow crosses service boundaries, teams should prefer a consistent delegation model rather than ad hoc propagation of identity fields. The goal is that each hop can prove which session initiated the action, which identity is acting, and whether the tool is allowed to perform that action in that tenant.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseTool calls bound to the wrong user are a privilege-abuse risk in agentic apps.
Recommendation — Bind tool execution to server-side identity and reject model-supplied principal changes.
NIST SP 800-53 Rev 5IA-2 — Identification and Authentication (Organizational Users)The answer depends on authenticating the signed-in user before tool execution.
AC-6 — Least PrivilegeEach tool call should run only with the user authority actually needed for that session.
Recommendation — Resolve the acting user from the authenticated session before invoking tools. Scope each tool call to the minimum authority required for the captured session identity.

Practitioner Guidance

What to verify: Confirm that no tool schema exposes a mutable user, tenant, or account selector, and test that malformed prompts cannot change the session-bound principal. A good red-team check is to ask the model to act for a different user and verify that the server ignores the request.

Decision rule: If a tool can change data or trigger side effects, treat server-side principal resolution as mandatory, not optional. If the tool is read-only but still tenant-scoped, apply the same pattern anyway because cross-tenant disclosure is still a security failure.

Practitioner takeaway: The model should choose actions, but the application must choose identity. If identity is not bound outside the model, the tool layer is trusting the least trustworthy part of the stack to decide who is allowed to act.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 2, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org