Babel global while maintaining all AgentScript security guarantees.
Overview
The Babel preset provides:- Babel.transform() - Transform TSX/JSX to JavaScript
- Security configs - Per-level limits for input size, output size, timeouts
- Preset whitelist - Only allowed Babel presets can be used
- Full AgentScript validation - All blocked constructs remain blocked
Basic Usage
Security Configurations
The Babel preset defines security limits per security level:Configuration by Security Level
Configuration Options
Default Configurations
Allowed Globals
The Babel preset adds these globals to the AgentScript allowlist:
All other AgentScript allowed globals remain available.
What’s Blocked
The Babel preset inherits all AgentScript security rules:- Dangerous Babel options -
plugins,sourceMaps,ast,babelrc,configFile - Disallowed presets - Any preset not in the security level’s allowlist
- All AgentScript blocked constructs -
eval,Function,process, etc.
Creating the Preset
Using with Enclave
The enclave automatically uses the Babel preset when configured:API Reference
createBabelPreset(options)
Creates validation rules for the Babel preset.
getBabelConfig(level)
Gets Babel security configuration for a security level.
BABEL_SECURITY_CONFIGS
Direct access to all security configurations.
Related
- AgentScript Preset - Base preset for code validation
- Security Rules - Rule reference
- Babel Transform (enclave-vm) - Using Babel in enclave
- Security Levels - Security profiles