Code Execution
Enable Python code execution for your AI Agents in Nexus
Availability depends on your school's enabled tools, provider setup, and account permissions. These settings are managed in the web workspace. A class policy may restrict a feature described here.
The code execution action allows your Agents to write and run Python code to complete more complex tasks such as performing calculations, analyzing data, and generating visualizations.
Capabilities#
Calculations: Accurately perform large or complex mathematical operations
Data Analysis: Run analysis on files provided by the user (e.g., CSVs, spreadsheets)
File Generation: Create and return files such as reports, modified datasets, or exports
Visualizations: Generate graphs and charts that render directly in the Chat UI
Configuration#
No configuration is required. Code execution is a built-in action available to all Nexus deployments out of the box.
To enable it for a specific Agent, make sure the Code Execution action is toggled on in the Agent's configuration.
Connect / Disconnect Code Execution Server#
The code execution server is connected by default. You can disconnect or reconnect it at any time from the Admin Panel. This page also displays the server's health and connection status.
How It Works#
Code execution runs in a secure, sandboxed Python environment with:
Pre-installed libraries such as numpy, pandas, scipy, and matplotlib
Network access disabled and restricted filesystem access for security
Resource limits and timeouts to prevent runaway execution
The LLM decides when to invoke code execution based on the user's query. no explicit invocation is needed.