On this page
Local Just-in-Time Tool
Workflow reference | Local browser execution
Kind: LocalJitTool
Configuration object: localJitTool
Use Local Just-in-Time Tool for model-callable JavaScript computations in a fresh isolated browser worker. In its default local mode, it requires a connected browser and has no Azure deployment or tool credential.
Inputs
The incoming typed task is wrapped in a JIT capability descriptor. Connect that complete JSON descriptor to a Model, Responses, Chat Completions, or Multi-turn step. The model must explicitly create a tool and invoke its returned tool ID with an input object.
Pass all required task data through the explicit tool input. Each invocation has fresh state. Network access, Node.js APIs, package installation, imports, DOM access, persistent browser storage, files, Web Crypto, credentials, and application state are unavailable.
Configuration
| Property | Default | Allowed values or behavior |
|---|---|---|
maximumTools |
8 |
1-16 unique tool versions. |
invocationTimeoutSeconds |
30 |
1-120 seconds. |
contractVersion |
1 |
1 or 2; see tool-definition contracts. |
maximumInvocations |
64 |
1-6,400 executions, including examples. |
maximumConcurrentInvocations |
2 |
1-8, no greater than the invocation budget. |
maximumRepairs |
1 |
0-8 replacement versions. |
requireRootCoordinator |
true |
Require provider-attributed root authority in native multi-agent mode. |
allowAsyncOperations |
false |
Expose bounded start, await-many, and cancel operations. |
returnExecutionErrors |
true |
Return supported structured execution errors for model correction. |
The JavaScript entry point is module.exports = async function(toolInput) { ... }. Local definitions require toolCodeLanguage: "JavaScript" and toolExpectedDuration: "short".
Outputs must be plain JSON values. Undefined values, functions, BigInt, cycles, non-finite numbers, custom serialization, and non-JSON objects are rejected. Source is limited to 128 KiB UTF-8; input and output JSON are each limited to 256 KiB.
An optional shared sandboxNodeId deliberately redirects this capability to an ACA Sandbox. That configuration uses the referenced remote instance and its runtime/approval requirements. Leave the reference unset for browser-local execution.
Outputs
The descriptor contains kind: "benchius-jit-capability", jitToolId, toolSpecification, contractVersion, task, and backend: "LocalBrowser". It has no Azure resource-group or execution-profile fields.
Execution evidence and actual tool results are delivered through model tool calls. With async operations enabled, start returns an operation ID; every operation must be observed through await before the model completes. Operations are scoped to the connected run.
Example
{
"id": "local-calculations",
"name": "Expose local calculation tools",
"kind": "LocalJitTool",
"localJitTool": {
"maximumTools": 4,
"invocationTimeoutSeconds": 30,
"contractVersion": 2,
"maximumInvocations": 32,
"maximumConcurrentInvocations": 2,
"maximumRepairs": 1,
"returnExecutionErrors": true
}
}
Connect it to a model whose task requires a bounded computation. Version-2 tool examples execute in the same browser isolation boundary before that tool becomes ready.
Hosting and lifetime
Browser-local tools work in Workflow Studio Preview and the packaged Aspire dashboard, including supported PWA Preview. Headless clients cannot supply the browser execution context. Foundry Agent, Microsoft 365 Copilot, and Copilot Studio headless exports reject browser-local steps.
Workers run inside an opaque-origin sandbox with a restrictive policy. This boundary limits access to application state and external services; it does not establish a hard heap quota or eliminate browser-engine risk.
Stop, timeout, navigation, and finalization terminate active workers and release their frames and ports. Keep the page connected. Interrupted runs cannot resume stale capability IDs, and disconnected cleanup is reported as unconfirmed. See Local browser JIT execution for detailed isolation, capacity, hosting, and export constraints.