-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working