What runs where
What the sandbox provides
The handler signature is always:
What the sandbox forbids
Most of these are obvious from a security standpoint. The execution time and memory limits are platform stability. Work that needs longer than 60 seconds should be split, for example into one tool that starts a job and another that checks on it.
Secrets
Secrets are scoped to the Data Tool, not the project. Different tools can hold different keys — a Stripe key on one tool, a SendGrid key on another. Secrets are encrypted at rest via AWS KMS and never enter the sandbox. Inside the handler,env.secrets.<NAME> is a placeholder string generated for each call. The platform swaps in the real value only in the URL, header values, and string body of an outbound fetch sent over HTTPS, and only to the secret’s bound host when one is set. Code that transforms the value first, such as base64-encoding it for Basic auth or computing an HMAC, works on the placeholder instead.
Allowed domains
The sandbox restricts outbound HTTP to the domains listed on the Data Tool. A handler that tries to fetch from a domain not on the list fails before the request leaves the sandbox. Configure allowed domains on the Data Tool:Execution limits
Default limits per invocation:Task support
Data Tools run synchronously, within the 60-second limit. A Data Tool’s settings include Task Support, but the MCP server doesn’t run MCP tasks yet, so leave it on forbidden, the default. Withoptional or required, the tool advertises task support that hosts can’t use.
Designing for the sandbox
A few principles that come up in practice:- Treat each call as cold. No caching across invocations inside the handler. Cache externally if you need to.
- Fail fast. Validate that secrets exist at the top of the handler. Throw with a useful message — the model sees the error and can adjust.
- Use small, focused handlers. A Data Tool that does one thing well is easier to reason about than one that branches across many APIs.
- Keep responses small.
fetchbuffers the whole response, up to 5 MB.
Debugging
When a handler fails:- The error returns to the test panel, or to the model, which can retry.
- The call appears under Analytics → Recent Executions in Metabind Studio, with its status, error type, and a short snippet of its input, on the Developer plan and up.
console.log output isn’t kept, so put what you need to know in the error message.
Related
Build a Data Tool
The end-to-end Data Tool walkthrough.
Governance
Where sandboxed execution fits in the broader governance model.
Testing tools
Run a Data Tool in Metabind Studio before you publish.
BindJS Reference
defineDataSource and the property system.