Overview
Code executors wrap your agent’s code and intercept API calls. They allow your AI agent to write normal code targeting production APIs (likehttps://slack.com/api/*) while actually hitting isolated test environments.
Flow
1
Agent Writes Code
2
Code executor Proxy
- Wraps code with interception logic
- Detects API URL patterns
- Rewrites URLs to route into the isolated environment
3
Environment
Real API responses from your sandboxed environment
URL Transformation Rules
The executor transforms URLs based on these patterns:Available Executors
Python
Intercepts
requests and urllibTypeScript
Intercepts
fetch APIBash
Intercepts
curl commandsHow Interception Works
Python Executor
The Python executor wraps code with a custom URL opener:TypeScript Executor
The TypeScript executor overrides globalfetch:
Bash Executor
The Bash executor uses sed to transform curl URLs:Security Considerations
Next Steps
Python Executor
Detailed Python executor guide
TypeScript Executor
Detailed TypeScript executor guide