Per-User Data Isolation

Scope user-owned AgentOS data and resources to the caller's user ID.

Authorization controls which operations a caller can perform. Per-user data isolation controls access to user-owned rows in built-in AgentOS routes. Opt in with user_isolation=True:

from agno.os import AgentOS

agent_os = AgentOS(
    id="my-agent-os",
    agents=[agent],
    authorization=True,
    user_isolation=True,
)

With verified JWT identity, AgentOS uses the token's sub claim as the user_id:

OperationBehavior with user_isolation=True
User-owned readsScoped to the caller's user_id. Other users' rows are not returned.
User-owned writesuser_id is coerced to the caller's sub. A caller cannot persist rows attributed to another user.
Cancel / resume / continue routesRequire session_id and verify the caller owns the run.
WebSocket reconnectRequires session_id (and workflow_id) for non-admins.

Under the default scope provider, a caller holding admin_scope (default agent_os:admin) bypasses isolation and sees all data. Admins can pass user_id to filter results to one user. Set a custom override with admin_scope="ops:admin". A managed-role or custom-provider admin grant does not automatically bypass per-user isolation: token scopes provide that bypass only when they are an active grant source, such as with trust_token_scopes=True. An admin service-account PAT also bypasses self-scoping.

Some domains expose shared rows with no user_id, including shared knowledge and workspace service-account metadata. A scoped non-admin may read these rows but cannot mutate them. This does not grant access to another user's private rows.

Isolation covers built-in routes only; custom routes must apply Agno's user-scope helpers explicitly.

Isolation is off by default: with user_isolation=False, JWT and scope checks still apply, but data is not scoped per user. Isolation requires a database that records user_id (PostgreSQL recommended for production).

With and Without Authorization

Isolation is a top-level AgentOS flag, separate from authorization, so it can also run without authentication.

With authorizationWithout authorization
User ID comes fromThe token's sub claimThe caller: a user_id query parameter on reads, a form field on runs
A user_id the caller sendsIgnored for scoped callers; admins can use it to filterUsed to scope the request
No user ID403Not scoped; returns every user's data
EnforcementEnforcedAdvisory; callers can choose any ID

os.agno.com sends the signed-in username automatically when authorization is off. The legacy AuthorizationConfig(user_isolation=True) setting is still accepted with authorization=True.

Multitenancy and Shared Resources

Per-user isolation keys ownership to one user ID. It does not create an organization or tenant namespace from arbitrary JWT claims such as tenant_id. Two users in the same tenant remain distinct owners; sharing access between them requires an application policy. Keep subjects unique across tenants when they share an AgentOS database.

ResourceIsolation boundary
Built-in user-owned rows, including sessions, memories, and stored Studio componentsScoped to the verified caller's user_id when isolation is enabled.
Code-defined RegistryShared within the AgentOS instance; GET /registry has no user or tenant filter.
Custom queries, knowledge searches, tool clients, credentials, and filesYour application must select the tenant context and enforce its access policy.

For a shared deployment, verify tenant membership at authentication, use resource permissions or a custom provider to restrict which agents, teams, and workflows callers may access, and apply tenant filters in database queries and tools. Separate AgentOS instances with separate registries, databases, and credentials provide distinct deployment boundaries when required.

Service Accounts

Service account principals (sa:<name>) are always scoped to themselves. The scoping decision runs in this order:

  1. A caller with an authoritative admin scope is never scoped. This includes admin PATs, and JWT scopes when the scope provider is an active grant source.
  2. A service account is scoped to its own sa:<name> principal, even when user_isolation=False.
  3. JWT callers are scoped to their sub only when user_isolation=True.

A machine token stamps its sessions and memories with its own principal, so an unscoped default would read every user's history. If you need a token that reads across users, mint one with the admin scope.

Next Steps

TaskGuide
Issue tokens with the sub claimTokens
Mint machine tokensService Accounts
See the user isolation cookbook exampleuser_isolation.py