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:| 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
How Interception Works
Python Executor
The Python executor wraps code with a custom URL opener:TypeScript Executor
The TypeScript executor overrides globalfetch:
