Code Execution
Code Execution lets Hatz run Python in a secure sandbox so it can analyze data, transform files, create charts, and generate downloadable outputs such as spreadsheets, documents, presentations, PDFs, images, text files, and zip files.
For most users, the easiest way to use Code Execution is to turn on Auto-Tool. Auto-Tool selects the tools needed for the request, including Code Execution when the task requires file generation or code-backed analysis. When you upload document files, Hatz should also bind Code Execution automatically for document work.
For document editing examples, see AI Document Editing with Code Execution.
When to use Code Execution
Analyze, clean, filter, merge, or summarize CSV and Excel files.
Create charts, tables, reports, and data exports.
Generate or edit Word documents, PowerPoint decks, PDFs, and spreadsheets.
Convert files into another supported format.
Run calculations or code-backed checks that need more precision than a normal chat response.
Package multiple outputs into a zip file for download.
How to use it
Turn on Auto-Tool before sending your request.
Upload the file or files you want Hatz to work with, if the task uses attachments.
Tell Hatz exactly what to produce and what filename or file type you want.
Download the result from the Generated file card when the output is ready.
If your workspace shows manual tool selection, you can also select Code Execution directly.
How downloadable outputs work
When Hatz successfully saves a generated file, the output appears as a Generated file card in chat, an app response, or a workflow run. Use the download button on that card. Images may also preview inline.
A sandbox path such as /home/daytona/workspace/output/report.xlsx is not a browser link. It means the file exists inside the Code Execution workspace. If you see a path instead of a generated file card, ask Hatz to create a downloadable file for that exact path or rerun the request with Auto-Tool on.
Prompt examples
Use Code Execution on this spreadsheet. Clean duplicate rows, add a summary sheet, save the result as cleaned_data.xlsx, and return it as a downloadable file.Create a chart from this CSV, save it as revenue_chart.png, and return the generated file.Update this PowerPoint with the attached notes, save the updated deck as final_presentation.pptx, and return the downloadable file.If you create multiple files, put them into deliverables.zip and return the zip file.
Common output types
Documents:
.docx,.pdf,.txtSpreadsheets:
.xlsx,.csvPresentations:
.pptxImages and charts:
.png,.jpgBundles:
.zip
Important limitations
Code Execution creates new output files. It does not overwrite your original upload.
Password-protected or encrypted files must be unlocked before Hatz can process them.
Complex visual layouts, PDFs, and PowerPoint files may not convert or reflow perfectly.
Macro-enabled files are not supported for macro execution.
Formula recalculation should be requested explicitly when you need it.
Generated files are available for a limited time. If a file is no longer available, rerun the request or ask Hatz to regenerate it.
Troubleshooting
If Hatz says it created a file but no generated file appears, turn on Auto-Tool and rerun the request.
If Hatz returns a sandbox path, ask it to create a downloadable file for that exact path.
If generated files could not be saved, try fewer outputs, smaller files, a common file type, or one zip file.
If a download fails, see Can't Access File Generated In Chat.
