Design Philosophy
AgentScript is designed with these principles:- Whitelist over blacklist - Only allowed constructs are permitted
- No user-defined functions - Prevents recursion and complexity
- Bounded iteration - All loops have limits
- Explicit tool calls - External interactions through
callTool() - Static targets - Tool names must be string literals
What’s Allowed
Variables
Tool Calls
Conditionals
Bounded Loops
Array Methods with Arrow Functions
Safe Globals
Return Values
What’s Blocked
Dynamic Code Execution
System Access
Global Objects
Prototype Manipulation
Metaprogramming
User-Defined Functions
Unbounded Loops
Network and Storage
Native Code
Configuration
The AgentScript preset is configurable:Code Transformation
AgentScript code is transformed before execution:AgentScript for LLMs
When prompting an LLM to generate AgentScript, include this context:Related
- Security Model - How AgentScript fits in the security layers
- ast-guard - AST validation library
- AgentScript Preset - Preset configuration