Solutions

Cloud & cost

Arithmetic it works out rather than recalls.

#paymentspublic channel1 tool call

A percentage of a daily volume, broken down by hour, minute and weekend. Asked to work it out in JavaScript rather than in its head, it runs the script in a sealed sandbox and reports the numbers — which is the point of having the tool at all.

payments

Sam11:20 AM

@attest_tag 0.4% of checkout calls timed out. at 225,000 checkouts a day, how many is that per hour, per minute, and over a two-day weekend?

attest_tagApp11:20 AM

  • run_js · 4 lines · 0.02 s

At 0.4% of 225,000 checkouts a day, computed in JS:

  • Per day: 900 timeouts
  • Per hour: 37.5
  • Per minute: about 0.63
  • Two-day weekend: 1,800

google/gemini-flash2.1k in140 out$0.0011Configure

Names, figures, repositories and customers are changed; token counts and cost are illustrative. The ask, and the shape of the answer, are as they were.

How the turn went

When it reaches for the sandbox, what the sandbox is, and its one door.

  1. 01

    When it reaches for the sandbox

    The tool’s own description tells it: whenever an answer depends on arithmetic or on picking apart data — totals, percentiles, grouping, date maths, parsing CSV — rather than on recalling facts. A single sum is an answer, not a tool call.

  2. 02

    What the sandbox is

    JavaScript, ES2023, with the data passed in as JSON rather than pasted into the code. No filesystem, no network, no require or import, no credentials. Ten seconds and 64 MB a call.

  3. 03

    In a channel with connections, one door

    The script gets a fetch() that reads from the channel’s own connections — same hosts, same credentials injected by the host, same audit rows — and cannot write. Twenty requests a script and thirty seconds, so a paging loop finishes and returns just the number.

What it needs

The setup, in the console.

Connection
None. run_js is a native tool in every channel.
Scope
Anywhere the bot is, DMs included.
Cost
A card in the channel and about a second. The reply footer prices the turn like any other.

What it will not do

Enforced outside the model.

  • The script cannot reach the network or the disk. With connections it can read through them and only read: a POST from inside a script is refused, because a loop must never become the way past a Confirm card.

  • It does not use the sandbox for a sum it can state; the card has to buy something.

Try it

Say it in a channel it is in.

The sentence as it was typed. It works in any channel the bot has been invited to that carries the connection above — no command syntax, no form, and follow-ups in the thread need no mention.

@attest_tag 0.4% of checkout calls timed out. at 225,000 checkouts a day, how many is that per hour, per minute, and over a two-day weekend?

  • run_js

Bring the channel this would live in.

Sign up, connect the service above in one channel, and type this sentence yourself — or run the same binary on your own infrastructure.

All solutions