- Duale AI
- Documentation
- Agent harness
- Code Execution
Code Execution: machine lifecycle and boundaries
Describes how a Task's code execution machine persists files between runs, its lifecycle across continuations, and its network boundaries.
This page covers machine persistence, application output, run limits, Library document copying, and network access for Code Execution Tasks.
- Machine persistence across runs, Executors, and continuations.
- Application output and what reaches your application.
- Run limits and SDK Tool alternatives for long work.
- Copying Library documents into the Task machine.
- Network access and credential handling for code runs.
Summaries were generated by AI.
Code Execution lets a Task run Python or JavaScript, for example for calculations, data transformation, or checks of generated code. Each Task has its own machine for this code, and the machine keeps its files from one run to the next. Describe the result you need in the Task instruction: the model decides when to run code, writes it, and chooses its language and packages.
What the Task’s machine keeps
The model sends code to the machine in runs. The first run on a new machine sets its language for the machine’s whole life; a continuation’s copy keeps its parent’s language.
- Between runs: the machine keeps its files and installed packages, so later runs can use them.
- Across Executors: all Executors of the Task share the machine, and their runs and document copies take turns on it.
- In a new Task: the machine starts empty, even under the same Agent Identity.
- In a continuation: the machine starts as its own copy of the parent’s machine, made at the continuation’s first run or document copy. When the parent has no machine, for example because it never ran code, the machine starts empty.
- When the Task asks for a new machine: a new, empty machine takes its place, and Duale AI erases the old one.
- After its last use: Duale AI erases the machine once its lifetime ends.
To start again on an empty machine, ask for one in the Task instruction.
What reaches your application
A run returns only its printed output to the Task. Files on the machine never reach your application, so ask for the data you need in the Task’s answer or its response format.
Plan around the limits
Each run has a time limit and a printed-output limit, and the machine has a fixed size. Run code gives each limit and what happens at it. For long or large work, publish an SDK Tool that does the work, and ask for that Tool in the Task instruction.
Copy Library documents into the machine
The Task can copy into its machine the Library documents that its Agent Identity can read. These include the documents
that you attach to the Task. Each copy holds the document’s extracted text, and also the
original file when it fits on the machine. The Task can copy a document only once it is ready.
Duale AI checks the Agent Identity’s read access at each copy. A copy stays on the machine when that access ends or when you delete the document. A continuation that copies the machine also gets the document copy. Copies that outlive a delete states how long it stays.
What a code run can reach
The machine reaches only the public package registries of its language, so a run cannot connect to your systems.
A run can send data that the Task holds to those registries. Data protection states what reaches them. When a Task must read or change one of your systems, publish an SDK Tool for that work. Then ask for that Tool in the Task instruction.
Put credentials in your SDK Tools, and leave them out of the Task instruction and its documents. Code can copy a credential into the machine, where it stays for later runs and continuations, and a run can send it to a registry.