AI
Data report in a sandbox: inspect → analyse → run → report → approve
Attach spreadsheets to the task and ask a question. In an isolated container, the AI writes a small analysis script, the sandbox runs it (errors go back to the AI to fix), and the AI reports only the numbers the script printed. Charts, tables and the script are attached to the task.
- Runs inAssignee's computer
- ReadsTask + its context
- Verified by2 automatic checks · 1 approval
- Limits60 min a run · 10 min a step · may ask people
- DeliversComment on the task
4 things to check
Start
The assignee presses Run on their task. Their connected computer picks the run up and does each step there, with their coding agent.
Advanced: what an instruction can point at
- {{task}}
- the task: code · title · description (up to 4,000 characters), then its context: the project and its week, parent task, subtasks, recent comments, files, documents it names, similar tasks (up to 6,000 characters).
- {{previous}}
- the last result before the step (an AI step's or a command's), with any notes approvers gave since; up to 8,000 characters.
- {{steps.key}}
- an earlier step's result, by its key.
- {{input.key}}
- what the person filled in at Run for that field.
- {{resources}}
- the playbook, pages, text files and the list of other files and links (up to 20,000 characters); added before the instruction when not placed.
- {{answers}}
- the answers people gave to the run's questions so far; added at the end when the instruction doesn't place them.
1Look at the filesRun a command
$ python - <<'PY' import glob import pandas as pd files = sorted(glob.glob('../assets/*')) print(len(files), 'file(s) in ../assets') for f in files: print('==', f) try: df = pd.read_excel(f) if f.lower().endswith(('.xlsx', '.xls')) else pd.read_csv(f, sep=None, engine='python') print('rows, columns:', df.shape) print(df.dtypes.to_string()) print(df.head(8).to_string()) except Exception as e: print('not a table:', e) PYRuns in the working folder on the assignee's computer. Its output is the step's result; a non-zero exit stops the run as failed.
2Write the analysisAsk the AIsonnet2
- Model
sonnetpassed to the agent (--model)- Role
A data analyst: careful with types, dates and missing values; shows the work.
- Gets
- Task + contextResult of step 1Input: question, period
- Result goes to
- checked at Step 3 · The analysis runs
- Tools
- The agent's own: its MCP servers, skills and the files in the working folder.
- Questions
- May ask the people on the task before it works, and again after their answers (up to 3 rounds).
- Limits
- 15 min a step
Instruction
Write analysis.py in this folder; do not run it (it runs in the next step, in a container with pandas, matplotlib and openpyxl). It answers this question: {{input.question}} (period: {{input.period}}). The script must: read the data files from ../assets (their names, columns and first rows are below); clean what needs cleaning and print what it dropped or assumed; print every result as a clearly labelled table or line under a "## " heading; save each table as CSV and each chart as PNG in ../out (matplotlib with the Agg backend); never read anything outside ../assets and never use the network. Then reply with a three-line summary of what the script computes. Files: {{steps.inspect}} {{task}}
Show what the model receivesHide what the model receives
A coding agent gets no system prompt from the workspace: the role goes at the top of its input.
user
Your role for this step: A data analyst: careful with types, dates and missing values; shows the work. Write analysis.py in this folder; do not run it (it runs in the next step, in a container with pandas, matplotlib and openpyxl). It answers this question: {{input.question}} (period: {{input.period}}). The script must: read the data files from ../assets (their names, columns and first rows are below); clean what needs cleaning and print what it dropped or assumed; print every result as a clearly labelled table or line under a "## " heading; save each table as CSV and each chart as PNG in ../out (matplotlib with the Agg backend); never read anything outside ../assets and never use the network. Then reply with a three-line summary of what the script computes. Files: result of step 1 task + context (the answers to the run's questions, when there are any) If something essential to this step is unclear and you cannot make a reasonable assumption, do not guess. Instead reply with only this block and stop: ```workspace-ask {"questions": [{"text": "<your question>", "options": ["<answer A>", "<answer B>"], "default": "<answer A>"}, {"text": "<another question>", "default": "<your best guess>"}]} ``` At most 5 short questions, in the language of the task, all at once. Ask again after the answers only about something new they raise. First use the context above and the answers so far; never ask what they already say. Give "options" when the possible answers are known, and "default" with your best guess from the context, so people only correct it. The people on the task answer, then this step runs again with their answers. Ask only when it matters; otherwise do the step. (when an approver sent the result back: their request and the previous result)
- {{input.question}} is not one of the workflow's inputs: the model reads it as written.
- {{input.period}} is not one of the workflow's inputs: the model reads it as written.
3The analysis runsCheck automatically
$ python analysis.py > ../out/results.txt 2>&1 || { tail -n 40 ../out/results.txt; exit 1; }- Judge
- Exit code 0 passes; anything else fails and its output is the issue list.
- If it still fails
- Sends the work back to Step 2 · Write the analysis up to 3 times. The run fails and says why.
4Collect the resultsRun a command
$ cp analysis.py ../out/ && cat ../out/results.txtRuns in the working folder on the assignee's computer. Its output is the step's result; a non-zero exit stops the run as failed.
5Write the reportAsk the AIsonnet2
- Model
sonnetpassed to the agent (--model)- Role
A finance analyst writing for a manager who has five minutes.
- Gets
- Result of step 4Input: question, period
- Result goes to
- checked at Step 6 · Report is sound · shown to the approver at Step 7 · Approve · delivered when the run ends
- Tools
- The agent's own: its MCP servers, skills and the files in the working folder.
- Questions
- May ask the people on the task before it works, and again after their answers (up to 3 rounds).
Instruction
Write the report in Markdown from the script's output below, answering: {{input.question}} (period: {{input.period}}). Sections: ## Answer (three sentences at most), ## Key numbers (a table), ## What stands out (three to five points, each with its number), ## Data notes (what was dropped or assumed, as the script printed), ## Files (the charts and tables saved, by file name). Every number must appear in the output below exactly; do not compute new numbers, do not explain causes the data does not show. Do not change any file. Script output: {{previous}}
Show what the model receivesHide what the model receives
A coding agent gets no system prompt from the workspace: the role goes at the top of its input.
user
Your role for this step: A finance analyst writing for a manager who has five minutes. Write the report in Markdown from the script's output below, answering: {{input.question}} (period: {{input.period}}). Sections: ## Answer (three sentences at most), ## Key numbers (a table), ## What stands out (three to five points, each with its number), ## Data notes (what was dropped or assumed, as the script printed), ## Files (the charts and tables saved, by file name). Every number must appear in the output below exactly; do not compute new numbers, do not explain causes the data does not show. Do not change any file. Script output: result of step 4 (the answers to the run's questions, when there are any) If something essential to this step is unclear and you cannot make a reasonable assumption, do not guess. Instead reply with only this block and stop: ```workspace-ask {"questions": [{"text": "<your question>", "options": ["<answer A>", "<answer B>"], "default": "<answer A>"}, {"text": "<another question>", "default": "<your best guess>"}]} ``` At most 5 short questions, in the language of the task, all at once. Ask again after the answers only about something new they raise. First use the context above and the answers so far; never ask what they already say. Give "options" when the possible answers are known, and "default" with your best guess from the context, so people only correct it. The people on the task answer, then this step runs again with their answers. Ask only when it matters; otherwise do the step. (when an approver sent the result back: their request and the previous result)
- {{input.question}} is not one of the workflow's inputs: the model reads it as written.
- {{input.period}} is not one of the workflow's inputs: the model reads it as written.
6Report is soundCheck automaticallyChecks Step 5 · Write the report
- Judge
- The agent's default modelwhatever the connected computer's agent uses
- Requirements
- Starts with a direct answer of at most three sentences
- Has a table of key numbers with units or currency
- Every point under What stands out carries a number
- States no cause or forecast as fact
- Has a section on what was dropped or assumed in the data
- If it still fails
- Sends the work back to Step 5 · Write the report once. The run goes on with the issues on record, for the approver to see.
7ApproveWait for approvalAnyone who may edit the task · Step 5 · Write the report
- Who
- Anyone who may edit the task
- Can
- Approve: the run goes on; a note is passed to the next step.
- Ask for changes: Step 5 · Write the report runs again with the request, then every step after it.
- Stop the run.
End
The result of step 5 · Write the report is delivered: Comment on the task.