Execution Errors
VALIDATION_ERROR
Cause: Code failed AST validation. A blocked construct was used. Example:- Review the AgentScript language definition
- Remove blocked constructs from your code
- Check the validation issues for specific lines
TIMEOUT
Cause: Execution exceeded the configured timeout. Example:- Optimize slow tool calls
- Reduce iteration count
- Increase timeout (if appropriate)
MAX_TOOL_CALLS
Cause: Script made too many tool calls. Example:- Batch operations in tools instead of individual calls
- Increase maxToolCalls limit
- Review script logic for unnecessary calls
MAX_ITERATIONS
Cause: Loop iterations exceeded the limit. Example:- Use pagination or limits in data fetching
- Process data in chunks
- Increase maxIterations (carefully)
TOOL_ERROR
Cause: A tool handler threw an error. Example:- Check tool inputs are valid
- Handle errors in tool handlers gracefully
- Provide meaningful error messages
MEMORY_LIMIT_EXCEEDED
Cause: Script used more memory than allowed. Example:- Process large data in chunks
- Use Reference Sidecar for large tool responses
- Increase memory limit
SCORING_BLOCKED
Cause: AI Scoring Gate detected suspicious patterns. Example:- Review code for exfiltration patterns
- Avoid list→send sequences
- Use specific queries instead of wildcards
- Adjust scoring thresholds if false positive
Validation Issues
Unknown global
Message:Unknown global 'xyz' - not in allowed list
Cause: Code references an identifier not in the allowed globals list.
Solution: Add to allowedGlobals or use a tool instead:
Blocked identifier
Message:Identifier 'process' is not allowed
Cause: Code uses a blocked identifier like process, eval, etc.
Solution: Remove the blocked identifier or use an allowed alternative.
Invalid loop type
Message:'while' loops are not allowed
Cause: Code uses a blocked loop type.
Solution: Use for or for-of instead:
User-defined function
Message:User-defined functions are not allowed
Cause: Code declares a function.
Solution: Use arrow functions in array methods or inline logic:
Pre-Scanner Errors
Input size exceeded
Message:Input size 150KB exceeds limit 100KB
Solution: Reduce code size or adjust pre-scanner limits.
Nesting depth exceeded
Message:Nesting depth 25 exceeds limit 20
Solution: Simplify nested expressions.
Potential ReDoS pattern
Message:Regex pattern '(a+)+' may cause ReDoS
Solution: Remove or simplify the regex pattern.
Connection Errors
Connection refused
Cause: Cannot connect to broker or runtime. Solutions:- Check the server is running
- Verify the URL is correct
- Check network/firewall settings
Session not found
Cause: Referencing an expired or invalid session. Solutions:- Sessions expire after completion
- Create a new session
- Check session ID is correct
Debugging Tips
Enable verbose errors
Log validation results
Track execution stats
Related
- Debugging - Debug techniques
- FAQ - Frequently asked questions
- Security Model - Understanding restrictions