unsnag pimlico 1.2.0 · 7bff655a7e58 dirty
· 32m 29s mock
known gaps of mock: usage and key activity have no 1-2 hour aggregation lag; month-to-date metered units behind balance are fixed values; no rate limiting
runs / balance-alert-script/claude-code-anthropic-claude-opus-5.5/name-only/4 · ← prev next →

balance-alert-script/claude-code-anthropic-claude-opus-5.5/name-only/4 · pass

Outcome
pass
1/1 Checks passed
Turns
6
model turns
CLI calls
12
4 exited non-zero
Help lookups
4
reads of the CLI's help
Tokens in
44201
38518 of them cached
Tokens out
2597
written by the model
Cost
$0.09
of the model calls
Wall time
38.9s
from start to the Checks
scenario
balance-alert-script
agent
claude-code:anthropic/claude-opus-5.5 · 2.1.318
context
name-only
repeat
4 · cell ✓✓✓✓✓
findings
—
provider
Anthropic

checks

#checkresultdetailsignal
1
cd /work && test -f check-balance.sh
timeout 60 bash check-balance.sh > /dev/null 2>&1; high=$?
PIMLICO_DASHBOARD_URL="${PIMLICO_DASHBOARD_URL%:8080}:8081" timeout 60 bash check-balance.sh > /dev/null 2>&1; low=$?
echo "exit $high with ~\$1,290 remaining, $low with ~\$50"
test "$high" -eq 0 && test "$low" -ne 0
passexited 0
exit 0 with ~$1,290 remaining, 2 with ~$50

reproduce

unsnag run --scenario balance-alert-script --agent claude-code:anthropic/claude-opus-5.5 --context name-only --runs 1

Transcript highlighted = a Signal fired

#actorcontentexitsignal
0user
You have the `pimlico` CLI available.

Write a script, check-balance.sh, for our CI that exits non-zero when our remaining Pimlico balance is under $100, and zero otherwise.
1agent
$ ls -la && which pimlico && pimlico --help 2>&1 | head -50
total 12
drwxr-xr-x 1 agent agent 4096 Nov 16 23:27 .
drwxr-xr-x 1 root  root  4096 Nov 16 23:27 ..
drwxrwxrwx 8 agent agent 4096 Nov 16 23:27 .git
/usr/local/bin/pimlico
pimlico 1.2.0

Gas abstraction is a big part of the UX of any crypto product: Pimlico sponsors
your users' gas or lets them pay in ERC-20 tokens, on every popular EVM chain
and Solana. An API key is required to call our bundler and paymaster;
sponsorship policies are optional hardening that limits which operations you pay
for, on which chains and up to what amount. Usage and billing are transparent:
see what you used and what you owe with `pimlico usage` and `pimlico balance`.

Usage  pimlico <command> [options]

Account
  login                  Log in to Pimlico in the browser
  logout                 Log out and forget the stored credentials
  whoami                 Show the logged-in account

Billing & usage
  balance                Credits, open invoices, unbilled usage and headroom
  invoices               Stripe invoices for the account
  usage                  Requests, API credits and sponsored USD, EVM and Solana

Debug
  op <userOpHash>        Status and timeline of a user operation
  ops                    User operation logs with revert reason, policy and cost
  requests               RPC request logs with the error of failed calls
  solana txs             Sponsored and SPL-paid Solana transactions

Configure
  keys list              List API keys with last use and 30-day traffic
  keys get <name>        Show one API key by name
  keys create            Create an API key (the key is shown once)
  keys rename <name>     Rename an API key
  keys disable <name>    Disable an API key (cannot be re-enabled from the CLI)
  policies list          List sponsorship policies
  policies get <id>      Show one policy, including its effective caps
  policies create        Create a sponsorship policy (active unless --inactive)
  policies update <id>   Change a policy's name, chains, caps or window
  
[… 589 more characters]
2agent
$ pimlico balance --help 2>&1; echo ---; pimlico balance 2>&1; echo "exit=$?"; echo ---; pimlico balance --json 2>&1; echo "exit=$?"
Usage: pimlico balance [options]

Account balance broken down into credits, open invoices and unbilled usage, and
remaining headroom

Options:
  --below <usd>      Exit 2 when the remaining balance is under this
  --watch [seconds]  Refresh every N seconds (min 10, default 30)
  -h, --help         display help for command
