fix: dont default to default user id when executing custom tools #1889
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Require explicit
user_idfor toolkit-backed custom toolsSummary
Removes unsafe default-fallback behavior in custom tool execution and clarifies CrewAI integration patterns.
Changes
Security fix in
python/composio/core/models/custom_tools.py:"default"inCustomTool.__call__ValueError("user_id is required when invoking toolkit-backed custom tools")whenuser_idis missingProblem solved
"default"user whenuser_idwas omitted, potentially accessing wrong connected accountsBreaking change
user_iduser_idincomposio.tools.get(user_id=...)callsFiles changed
python/composio/core/models/custom_tools.py- Enforce explicituser_id, remove default fallbackNote
Enforces explicit user_id for toolkit-backed custom tools and raises an error if missing, removing the previous "default" fallback.
python/composio/core/models/custom_tools.py):CustomTool.__call__: remove fallback to"default"foruser_id.user_idwhentoolkitis set; raiseValueErrorif omitted.Written by Cursor Bugbot for commit 444bfb9. This will update automatically on new commits. Configure here.