Explain why revenue changed this week with AI
An agent pulls two weeks of metrics, calculates the changes with real commands and explains the likely drivers, with caveats.
- Read-only connection
- Shell
- Budget cap
Watch a real run
A real run on Oct 7, 2026, replayed. Model: openai/gpt-6-luna.
{
"period": "last_week"
}- Queuedbudget $0.05 reserved
- MicroVMmicroVM ready
- MicroVMworker started · shell on · web off
- Connectionanalytics GET /metrics?period=last_week
- Result
analytics GET → 200 - Shell
$ python3 - <<'PY' from decimal import Decimal metrics={ 'Signups':(294,196,0), 'Active users':(280… - MicroVMmicroVM destroyed
- Succeeded3 model calls, 6,404 tokensRecorded output (English)
Revenue fell $546.85 (2.34%) in 2026-W40 vs. 2026-W39
Metric Current Previous Change Signups 294 196 +98 (+50.00%) Active users 2,803 2,521 +282 (+11.19%) Revenue $22,853.85 $23,400.70 −$546.85 (−2.34%) Churned accounts 8 8 0 (0.00%) Likely drivers
- Signups and active users rose while revenue fell; this may mean user growth did not translate into higher revenue during the week.
- Churned accounts were unchanged as revenue declined; the revenue drop may not be reflected in this churn count.
What this data cannot tell us
- It does not explain why revenue changed or show revenue per user, signup conversion, or churn rates.
- Worker destroyed$0.004644 charged, $0.045356 released
Run it yourself
Open the sample in the playground with the whole request filled in. It runs on your own account, within the budget shown, against the same read-only sample systems.
Budget for this sample: $0.05
How it works
Models are poor at arithmetic, so the shell is on: the agent computes every difference and percentage in the sandbox instead of in its head. It then connects the movements (signups, active users, churn) to revenue, and says what the data cannot show.
What the agent can and cannot do
The permissions are part of the request. Anything not listed here is not available to the run.
| Setting | Allowed |
|---|---|
| Connections | analytics: GET only, at ephemer.al/api/samples/analytics-api |
| Web | Off |
| Shell | On, inside the sealed machine |
| Files | None |
| Zero data retention | Off: the record is kept for 30 days |
| Budget | $0.05, a hard cap |
| Timeout | 120 seconds |
Credentials never enter the machine: a broker adds them to each call and enforces the methods above.
The code
This is the exact request the sample sends. Set EPHEMERAL_API_KEY to a member key of your organization.
curl -X POST $EPHEMERAL_URL/v1/runs \
-H "Authorization: Bearer $EPHEMERAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d @request.jsonFull request body request.json
The same body, with the files inline.
{
"prompt": "Explain how revenue changed in input.period. Call GET /metrics?period=<input.period> on the analytics connection. Use the shell to calculate the absolute and percentage change of each metric against the previous week; do not do arithmetic in your head. Reply in Markdown, at most 180 words: a headline with the revenue change in dollars and percent, a table of the four metrics with current, previous and change, then 'Likely drivers' (two bullets that link the metrics, worded as hypotheses) and 'What this data cannot tell us' (one bullet). Use only what the data returns and never guess; if a call fails or a field is missing, say so.",
"input": {
"period": "last_week"
},
"connections": {
"analytics": {
"type": "http",
"url": "https://ephemer.al/api/samples/analytics-api",
"auth": {
"type": "bearer",
"token": "sample_read_key"
},
"allowed_methods": [
"GET"
],
"instructions": "GET /metrics?period=last_week or period=2026-W40 returns signups, active_users, revenue_cents and churned_accounts for that ISO week, with the same figures for the week before. Amounts are in cents."
}
},
"shell": true,
"timeout_seconds": 120,
"max_cost_micros": 50000
}