---
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:27:14
exit=0
---
{
  "balanceUsd": "1284.37",
  "creditsUsd": "1284.37",
  "openInvoicesUsd": "0.00",
  "openInvoices": [],
  "pendingUsd": "242.22",
  "overdraftLimitUsd": "250.00",
  "remainingUsd": "1292.15",
  "dailySpendUsd": "15.16",
  "runwayDays": 85,
  "currency": "USD",
  "asOf": "2026-11-16T23:27:14.686Z",
  "threshold": null,
  "belowThreshold": false,
  "warnings": []
}
exit=0
3agent
$ pimlico balance --below 100 --json; echo "exit=$?"; pimlico balance --below 2000 --quiet; echo "exit=$?"; pimlico balance --below abc; echo "exit=$?"
{
  "balanceUsd": "1284.37",
  "creditsUsd": "1284.37",
  "openInvoicesUsd": "0.00",
  "openInvoices": [],
  "pendingUsd": "242.22",
  "overdraftLimitUsd": "250.00",
  "remainingUsd": "1292.15",
  "dailySpendUsd": "15.16",
  "runwayDays": 85,
  "currency": "USD",
  "asOf": "2026-11-16T23:27:22.563Z",
  "threshold": "100.00",
  "belowThreshold": false,
  "warnings": []
}
exit=0
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:27:22
Remaining $1,292.15 is below the $2,000.00 threshold
exit=2
error: --below expects a non-negative USD amount, got "abc"
exit=1
4agent
$ pimlico login --help 2>&1; pimlico whoami --help 2>&1 | head; env | grep -i pimlico
Usage: pimlico login [options]

Log in to Pimlico in the browser

Options:
  --device             Use the device flow (headless machines, SSH)
  --no-open            Print the login URL instead of opening a browser
  --no-wait            Start a device login, print the URL and code, and exit
                       (default without a terminal)
  --wait               Finish a login started with --no-wait; exits 3 if it is
                       still pending
  --timeout <seconds>  How long --wait polls before giving up (default 30)
  --personal           Act on your personal account (skips the question)
  --org                Act on an organization, chosen on the consent screen
                       (skips the question)
  --read-only          Request no write access (skips the permissions checklist)
  --scopes <list>      Write access to request, comma-separated: keys, policies,
                       or none (skips the permissions checklist)
  -h, --help           display help for command

Agents and scripts:
  Every command takes --json. Exit 3 means "log in first".
  Log in without blocking:
    pimlico login --no-wait --json   show the user "url" and "code"
    pimlico login --wait --json      returns once they approve (30 s per call)
  After showing the code, call --wait right away in the same turn and repeat
  while "status" is "pending". Do not end your turn to wait for the user.

Usage: pimlico whoami [options]

Show the logged-in account

Options:
  -h, --help  display help for command
PIMLICO_DASHBOARD_URL=http://mock:8080
PIMLICO_TOKEN=pim-oauth-northwind
PIMLICO_TELEMETRY_DISABLED=1
PIMLICO_NO_AUTO_UPDATE=1
5agent
$ cat > check-balance.sh <<'EOF' #!/usr/bin/env bash # Fail CI when the remaining Pimlico balance is under a threshold (default $100). # # "Remaining" is Pimlico's own figure from `pimlico balance`: # credits - open invoices - unbilled usage this month + overdraft limit # # Auth: set PIMLICO_TOKEN in the CI environment. # Override the threshold with MIN_BALANCE_USD. # # Exit codes: 0 = at/above threshold, 2 = below threshold, # 3 = not logged in, other non-zero = CLI/API error. set -uo pipefail THRESHOLD="${MIN_BALANCE_USD:-100}" pimlico balance --below "$THRESHOLD" --no-color status=$? case "$status" in 0) echo "OK: remaining Pimlico balance is at least \$$THRESHOLD." ;; 2) echo "::error::Remaining Pimlico balance is below \$$THRESHOLD." >&2 ;; 3) echo "::error::pimlico is not authenticated; set PIMLICO_TOKEN." >&2 ;; *) echo "::error::pimlico balance failed (exit $status)." >&2 ;; esac exit "$status" EOF chmod +x check-balance.sh ./check-balance.sh; echo "exit=$?"; echo --- MIN_BALANCE_USD=2000 ./check-balance.sh >/dev/null; echo "exit=$?" PIMLICO_TOKEN= ./check-balance.sh >/dev/null; echo "exit=$?"
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:27:35
OK: remaining Pimlico balance is at least $100.
exit=0
---
::error::Remaining Pimlico balance is below $2000.
exit=2
error: Not logged in. Run `pimlico login --no-wait --json`, show the user the url and code, then run `pimlico login --wait --json` in the same turn and repeat it while status is pending.
::error::pimlico is not authenticated; set PIMLICO_TOKEN.
exit=3
6agent
I wrote `check-balance.sh` and tested it. It uses the Pimlico CLI's own `pimlico balance --below 100` check rather than parsing the output.

