search and execute. The agent writes JavaScript that runs in a sandboxed V8 isolate — and that code can fan out dozens of internal API calls, run them in parallel, aggregate results, and return a summary. All in one tool invocation.
Why It Works
LLMs have seen millions of lines of real-world JavaScript but only contrived tool-calling examples. WritingPromise.all() with a .map() is natural for them — chaining individual tool calls is not.
The sandbox provides:
cnap.request()— typed API client with auth injected server-side- Full JavaScript —
Promise.all,Array.map,Date.now(), error handling, any logic the agent needs - Up to 50 API calls per execution — enough for complex multi-step workflows
- No network escape — requests only reach the CNAP API, never the open internet
Examples
Parallel Log Analysis
35,000 lines across 11 pods in 506ms — parallel fan-out with in-sandbox aggregation
Resource Audit
CPU/memory capacity report in 56ms — unit parsing and computation from a single API call
Security Audit
9 security checks across 7 parallel API calls — then auto-remediates with network policies
Incident Debugging
Full SRE triage — pod health, events, error logs, rollout history — adapting at each step
Database Operations
Run SQL queries, check Redis memory, chain diagnostics — all through exec
Cross-Cluster Comparison
Compare versions, images, and CRDs across your entire fleet in one call
CRD Discovery
Discover, inspect, and interact with custom resources the agent has never seen
What Agents Can Do
Each row is one or two tool calls. The agent writes the code, the sandbox executes it, and only the results reach the context window.
Related
Platform MCP
How Code Mode works and the two tools it exposes
Kubernetes Access
Kube API proxy, pod logs, and command execution