{"record":{"id":"a41444cfdaa751b2","repo":"ComposioHQ/composio","slug":"pass-either-sandbox-or-workbench-not-both-w","errorCode":null,"errorMessage":"Pass either `sandbox` or `workbench`, not both. `workbench` is a backwards-compatible alias for `sandbox`.","messagePattern":"Pass either `sandbox` or `workbench`, not both\\. `workbench` is a backwards-compatible alias for `sandbox`\\.","errorType":"validation","errorClass":"InvalidParams","httpStatus":null,"severity":"error","filePath":"python/composio/core/models/tool_router.py","lineNumber":881,"sourceCode":"\n            # Create a session with sandbox config\n            session = tool_router.create(\n                user_id='user_123',\n                sandbox={\n                    'enable_proxy_execution': False,\n                    'auto_offload_threshold': 300\n                }\n            )\n\n            # Use the session\n            tools = session.tools()\n            connection = session.authorize('github')\n            toolkit_states = session.toolkits()\n            ```\n        \"\"\"\n\n        if sandbox is not None and workbench is not None:\n            raise InvalidParams(\n                \"Pass either `sandbox` or `workbench`, not both. \"\n                \"`workbench` is a backwards-compatible alias for `sandbox`.\"\n            )\n\n        sandbox_config: t.Optional[ToolRouterSandboxConfig] = (\n            sandbox if sandbox is not None else workbench\n        )\n\n        direct_tools_preset = session_preset == SESSION_PRESET_DIRECT_TOOLS\n        manage_connections, sandbox_config, preload = _apply_session_preset_defaults(\n            session_preset=session_preset,\n            manage_connections=manage_connections,\n            workbench=sandbox_config,\n            preload=preload,\n        )\n        default_custom_preload = _preloads_all_custom_tools(preload)\n\n        # Parse manage_connections config","sourceCodeStart":863,"sourceCodeEnd":899,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/python/composio/core/models/tool_router.py#L863-L899","documentation":"Guard in ToolRouter.create() preventing passing both sandbox and workbench. workbench exists only as a backwards-compatible alias for sandbox, so supplying both is ambiguous and rejected immediately with InvalidParams before any API call.","triggerScenarios":"Calling ToolRouter.create(sandbox=cfg, workbench=cfg) — typically after a rename/migration where both the old and new keyword are set from merged config dicts.","commonSituations":"Code updated to the new `sandbox` name while a shared helper still injects `workbench`, or combining default kwargs with user overrides.","solutions":["Pass only one of the two keywords (prefer sandbox)","When merging configs, drop the workbench key if sandbox is present"],"exampleFix":"# before\nparams['workbench'] = wb\nparams['sandbox'] = sb\nrouter.create(**params)\n\n# after\nparams['sandbox'] = sb\nrouter.create(**params)","handlingStrategy":"validation","validationCode":"params.pop('workbench', None) if 'sandbox' in params else None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize on sandbox keyword","Drop legacy workbench key during migration"],"tags":["python","tool-router","sandbox","invalid-params"],"backgroundTag":"conflicting-parameters","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}