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.
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
How the turn went
When it reaches for the sandbox, what the sandbox is, and its one door.
- 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.
- 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.
- 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.
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
More in Cloud & cost
The cloud bill, answered from the metrics.
- Count what is running, and price it.#cloud-cost · how many VMs are running in testing and staging right now, and what do they cost a month?
- Why six are running, and what two would save.#cloud-cost · what are these six webhook instances, why are six running, and what do they cost?
- Find the environments nobody tore down.#cloud-cost · which temporary environments are still up on the testing cluster?
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.