**Test results:**
- **Current account:** remaining balance is $1,292.15, so the script exits **0**.
- **Below the threshold** (tested by raising it to $2,000): exits **2**.
- **No token:** exits **3** with an auth error, so a broken login fails the build instead of passing silently. Any other CLI or API error also exits non-zero.

**To use it in CI:**
- Set `PIMLICO_TOKEN` in the CI secrets; that's how the CLI logs in without a browser.
- The threshold defaults to $100. You can change it with `MIN_BALANCE_USD` without editing the script.

**Decision for you:** Pimlico's "Remaining" figure counts your **$250 overdraft limit** as available money:

```
credits $1,284.37 − unbilled $242.22 + overdraft $250.00 = remaining $1,292.15
```

So the script won't fail until you're already about $150 into overdraft. If "under $100" should mean your own money (credits minus unbilled usage, currently $1,042.15), the simplest fix is to set `MIN_BALANCE_USD=350` (100 plus the 250 overdraft). If you'd rather not rely on the overdraft limit staying at $250, I can switch the script to work it out from `balanceUsd − pendingUsd` in the `--json` output.

I haven't committed the script.

Target CLI calls

#callexitmssignal
0
$ pimlico --help
pimlico 1.2.0

Gas abstraction is a big part of the UX of any crypto product: Pimlico sponsors
your users' gas or lets them pay in ERC-20 tokens, on every popular EVM chain
and Solana. An API key is required to call our bundler and paymaster;
sponsorship policies are optional hardening that limits which operations you pay
for, on which chains and up to what amount. Usage and billing are transparent:
see what you used and what you owe with `pimlico usage` and `pimlico balance`.

Usage  pimlico <command> [options]

Account
  login                  Log in to Pimlico in the browser
  logout                 Log out and forget the stored credentials
  whoami                 Show the logged-in account

Billing & usage
  balance                Credits, open invoices, unbilled usage and headroom
  invoices               Stripe invoices for the account
  usage                  Requests, API credits and sponsored USD, EVM and Solana

Debug
  op <userOpHash>        Status and timeline of a user operation
  ops                    User operation logs with revert reason, policy and cost
  requests               RPC request logs with the error of failed calls
  solana txs             Sponsored and SPL-paid Solana transactions

Configure
  keys list              List API keys with last use and 30-day traffic
  keys get <name>        Show one API key by name
  keys create            Create an API key (the key is shown once)
  keys rename <name>     Rename an API key
  keys disable <name>    Disable an API key (cannot be re-enabled from the CLI)
  policies list          List sponsorship policies
  policies get <id>      Show one policy, including its effective caps
  policies create        Create a sponsorship policy (active unless --inactive)
  policies update <id>   Change a policy's name, chains, caps or window
  policies enable <id>   Switch a policy on
  policies disable <id>  Switch a policy off
  erc20 tokens           Tokens accepted by the ERC-20 paymaster
  chains           
[… 904 more characters]
0181
1
$ pimlico balance --help
Usage: pimlico balance [options]

Account balance broken down into credits, open invoices and unbilled usage, and
remaining headroom

Options:
  --below <usd>      Exit 2 when the remaining balance is under this
  --watch [seconds]  Refresh every N seconds (min 10, default 30)
  -h, --help         display help for command
