Production Checklist
Before deploying CodeCall to production, complete these steps:1
Choose the right VM preset
Use
secure for most production workloads, locked_down for sensitive data.
Never use experimental in production.2
Configure tool access control
Set up
includeTools filtering and per-tool codecall metadata to limit which tools are accessible.3
Enable audit logging
Configure audit sinks to track script execution, tool calls, and security events.
4
Set up rate limiting
Add rate limits on
codecall:execute to prevent abuse.5
Configure monitoring and alerting
Track execution latency, error rates, and security blocks with your observability stack.
6
Test security boundaries
Run the attack vector tests from AST Guard’s security audit suite.
7
Plan gradual rollout
Start with
metadata_driven mode, then migrate to codecall_only once validated.Performance Characteristics
Latency Breakdown
Total overhead (excluding tool calls): ~8-25ms for typical scripts.
Throughput
Throughput depends heavily on script complexity and tool call latency. These numbers assume simple scripts with 1-3 tool calls.
Performance Optimization
1. Use TF-IDF for Most Cases
Unless you have 100+ tools with similar descriptions, TF-IDF provides excellent relevance with minimal overhead:2. Enable ML for Large Toolsets
For 100+ tools with similar descriptions, the ML strategy provides better semantic matching:3. Use Direct Invoke for Simple Calls
Bypass VM overhead for single-tool operations:4. Cache Describe Results
Tool schemas rarely change. CodeCall internally caches describe and search results to reduce overhead on repeated calls.Multi-Instance Deployment
CodeCall is stateless and scales horizontally.Architecture
Kubernetes Deployment
Resource Recommendations
Monitoring
Metrics to Track
Execution Latency
Track p50, p95, p99 of
codecall:execute durationError Rate
Monitor validation errors, timeouts, and tool failures
Tool Call Count
Average tool calls per script execution
Search Latency
Track search response times for index health
Logging
CodeCall’s internalAuditLoggerService emits structured log events for observability. These events can be consumed by your logging infrastructure:
Log events:
Alerting Recommendations
Cost Optimization
Token Savings
CodeCall dramatically reduces token usage:Compute Costs
Cost vs. Performance Tradeoffs
Minimize Latency
Minimize Latency
- Use TF-IDF search
- Enable caching for describe/search
- Use direct invoke for simple calls
- Increase VM timeout for complex scripts
Minimize Compute
Minimize Compute
- Use locked_down preset (shorter timeouts)
- Limit maxToolCalls aggressively
- Cache aggressively
- Use fewer instances with more resources
Minimize Tokens
Minimize Tokens
- Use codecall_only mode
- Hide all tools from list_tools
- Return minimal data from tools
- Let scripts filter server-side
Security in Production
Checklist
1
Use secure or locked_down preset
Never use
experimental in production.2
Enable audit logging
Log all script executions and security events.
3
Configure rate limiting
Prevent abuse via aggressive rate limits.
4
Monitor security events
Alert on validation failures and self-reference attempts.
5
Regular security reviews
Review tool allowlists and filter rules quarterly.
Rate Limiting
Rate limiting should be handled at the infrastructure level (reverse proxy, API gateway) or with middleware. Configure limits oncodecall:execute to prevent abuse.
Multi-Tenancy Patterns
CodeCall supports multiple isolation strategies for multi-tenant deployments.Tenant Context
Pass tenant information viacodecallContext:
Per-Tenant Tool Filtering
Restrict tools based on tenant using theincludeTools filter:
Isolation Strategies
Troubleshooting
Common Issues
Scripts timing out
Scripts timing out
Symptoms: Frequent
TIMEOUT errorsCauses:- Script too complex
- Tool calls too slow
- Timeout too aggressive
- Profile tool call latency
- Increase
vm.timeoutMsif tools are slow - Break complex scripts into smaller pieces
- Use
Promise.all()for independent tool calls
Search returning irrelevant results
Search returning irrelevant results
Symptoms: Low relevance scores, wrong tools returnedCauses:
- Poor tool descriptions
- Threshold too low
- TF-IDF limitations
- Improve tool descriptions
- Switch to
mlstrategy for semantic matching - Add more specific keywords to descriptions
High memory usage
High memory usage
Symptoms: OOM errors, pod restartsCauses:
- Embedding model loaded
- Large tool index
- Scripts returning large data
- Use TF-IDF instead of embeddings
- Increase memory limits
- Configure output sanitization limits
- Enable HNSW for large indexes
Validation errors for valid code
Validation errors for valid code
Symptoms: Scripts rejected that should workCauses:
- Using blocked constructs
- Reserved prefix collision
- Unicode issues
- Check for
eval,Function, etc. - Avoid
__ag_and__safe_prefixes - Use ASCII identifiers
- Review AST Guard rules
Migration & Rollback
Gradual Rollout
-
Phase 1: Deploy with
mode: 'metadata_driven'- All tools visible normally
- Mark select tools for CodeCall
- Monitor for issues
-
Phase 2: Switch to
mode: 'codecall_opt_in'- Tools opt into CodeCall
- Both access methods work
- Measure token savings
-
Phase 3: Move to
mode: 'codecall_only'- Hide tools from list_tools
- Full CodeCall experience
- Maximum token savings
Rollback Plan
Related
Configuration
All configuration options including VM presets and embedding strategies
Security Model
Defense-in-depth security architecture and settings
API Reference
Meta-tool schemas, error codes, and debugging guide
Deployment Guide
General FrontMCP production deployment