Code execution
When a question is best answered by running real code — a calculation, a transformation, a quick parse — Han AI can execute Node in a sandboxed child process and feed the result back into its reply.
What it does
Runs short Node scripts inside a child process with a strict timeout, output cap, and restricted environment.
| Field | Value |
|---|---|
| Schema name | execute_code |
| Runtime | Node child process |
| Timeout | 15 seconds |
| Output cap | 50,000 characters |
| Environment | Restricted PATH, restricted HOME, no inherited secrets |
When Han AI uses it
- A financial calculation needs to be exact, not approximated by the model.
- Data from another tool (search, fetch, extract) needs to be reshaped before answering.
- A quick parse, regex, or aggregation is faster than thinking it through token by token.
Examples
- “What is the effective monthly cost over 36 months including the FX hedge?”
- “From this CSV I just sent, give me the top five suppliers by spend.”
- “Compute the cap-rate spread between these three properties.”
Limits
- 15-second hard timeout. Anything longer must be modeled as a recurring task or a multi-step plan.
- Output beyond 50,000 characters is truncated.
- The sandbox has no internet access by default — for fetching, Han AI uses page fetch or browser.
- No persistence between runs. State that needs to survive belongs in vector memory or your Airtable base.
Why this stack
Running Node directly on the VPS in a constrained child process gives genuine compute without standing up an external execution service, and never exposes your secrets to a sandbox provider.