Should an agent tool take a workspace_id argument for Sume calls?
No. Sume's safe-automation guidance says the API key or app session selects the workspace and tools must not take a workspace id from the user.

Do not add a workspace_id parameter to a tool that calls Sume. The Sume safe-automation guidance states that the API key or the app session selects the workspace, and that tools must not accept a workspace id from the user. The only stated exception is a product that explicitly supports a change between workspaces. For a custom agent tool, the workspace is whichever one the credential belongs to.
Why the rule exists
If a model can name a workspace, then a prompt that says "use workspace X" becomes an attempt to cross a boundary, and your code has to defend against it on every call. If the credential alone decides, the question never arises: a key for workspace A cannot spend or read in workspace B.
It also keeps billing clear. Generation and analysis creation can spend credits, so the guidance asks that agent tools make those actions explicit and keep read-only operations separate.
| Topic | Rule |
|---|---|
| Workspace | Chosen by the API key or app session; never a user-supplied id |
| Spending | Make credit-spending actions explicit; keep reads separate |
| Hosted MCP browsing | Prefer OAuth mcp:read |
| Hosted MCP paid tools | Grant mcp:write or use an API key; send idempotency_key |
| Safe to log | Request ids, job ids when necessary, high-level status, sanitized media metadata |
| Never log | API keys, signed URLs, raw private media URLs, large user content or transcripts |
What this means in a tool definition
If one agent really must serve several workspaces, make the choice of workspace a deployment decision outside the model, for example a separate configuration per customer, rather than a parameter the model fills in.
- Give the tool inputs for the creative parameters only, such as prompt, duration and model.
- Read the Sume key from the server environment, never from model-visible arguments.
- Use one key per workspace, and run separate tool instances if an agent serves two workspaces.
- Return job ids and statuses to the model, not signed media URLs, unless it needs them to continue.
Checking the boundary
After wiring a new tool, call a read-only endpoint such as the account or balance route with each key and confirm that each returns its own workspace. Do that before the tool is allowed to submit paid work, so a mixed-up key shows up as a harmless read.
Where this shows up in practice
Teams often build a helper such as create_video(workspace, prompt) because a model asked for it in a demo. Replace it with create_video(prompt, duration) and a client constructed once per workspace. The change is small, and it removes a whole class of prompt-injection attempts that try to redirect work to a different workspace.
Hosted MCP follows the same shape: the OAuth session or API key you connect with fixes the workspace, and mcp_health reports the credential in use. There is no argument to switch.
Sources
Related posts
More in Agents
- Animate a product photo with Agent Completions: $0.625 on Wan 3.0
Send one input_image and ask the Sume agent for a 5-second Wan 3.0 clip at 720p: $0.625 at $0.125 per second. Cap 1 is enough. Body and limits.
- Sume API key with actions:read only: list schedules, not start runs
A Sume key with actions:read can list and read schedules and runs. Starting or canceling a run needs actions:write; keys made before the trigger lack both.
- How to cap an AI video agent's spend: five limits, in order
A video agent has five separate limits: model budget, turns, per-call max_spend_usd, run cap and plan queue. Which stops a runaway Sume job, and which does not.
- Agent SDK verbatim_prompts vs Sume Agent Completions input
The Claude Agent SDK verbatim_prompts option stops @path and slash expansion of user text. Sume Agent Completions keeps input as data in a file. Compare them.
Written by Sume