Analysis
On this page
- When Strata reaches for analysis
- What the sandbox can do
- Shell commands
- Working with uploaded data
- The action-step panel for an analysis
- Sandbox security
- What the code can reach
- What is kept, and for how long
- Resource limits
- Who can use analysis (admins)
- What analysis cannot do here
- Examples you can try
- What can go wrong
- Related
Analysis is Strata's ability to write and run code in an isolated sandbox — for math, transforms, advanced visualizations, and any task the pre-built tools cannot cover. Everywhere in the product it is called Analysis; the sandbox itself runs Python, which matters only if you are an administrator reviewing what it can reach.
#When Strata reaches for analysis
Strata runs an analysis automatically when:
- You ask for a chart or image that the inline
chartblock cannot produce — heatmaps, multi-panel layouts, annotated plots, infographics drawn with PIL. - You ask explicitly: "use Python", "do this in Python", "compute X with Python".
- Data needs a transform too custom for a SQL query (statistical fits, regressions, custom aggregations, dataframe gymnastics).
- A file you uploaded needs programmatic processing (parsing a binary, splitting a multi-sheet workbook, generating a derived file).
The action step in the trail is named by what the code does, in the words Strata gives it, for example Chart weekly sales by region; an analysis Strata did not describe reads Running analysis…. Analyses run one after another fold into one row, Ran 2 analyses, that opens to each of them.
A figure worked out in an analysis is one the analysis printed. When a run fails, or prints no figure, Strata does not give a figure as calculated: it runs the calculation again and answers from what it prints, or says plainly that the figure was not worked out. An answer that still gives a figure no run printed, and that you never gave, is sent back once to be calculated before you see it.
#What the sandbox can do
- A broad pre-installed library set. Data and modeling: pandas, numpy, scipy, scikit-learn, statsmodels, sympy, networkx, joblib. Plotting: matplotlib, seaborn, plotly, pillow (PIL), wordcloud. Files and documents: openpyxl, xlsxwriter, xlrd, pyarrow, python-docx, python-pptx, pypdf, pdfplumber, reportlab, lxml, beautifulsoup4, html5lib, markdown, jinja2, sqlalchemy.
- Extra libraries on demand. When a task needs a library that is not pre-installed, Strata can name it and the platform installs it from PyPI into that run before the code executes — so you can ask for work that depends on a package like
yfinanceorgeopandaswithout any setup. The platform fetches the package, not the code. If a requested package cannot be installed, the import errors and Strata falls back to another approach. An organization can turn this off (see What the code can reach). - Files and variables kept for the conversation, as in Claude. Top-level variables — dataframes, dicts, numbers, lists, numpy arrays, scipy matrices, fitted scikit-learn models — are pickled and restored on the next call, and files written under
/workspacestay with the conversation for up to 30 days from its first analysis. The sandbox itself goes to sleep after about 30 idle minutes and wakes on the next run with everything where it was. So Strata can load and clean in one step, then aggregate and plot in another, today or next week, reusing the samedf. See What is kept, and for how long. - A writable file workspace.
/workspace/outputs/holds files meant for you — anything registered there can be returned as a download or rendered inline — and/workspace/scratch/is working space. A conversation's sandbox starts empty; see Working with uploaded data for how files you attach reach an analysis. - Inline rendering of images.
.png,.jpg,.jpeg,.gif,.svg,.webp,.bmpsaved to/workspace/outputs/and registered withstrata_runtime.present_file()render directly in the chat as image cards. - Download cards for other file types. Excel, PDF, PPTX, DOCX, Markdown, CSV, JSON, ZIP all become download cards.
- HTML routed to the dashboard panel. An
.htmlfile produced by an analysis opens in the artifact panel as a dashboard — the same placeupdate_dashboardputs things.
#Shell commands
Analysis can also run shell commands in the same sandbox, the way Claude's code execution offers bash beside Python. Strata reaches for a command when a shell does the job best: listing and inspecting files, searching text, counting lines, sorting and removing duplicates, packing an archive, or checking a file's checksum.
- The same sandbox. A command runs in the same session as the Python steps of that conversation: a file either one writes is there for the other, and so is a file you uploaded that Strata staged. Python variables are not shared with the shell, and every command starts afresh in
/workspace, so acdor a variable does not carry over to the next command. - The same rules. The same limits (90 seconds per command, 5 GB of memory), the same network rule as the Python code, and the same organization, role and user settings: a member who may not use Analysis gets neither.
- The tools. bash 5.2 with the standard Linux tools: coreutils, grep, sed, awk, find, xargs, tar, gzip, perl, and python3 with the pre-installed libraries. There is no zip or unzip (Strata uses Python's
zipfileinstead), no curl or wget, and no package manager. - Files for you. A command hands over a file the way an analysis does: written under
/workspace/outputs/and registered withpresent_file, it becomes a download card or renders inline.
In the trail a command appears as Running a command… and then Ran a command; its panel shows the command, highlighted as shell, with its output, errors, timing and exit code.
#Working with uploaded data
When you attach a data file — CSV, TSV, Excel, JSON, or Parquet — and ask for an analysis, Strata stages the real file into the sandbox at /workspace/scratch/_inputs/<filename> and the analysis reads it straight from disk (for example pd.read_csv('/workspace/scratch/_inputs/sales.csv')). The analysis works on the actual file — every row, with correct types — not a text approximation. So a prompt like "run a regression on the columns in this CSV" reads the whole dataset from disk. You never manage paths yourself; just attach the file and describe the analysis.
A zip archive is staged the same way, as the archive itself: an analysis opens it with Python's zipfile, lists what is inside, and reads only what your question needs. Strata never unpacks a zip for you, so a zip can be opened only where Analysis is available. See Zip files.
A screenshot Strata's browser took is staged the same way, at /workspace/scratch/_inputs/ under its own name (for example Screenshot of example.com.jpg), so an analysis can put it in a Word document or a PDF it builds. Pictures in PNG, JPEG, GIF and WebP are staged; SVG is not.
For other attachments, Strata reads the extracted content already in its context instead of staging a file.
To change an uploaded Office or PDF file itself — rather than compute over its data — Strata uses the dedicated editing tools instead of an analysis. See Files.
NoteStaged input files have limits (a handful of files, up to ~20 MB each). A file above the cap — or a non-data attachment — is read from its extracted content instead, which may be summarized or sampled. For a very large dataset, load it into your database and let Strata query it.
#The action-step panel for an analysis
Click an analysis step in the action-step trail to expand a composite panel showing:
- Code — the script Strata ran (syntax-highlighted).
- Output — what the script printed. When the script ran to the end (exit code 0), what it wrote to its error stream (a library's warning, say) is shown here too, after its output.
- Errors — what a script that failed wrote to its error stream, as a soft red block (only shown if it wrote something). A notice the sandbox itself causes, such as matplotlib saying its font cache is read-only, is left out.
- Files Produced — a list of every file the script registered, with file size.
- Timing and exit code — how long the call took, and the script's exit code.
A shell command's step, named the same way by what the command does, opens the same panel, with the command in place of the script.
#Sandbox security
- One sandbox per conversation. Each conversation gets its own sandbox machine, started from a fresh image, which sleeps when idle; its files live in the conversation's own folder, which no other conversation, member or organization can reach.
- Strict tenant boundaries. Sandbox state is keyed by tenant and session, so one organization's scripts and files can never reach another's.
- Network only as your organization allows. See What the code can reach. Under the default the code itself reaches nothing.
- No host filesystem access. Scripts see only
/workspace/outputs/and/workspace/scratch/. Reading any other path raisesFileNotFoundError. - Process isolation. Each script runs in a fresh process; what carries between runs is the pickled top-level state and the conversation's files.
#What the code can reach
Your organization decides, in Organization settings then Data and privacy then What can leave your organization then Code in Analysis, as Claude's code execution lets an organization decide:
- Nothing. The code reaches nothing, and Strata installs no libraries beyond those already in the sandbox.
- Python libraries only (the default). When a task needs a library the sandbox lacks, Strata installs it from PyPI for that run; the code itself reaches nothing.
- Libraries and approved domains. The libraries, and the domains on the organization's list (Domains code can reach), each with its subdomains, over HTTPS and HTTP.
- Any public site. The libraries, and any public website.
Whatever the choice:
- The code has network only while it runs, and only through Strata's own proxy: the sandbox can reach nothing else. Libraries that use the standard proxy settings, such as
requests,urllibandhttpx, work as they are. - Private and internal addresses are always refused, whatever a name resolves to: the cloud's own services, other networks, the machine itself.
- A refused request fails with the reason in its error (the domain is not on the list, the address is private, the network is off), and Strata tells you.
- The sandbox records each connection's destination and size, never what was sent, and each run's record goes to your organization's audit log under Analysis: the sites it reached or was refused.
- Your administrator can give your role less than the organization's choice (Python libraries only or Nothing), never more.
- For a member whose answers your organization checks against a data policy, the code reaches nothing beyond its libraries: data could leave before the answer is checked.
NoteAny public site lets code Strata writes send data anywhere. A prompt hidden in a file or a web page could ask for exactly that, so choose it only if members need it. The two choices that reach the internet are offered once your deployment's sandbox can apply them.
#What is kept, and for how long
As Claude does, a conversation keeps its analysis files and variables between questions:
- For up to 30 days from the conversation's first analysis. After that the folder is removed, and the next analysis starts empty. If your organization's Delete generated files after is shorter than 30 days, the folder goes once it is that old instead, within the hour (never while an analysis is running; a legal hold keeps it).
- While the sandbox sleeps. After about 30 idle minutes the sandbox machine stops; the files stay in the conversation's folder, and the next run starts a new machine on them.
- Not kept for a turn that keeps nothing: an incognito chat, or when your organization or you turned off saving AI output or extension output. Then the files are wiped as soon as the sandbox sleeps, and one such turn ends the keeping for the whole conversation.
- Removed early when you delete the conversation, when an admin removes you from the organization, or when the organization is deleted.
Files Strata handed you as downloads are kept with the chat, as before; this is about the sandbox's own working files.
What one analysis leaves in that folder cannot change how a later one runs. Python looks there only after its own modules and the installed libraries, so a file named like one of them (json.py, pandas.py) is never used in their place; extra libraries are fetched fresh for each run and installed in that run's own temporary space, never reused from the folder; and saved variables come back only as data: Python's own types and numpy, pandas, scipy and scikit-learn objects. Anything else (an object of a class the code defined itself) is left out of the next run, which says so in its output.
#Resource limits
- Wall-clock timeout of 90 seconds per script or command, as Claude's. Longer computation must be broken into several steps.
- Memory of up to 5 GB, and one CPU, per sandbox.
- Stdout cap of 50 KB; longer output is truncated. Print summaries, not raw data dumps.
If a script exceeds a limit, you see a stderr line and the step is marked as failed in the trail. Ask Strata to "split this into smaller steps" or "process the data in chunks."
#Who can use analysis (admins)
Whether the AI can run an analysis is governed by a three-layer cascade — organization, then role, then individual user — where a more specific layer overrides a broader one. The effective setting decides whether run_python is offered in chat at all; when it is off, the AI simply solves the request with its other tools or explains it cannot run code.
| Layer | Where | Behavior |
|---|---|---|
| Organization | Organization then Member defaults then Rules for everyone, effective now then Analysis | The org-wide default. On unless an admin turns it off. |
| Role | Organization then Roles then (role) then Analysis | Tri-state: Inherit org default, Allowed, or Denied for everyone in the role. |
| User | Organization then Users then (manage user) then Access then Analysis | Tri-state per person: Inherit role / org, Allowed, or Denied. A user override wins over their role and the org default. |
NoteThe first non-inherited setting wins, and everything defaults to enabled. So a role set to Allowed re-enables analysis for its members even if the org default is off, and a user set to Denied loses it even when their role allows it.
The same setting covers shell commands: they are part of Analysis. These controls only decide who may run an analysis. The sandbox kill-switch and per-tenant isolation always apply on top — an operator can disable run_python platform-wide for incident response regardless of these settings.
#What analysis cannot do here
- Reach the internet from your code, unless your organization allows it (What the code can reach). Under the default the code has no network of its own; extra libraries are installed for it.
- Write outside
/workspace/. - Add your organization's branding. Files your analysis writes (images, workbooks, documents) carry no logo or accent color; for a branded deliverable, ask for an Excel, Word, PowerPoint or PDF file, which Strata's document tools brand automatically.
- Spawn long-lived processes or open ports.
#Examples you can try
- "Run a linear regression on this CSV and chart the fit."
- "Produce a correlation heatmap of these columns as a PNG."
- "Split this multi-sheet workbook into one file per sheet and let me download them."
- "Generate a 3-panel infographic comparing North/South/Central revenue."
#What can go wrong
- Step fails with "timeout". The script ran longer than 90 seconds. Ask Strata to chunk the work or sample the data first.
- Step fails with "out of memory". A dataframe exceeded the 5 GB cap. Ask Strata to stream the file or process it in batches.
- A requested library did not install. The package name may be wrong, or it may need to compile binaries the offline sandbox cannot build. Ask Strata to try a pure-Python alternative or to solve the task with the pre-installed libraries.
- Image was generated but did not render inline. The script saved the PNG but forgot to register it with
strata_runtime.present_file(). Ask Strata to "present that file so it shows inline." - A request from the code is refused. The error says why: the domain is not on your organization's list, network access is off for Analysis, or the address is private or internal. An admin can add the domain under Domains code can reach.
- Variable lost between calls. The variable was unpicklable (an open file handle, a database cursor, a non-serializable module object). Re-create those each call; only data values persist.
#Related
- Charts — when to use a
chartblock vs. an analysis - Artifacts — where HTML outputs render
- Files — uploading files for an analysis to process
- Roles and permissions — set who can run an analysis by role and per user