ComposioHQ/composio · error · InvalidParams

Pass either `sandbox` or `workbench`, not both. `workbench`

Error message

Pass either `sandbox` or `workbench`, not both. `workbench` is a backwards-compatible alias for `sandbox`.

What it means

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.

Source

Thrown at python/composio/core/models/tool_router.py:881

            # Create a session with sandbox config
            session = tool_router.create(
                user_id='user_123',
                sandbox={
                    'enable_proxy_execution': False,
                    'auto_offload_threshold': 300
                }
            )

            # Use the session
            tools = session.tools()
            connection = session.authorize('github')
            toolkit_states = session.toolkits()
            ```
        """

        if sandbox is not None and workbench is not None:
            raise InvalidParams(
                "Pass either `sandbox` or `workbench`, not both. "
                "`workbench` is a backwards-compatible alias for `sandbox`."
            )

        sandbox_config: t.Optional[ToolRouterSandboxConfig] = (
            sandbox if sandbox is not None else workbench
        )

        direct_tools_preset = session_preset == SESSION_PRESET_DIRECT_TOOLS
        manage_connections, sandbox_config, preload = _apply_session_preset_defaults(
            session_preset=session_preset,
            manage_connections=manage_connections,
            workbench=sandbox_config,
            preload=preload,
        )
        default_custom_preload = _preloads_all_custom_tools(preload)

        # Parse manage_connections config

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Pass only one of the two keywords (prefer sandbox)
  2. When merging configs, drop the workbench key if sandbox is present

Example fix

# before
params['workbench'] = wb
params['sandbox'] = sb
router.create(**params)

# after
params['sandbox'] = sb
router.create(**params)
Defensive patterns

Strategy: validation

Validate before calling

params.pop('workbench', None) if 'sandbox' in params else None

Prevention

When it happens

Trigger: 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.

Common situations: Code updated to the new `sandbox` name while a shared helper still injects `workbench`, or combining default kwargs with user overrides.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/a41444cfdaa751b2. Report an issue: GitHub.