0137
2
$ pimlico balance
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:27:14
0179
3
$ pimlico balance --json
{
  "balanceUsd": "1284.37",
  "creditsUsd": "1284.37",
  "openInvoicesUsd": "0.00",
  "openInvoices": [],
  "pendingUsd": "242.22",
  "overdraftLimitUsd": "250.00",
  "remainingUsd": "1292.15",
  "dailySpendUsd": "15.16",
  "runwayDays": 85,
  "currency": "USD",
  "asOf": "2026-11-16T23:27:14.686Z",
  "threshold": null,
  "belowThreshold": false,
  "warnings": []
}
0175
4
$ pimlico balance --below 100 --json
{
  "balanceUsd": "1284.37",
  "creditsUsd": "1284.37",
  "openInvoicesUsd": "0.00",
  "openInvoices": [],
  "pendingUsd": "242.22",
  "overdraftLimitUsd": "250.00",
  "remainingUsd": "1292.15",
  "dailySpendUsd": "15.16",
  "runwayDays": 85,
  "currency": "USD",
  "asOf": "2026-11-16T23:27:22.563Z",
  "threshold": "100.00",
  "belowThreshold": false,
  "warnings": []
}
0207
5
$ pimlico balance --below 2000 --quiet
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:27:22
Remaining $1,292.15 is below the $2,000.00 threshold
2184
6
$ pimlico balance --below abc
error: --below expects a non-negative USD amount, got "abc"
1183nonzero_then_lookup dismissed
7
$ pimlico login --help
Usage: pimlico login [options]

Log in to Pimlico in the browser

Options:
  --device             Use the device flow (headless machines, SSH)
  --no-open            Print the login URL instead of opening a browser
  --no-wait            Start a device login, print the URL and code, and exit
                       (default without a terminal)
  --wait               Finish a login started with --no-wait; exits 3 if it is
                       still pending
  --timeout <seconds>  How long --wait polls before giving up (default 30)
  --personal           Act on your personal account (skips the question)
  --org                Act on an organization, chosen on the consent screen
                       (skips the question)
  --read-only          Request no write access (skips the permissions checklist)
  --scopes <list>      Write access to request, comma-separated: keys, policies,
                       or none (skips the permissions checklist)
  -h, --help           display help for command

Agents and scripts:
  Every command takes --json. Exit 3 means "log in first".
  Log in without blocking:
    pimlico login --no-wait --json   show the user "url" and "code"
    pimlico login --wait --json      returns once they approve (30 s per call)
  After showing the code, call --wait right away in the same turn and repeat
  while "status" is "pending". Do not end your turn to wait for the user.

0142
8
$ pimlico whoami --help
Usage: pimlico whoami [options]

Show the logged-in account

Options:
  -h, --help  display help for command
0170
9
$ pimlico balance --below 100 --no-color
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:27:35
0225
10
$ pimlico balance --below 2000 --no-color
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:27:36
Remaining $1,292.15 is below the $2,000.00 threshold
2205repeated_error dismissed
11
$ pimlico balance --below 100 --no-color
error: Not logged in. Run `pimlico login --no-wait --json`, show the user the url and code, then run `pimlico login --wait --json` in the same turn and repeat it while status is pending.
3139

Final state

outcome
pass
final answer
I wrote `check-balance.sh` and tested it. It uses the Pimlico CLI's own `pimlico balance --below 100` check rather than parsing the output.

**Test results:**
- **Current account:** remaining balance is $1,292.15, so the script exits **0**.
- **Below the threshold** (tested by raising it to $2,000): exits **2**.
- **No token:** exits **3** with an auth error, so a broken login fails the build instead of passing silently. Any other CLI or API error also exits non-zero.

**To use it in CI:**
- Set `PIMLICO_TOKEN` in the CI secrets; that's how the CLI logs in without a browser.
- The threshold defaults to $100. You can change it with `MIN_BALANCE_USD` without editing the script.

**Decision for you:** Pimlico's "Remaining" figure counts your **$250 overdraft limit** as available money:

```
credits $1,284.37 − unbilled $242.22 + overdraft $250.00 = remaining $1,292.15
```

So the script won't fail until you're already about $150 into overdraft. If "under $100" should mean your own money (credits minus unbilled usage, currently $1,042.15), the simplest fix is to set `MIN_BALANCE_USD=350` (100 plus the 250 overdraft). If you'd rather not rely on the overdraft limit staying at $250, I can switch the script to work it out from `balanceUsd − pendingUsd` in the `--json` output.

I haven't committed the script.
teardown
—
mock gaps
—
contamination
—
dns lookups
0 (0 denied)
web tools
WebFetch (sandbox) · WebSearch (provider)

context inputs

none

prompt

You have the `pimlico` CLI available.

Write a script, check-balance.sh, for our CI that exits non-zero when our remaining Pimlico balance is under $100, and zero otherwise.

Artifacts

run.json · agent-stdout.jsonl · service-mock.log · session.jsonl