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
Code executor Proxy
- Wraps code with interception logic
- Detects API URL patterns
- Rewrites URLs to route into the isolated environment
URL Transformation Rules
The executor transforms URLs based on these patterns:| Original URL | Transformed URL |
|---|---|
https://slack.com/api/* | http://localhost:8000/api/env/{id}/services/slack/* |
https://api.slack.com/api/* | http://localhost:8000/api/env/{id}/services/slack/* |
https://api.linear.app/* | http://localhost:8000/api/env/{id}/services/linear/* |
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
