> For the complete documentation index, see [llms.txt](https://docs.otari.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otari.ai/tools/configure-code-execution.md).

# Configure code execution

The **Code execution** settings let you control whether requests from a workspace can run generated code in a sandbox. You can follow the deployment defaults or apply more restrictive settings to individual workspaces.

To configure code execution for a workspace:

1. Select the workspace in the top-left corner.
2. Go to **Tools** → **Code execution**.
3. Under **Code executio**n, choose whether it should:
   * **Follow the deployment default**.
   * Be **Allowed** for requests in this workspace.
   * Be **Blocked**, preventing requests from using code execution.
4. Optionally, add a **Prompt hint** to guide how code execution should be used when a request doesn’t provide its own instructions.
5. Set **Max tool-loop iterations** to limit the number of model-to-tool rounds allowed.
6. Set an **Execution timeout** to limit how long a single code execution can run.
7. Configure **Who runs provider code tools** to control whether supported provider-native code tools or the Otari sandbox handle execution.
8. Where available, select the **Sandbox image** used to run code from the options approved for your deployment.
9. Configure which **code-execution tools** the workspace can use.

Workspace settings can restrict what is allowed at the deployment level, but they **cannot enable code execution if no sandbox has been configured for the deployment**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.otari.ai/tools/configure-code-execution.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
