Back to blog
Engineering10 min read

The quiet economics of ending idle sandboxes quickly

Small runtime decisions compound across thousands of agent sessions. Here is how we think about the idle tail.

By Hivy engineering

Hivy journal008
Engineering10 min read

The short version

  • Treat every automated run as an inspectable session.
  • Pass secrets to programs without printing their values.
  • End idle compute quickly and preserve the useful output.
  • Measure retries and tool failures beside model cost.

Make runtime behaviour visible

Agent infrastructure gets expensive in the gaps: idle sandboxes, repeated tool calls, oversized context, and retries that never change the plan. A completed answer hides those details unless the run keeps them attached.

Store the request, tool activity, duration, model cost, and final state as one session. Engineers can then fix the part that failed instead of replacing the whole agent.

Protect the runtime boundaries

Programs may need credentials, but the agent doesn't need to read their values. Provide variable names, pass values through the sandbox environment, and block commands that expose the environment in logs or messages.

Continue reading

A good agent handoff answers three questions before work starts

Next post

Put it into practice

Build the agent your team needs.