Overview
Quick Start
Security Model
The Babel transform runs in an isolated VM context with multiple security layers:Configuration
Security Levels
Each security level provides different limits for Babel transforms:Creating a Babel Enclave
Transform API
Inside the enclave, theBabel global provides a restricted transform API:
Transform Options
Common Use Cases
Transform React Components
Transform TypeScript + JSX
Tool Integration for Dynamic Components
Error Handling
Babel transform errors are sanitized to prevent path leakage:Common Errors
Performance
Babel transforms are optimized with context caching:Performance Tips
- Batch transforms - Transform multiple components in a single enclave run
- Reuse enclave - Don’t create/dispose for each transform
- Minimize types - Complex TypeScript types increase transform time
- Use STANDARD level - Good balance of security and performance
Direct API (Outside Enclave)
For server-side use without the full enclave sandbox, usecreateRestrictedBabel:
Related
- Overview - Enclave introduction
- Security Levels - Security profiles
- AgentScript Preset - AST validation for enclave code
- Tool System - Integrating tools with enclave