Skip to content

[Bug] Multi User Setup - Data Security Issues #2279

@flobaader

Description

@flobaader

We need to have the user_id in a toolkit function in order to get the right data when a user calls an agent.
We have a multi-user setup for agent system to handle permissions and data access.
So basically we create one agent per user:

main function

# Cache to store agent instances
_agent_cache = {}

def get_agent_for_user(user: User):
    # Check if agent exists in cache
    if user.id in _agent_cache:
        return _agent_cache[user.id]

    # Create toolkit instances with user metadata
    personal_toolkit = PersonalTools()
    # Create new agent
    agent = Agent(
        session_id=session_id,
        user_id=user_id,
        tools=[personal_toolkit]
    )

    # Cache the agent instance
    _agent_cache[user.id] = agent
    
    return agent

toolkit

class PersonalToolkit(Toolkit)
...
  async def get_personal_data(self,  agent: Agent) -> str:
     user_id = agent.user_id
      # performs db lookup for the data with the user_id
     return personal_data
...

But we are facing issues with that topic: A multi user setup is not document and it seems like not supported as a first class citizen. We did find the agent parameter in the toolkit only by looking at the code.

We are now facing the issue, that when we have many users, we get the wrong user ids by the agent.

This caused us significant data privacy leaks and security issues.

How can we develop a secure multi user setup using your framework?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions