workbench_run_python
Run Python in an isolated sandbox to process LARGE or paginated tool results without pulling every row into the conversation. Inside the code, call your connected integration tools with call_tool('ext<id>_<name>', {..}). RETURN SHAPE: call_tool ALWAYS returns a dict with a boolean r['success']. O...
This record as markdown: /tools/io-github-saloprj-dialogbrain/workbench-run-python.md
What workbench_run_python does on Dialogbrain
AI agents invoke workbench_run_python to trigger actions in Dialogbrain. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.
| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Python source to execute. call_tool('ext<id>_<name>', {..}) returns the integration's raw dict — HTTP success payload is under r['body'] (e.g. r['body']['result |
agent_id | integer | — | Which agent's tool policy the sandbox runs under — this scopes which ext* integrations call_tool may reach (enabled + denied_tools for that agent). Only needed |
Parameters from the server's own tool schema.
Why workbench_run_python is rated High
Executing arbitrary Python code in a sandbox, even isolated, is an Execute-category risk. While the sandbox provides some containment, the tool permits calling other integration tools (WhatsApp, Telegram, Email, voice) from within executed code, potentially allowing an AI agent to chain operations across multiple communication channels and data sources.
From the tool's definition Tool explicitly allows to "Run Python in an isolated sandbox" and states "Inside the code, call your connected integration tools with `call_tool(...)`".
Risk signalsAccepts freeform code/query input (code) · Bulk/mass operation — affects multiple targets
Attacks that exploit this kind of access
The rule that runs workbench_run_python safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Dialogbrain, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For workbench_run_python, this is the rule to start with:
workbench_run_python stays usable, but rate-capped: a runaway agent can't fire it dozens of times a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Dialogbrain, apply this rule, and every workbench_run_python call is checked against it from then on.
Questions about workbench_run_python
Run Python in an isolated sandbox to process LARGE or paginated tool results without pulling every row into the conversation. Inside the code, call your connected integration tools with call_tool('ext<id>_<name>', {..}). RETURN SHAPE: call_tool ALWAYS returns a dict with a boolean r['success']. On SUCCESS the API's JSON is under r['body'], e.g. {'success': True, 'status': 200, 'body': {'results': [{'title': ...}, ...]}} — so read r['body']['results']. On FAILURE r['success'] is False and r['error'] explains. If unsure of the shape, print(r) once and inspect before extracting. Aggregate/filter/paginate in the sandbox, then assign ONLY the small summary you want back to a variable named result. FIRST discover exact tool slugs with integrations_search_tools, THEN write code that calls them. pandas/numpy available. It is categorised as a Execute tool in the Dialogbrain MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
workbench_run_python accepts 2 parameters: code, agent_id. Required: code. The full parameter table on this page comes from the server's own tool schema.
Register the Dialogbrain MCP server in PolicyLayer and add a rule for workbench_run_python: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Dialogbrain. Nothing to install.
workbench_run_python is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the workbench_run_python rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for workbench_run_python. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
workbench_run_python is provided by the Dialogbrain MCP server (https://api.dialogbrain.com/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Dialogbrain, and thousands of servers like it.
Across the catalogue