AI agents invoke sandbox.run_js to trigger actions in Dynamic. 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.
This tool directly executes JavaScript code, which is a code execution action. While sandboxing provides some isolation, the tool still triggers external operations (JavaScript evaluation) whose effects depend on the provided code arguments. This makes it Execute rather than Read or Write. It is not Destructive (no irreversible deletion), not Financial, and not Other.
From the tool's definition Tool description explicitly states 'run JavaScript in an existing sandbox session' and 'Install dependencies'. The tool executes arbitrary code within a sandbox environment.
Attacks that exploit this kind of access
Install dependencies and run JavaScript in an existing sandbox session. It is categorised as a Execute tool in the Dynamic MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
Register the Dynamic MCP server in PolicyLayer and add a rule for sandbox.run_js: 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 Dynamic. Nothing to install.
sandbox.run_js 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 sandbox.run_js 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 sandbox.run_js. 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.
sandbox.run_js is provided by the Dynamic MCP server (mcpland/dynamic-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
sandbox.run_js is one line of Dynamic's registry record.
The record carries the whole server: verified identity, auth posture, risk grade, every tool classified, recommended policy — re-checked continuously.
Teams ship this data inside their own products. See what a licence covers →