Skip to main content

Type

python

Variants

Restricted Imports, Full Access
Purpose: The Python skill enables agents to execute Python code with fine-grained control over module imports, execution environment, and resource limits.

Common Use Cases

Data processing and analysisParse, transform, and analyze data with Python libraries

Running Python scriptsExecute automation scripts, data pipelines, and workflows

API integrationsCall external APIs using requests, handle OAuth, process responses

Custom business logicImplement complex algorithms and domain-specific operations

Variants Overview

Choosing a variant: Start with Restricted Imports and only upgrade to Full Access when third-party packages are required. See Variant Configuration for detailed differences.

Configuration

Example Configuration:
Restricted Imports:
  • allowed_imports: Standard library safe modules (json, csv, datetime, re, math, collections, itertools, etc.)
  • Network and shell access modules blocked
Full Access:
  • allowed_imports: [”*”] (all modules)
  • Third-party packages allowed
  • Higher default limits: max_memory: "2GB", timeout: 600
See: Variant Configuration Guide

Quick Start

View Complete Examples

See full data analysis patterns, API integration workflows, and ML pipeline configurations

Python Code Execution

Inline Code Example

Agents can execute Python code directly:

Script Execution

Agents can run Python scripts from the filesystem:

Installing Additional Packages

For agents that need third-party packages, install them on the worker:
Then allow imports in the skill configuration:
Package Management: Packages must be installed on the worker system before agents can import them. Coordinate with your infrastructure team for package deployment.

Security Best Practices

Only allow the specific Python modules your agent needs.
Always configure max_memory to prevent resource exhaustion.
Set reasonable timeouts to prevent infinite loops.
Performance Tip: For data-heavy operations, consider increasing max_memory and timeout values appropriately.

Solutions:
  • Add module to allowed_imports in configuration
  • Verify module name exactly matches Python import (e.g., urllib.parse not urllib)
  • Consider upgrading to Full Access variant if appropriate
Solutions:
  • Verify package is installed on worker: pip list | grep package-name
  • Ensure PYTHONPATH includes package location
  • Install missing package: pip install package-name
Solutions:
  • Increase max_memory in configuration
  • Optimize script to use less memory (streaming, generators)
  • Process data in smaller batches

File System Skill

Read data files for Python processing

Shell Skill

Execute shell commands from Python

File Generation

Generate formatted output files

View All Skills

Return to built-in skills overview