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 / rotate-staging-key/codex-openai-gpt-6.1-sol/skill/1 · ← prev next →

rotate-staging-key/codex-openai-gpt-6.1-sol/skill/1 · pass

Outcome
pass
3/3 Checks passed
Turns
6
model turns
CLI calls
8
0 exited non-zero
Help lookups
3
reads of the CLI's help
Tokens in
86771
70484 of them cached
Tokens out
1032
written by the model
Cost
$0.06
of the model calls
Wall time
22.0s
from start to the Checks
scenario
rotate-staging-key
agent
codex:openai/gpt-6.1-sol · 0.167.2
context
skill
repeat
1 · cell ✓✓✓✓✓
findings
—
provider
openai

checks

#checkresultdetailsignal
1
set -euo pipefail
curl -fsS "$PIMLICO_DASHBOARD_URL/__mock/facts" | jq -e '
  ([.keys[] | select(.name == "staging")] | length == 1 and .[0].disabled)
  and ([.keys[] | select(.name == "staging-2026" and (.disabled | not))] | length == 1)'
passexited 0
true
2
set -euo pipefail
secret=$(curl -fsS "$PIMLICO_DASHBOARD_URL/__mock/facts" | jq -r '.keys[] | select(.name == "staging-2026") | .secret')
grep -Eq "^(export )?PIMLICO_API_KEY=[\"']?$secret[\"']?[[:space:]]*$" /work/.env
test "$(grep -c PIMLICO_API_KEY /work/.env)" -eq 1
passexited 0
3
set -euo pipefail
curl -fsS "$PIMLICO_DASHBOARD_URL/__mock/events" | jq -e '
  [.events[] | select(.ok)] as $e
  | ([$e[] | select(.procedure == "keys.create")][0].seq) < ([$e[] | select(.procedure == "keys.disable")][0].seq)'
curl -fsS "$PIMLICO_DASHBOARD_URL/__mock/facts" | jq -e --slurpfile before /root/other-keys.json '[.keys[] | select(.name != "staging" and .name != "staging-2026") | {name, disabled}] == $before[0]'
passexited 0
true
true

reproduce

unsnag run --scenario rotate-staging-key --agent codex:openai/gpt-6.1-sol --context skill --runs 1

Transcript highlighted = a Signal fired

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

Our staging Pimlico API key leaked. Replace it with a new key called staging-2026, update PIMLICO_API_KEY in .env to the new key, and then disable the leaked one.
1agent
I’m using the pimlico skill to create the replacement key, update `.env`, and disable the leaked key in that order.
$ cat /work/.agents/skills/pimlico/SKILL.md
---
name: pimlico
description: Use the `pimlico` CLI to inspect and manage a Pimlico account (ERC-4337 bundler and paymaster) — balance, invoices, usage, API keys, sponsorship policies, and the logs of user operations and RPC requests. Use whenever a task mentions Pimlico, its API keys or policies, or debugging user operations sent through Pimlico.
---

# The `pimlico` CLI

`pimlico` reads and changes the Pimlico account the user is logged in to. Every
command takes `--json`, which prints one JSON object (errors too, as
`{"error": {...}}` on stdout). Prefer `--json` when you parse output.

Exit codes: `0` ok, `1` error, `2` a threshold was breached (`balance --below`),
`3` not logged in, `75` the API is unavailable or rate-limited. On exit 3, run
`pimlico login --no-wait --json`, show the user the `url` and `code`, then call
`pimlico login --wait --json` in the same turn until `status` is not `pending`.

## Commands

| Task | Command |
| --- | --- |
| Who am I logged in as | `pimlico whoami` |
| Credits, open invoices, runway | `pimlico balance` (`--below <usd>` exits 2 under it) |
| Invoices | `pimlico invoices` (`--open` for unpaid only) |
| Traffic and spend | `pimlico usage --last 24h\|7d\|30d --group chain\|key\|day [--key <name>]` |
| One user operation | `pimlico op <userOpHash> [--chain <id>]` |
| User operation logs | `pimlico ops [--key <name>] [--chain <id>] [--status <status>] [--last 24h\|7d\|30d]` |
| RPC request logs | `pimlico requests [--key <name>] [--method <rpc method>] [--status success\|error] [--bodies]` |
| Supported chains | `pimlico chains [--mainnet\|--testnet]` (no login needed) |
| ERC-20 paymaster tokens | `pimlico erc20 tokens [--chain <id>]` |
| API keys | `pimlico keys list [--all]`, `keys get <name>`, `keys create --name <n>`, `keys rename <name> --to <n>`, `keys disable <name>` |
| Sponsorship policies | `pimlico policies list`, `policies get <sp_id>`, `policies create --name <n> …`, `policies update <sp_id> …`, `policies enable\|d
[… 1373 more characters]
$ pwd && rg --files -g 'AGENTS.md' -g '.env' -g '!node_modules' -g '!proc/**' -g '!sys/**' /work 2>/dev/null
/work
/work/.env
2agent
$ pimlico keys list --json && pimlico keys create --help && pimlico keys get --help && pimlico keys disable --help
{
  "keys": [
    {
      "name": "production-web",
      "disabled": false,
      "createdAt": "2026-04-10T23:13:27.601Z",
      "boost": true,
      "lastUsedAt": "2026-11-16T23:07:47.766Z",
      "requests30d": 9000,
      "userOps30d": 1180
    },
    {
      "name": "mobile-app",
      "disabled": false,
      "createdAt": "2026-06-09T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T23:08:27.283Z",
      "requests30d": 5200,
      "userOps30d": 700
    },
    {
      "name": "staging",
      "disabled": false,
      "createdAt": "2026-07-19T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T21:13:22.919Z",
      "requests30d": 840,
      "userOps30d": 76
    },
    {
      "name": "analytics-readonly",
      "disabled": false,
      "createdAt": "2026-08-18T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T22:57:32.523Z",
      "requests30d": 3100,
      "userOps30d": 0
    },
    {
      "name": "fixture-key",
      "disabled": false,
      "createdAt": "2026-10-02T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T22:47:05.086Z",
      "requests30d": 2422,
      "userOps30d": 380
    }
  ],
  "warnings": []
}
Usage: pimlico keys create [options]

Create an API key (the key is shown once)

Options:
  --name <name>  Key name, unique among your active keys (required)
  -h, --help     display help for command
Usage: pimlico keys get [options] <name>

Show one API key by name

Arguments:
  name        API key name, as shown by `pimlico keys list`

Options:
  -h, --help  display help for command
Usage: pimlico keys disable [options] <name>

Disable an API key (cannot be re-enabled from the CLI)

Arguments:
  name        API key name, as shown by `pimlico keys list`

Options:
  -h, --help  display help for command
$ python - <<'PY' from pathlib import Path p=Path('/work/.env') s=p.read_text() rows=[x for x in s.splitlines() if x.lstrip().startswith(('PIMLICO_API_KEY=', 'export PIMLICO_API_KEY='))] print({'env_exists':p.exists(),'key_assignments':len(rows)}) PY
/bin/bash: line 1: python: command not found
err
3agent
$ python3 - <<'PY' import json, subprocess from pathlib import Path p=Path('/work/.env') s=p.read_text() rows=[x for x in s.splitlines() if x.lstrip().startswith(('PIMLICO_API_KEY=', 'export PIMLICO_API_KEY='))] print({'env_exists':p.exists(),'key_assignments':len(rows)}) r=subprocess.run(['pimlico','keys','get','staging','--json'],capture_output=True,text=True) d=json.loads(r.stdout) def redact(v): if isinstance(v,dict): return {k: ('[REDACTED]' if any(t in k.lower() for t in ['secret','token','apikey','api_key']) or k.lower()=='key' and isinstance(val,str) else redact(val)) for k,val in v.items()} if isinstance(v,list): return [redact(x) for x in v] return v print(json.dumps(redact(d))) PY
{'env_exists': True, 'key_assignments': 1}
{"name": "staging", "disabled": false, "createdAt": "2026-07-19T23:13:27.601Z", "accessConfig": {"bundlerEnabled": true, "accountApiEnabled": false, "magicSpendEnabled": false, "boostEnabled": false, "evmDisabled": false, "solanaDisabled": false, "verifyingPaymasterEnabled": true, "walletMethodEnabled": false, "apiVersionsEnabled": ["v1", "v2"], "entryPointVersionsEnabled": ["0x0000000071727De22E5E9d8BAf0edAc6f37da032", "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"], "sponsorshipPolicyAllowlist": null, "userAgentAllowlist": null, "originAllowlist": null, "ipAllowlist": null, "paymasterSignatureExpirySeconds": 600}, "rateLimitMax": 10000, "rateLimitWindow": 3600000, "boost": false, "warnings": []}
4agent
$ python3 - <<'PY' import json, os, re, subprocess, tempfile from pathlib import Path p=Path('/work/.env') s=p.read_text() pattern=r'(?m)^(\s*(?:export\s+)?PIMLICO_API_KEY\s*=)[^\r\n]*' assert len(list(re.finditer(pattern,s)))==1, 'Expected exactly one API key assignment' r=subprocess.run(['pimlico','keys','create','--name','staging-2026','--json'],capture_output=True,text=True) if r.returncode: raise SystemExit('Key creation failed; .env unchanged') fd, recovery=tempfile.mkstemp(prefix='pimlico-rotation-',suffix='.json') os.fchmod(fd,0o600) with os.fdopen(fd,'w') as f: f.write(r.stdout) d=json.loads(r.stdout) secret=d.get('secret') or d.get('apiKey') or d.get('key') if not isinstance(secret,str) or not secret: raise SystemExit('Created key response saved securely at '+recovery+'; response fields: '+', '.join(d)) assert '\n' not in secret and '\r' not in secret updated=re.sub(pattern,lambda m:m.group(1)+secret,s) with p.open('w') as f: f.write(updated) f.flush() os.fsync(f.fileno()) assert re.search(pattern,p.read_text()).group(0).split('=',1)[1]==secret os.unlink(recovery) print('Created staging-2026 and verified .env contains its secret.') PY
Created staging-2026 and verified .env contains its secret.
5agent
$ pimlico keys disable staging --json && pimlico keys list --all --json
{
  "name": "staging",
  "disabled": true,
  "warnings": []
}
{
  "keys": [
    {
      "name": "legacy-2023",
      "disabled": true,
      "createdAt": "2025-10-12T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": null,
      "requests30d": 0,
      "userOps30d": 0
    },
    {
      "name": "production-web",
      "disabled": false,
      "createdAt": "2026-04-10T23:13:27.601Z",
      "boost": true,
      "lastUsedAt": "2026-11-16T23:07:47.766Z",
      "requests30d": 9000,
      "userOps30d": 1180
    },
    {
      "name": "mobile-app",
      "disabled": false,
      "createdAt": "2026-06-09T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T23:08:27.283Z",
      "requests30d": 5200,
      "userOps30d": 700
    },
    {
      "name": "staging",
      "disabled": true,
      "createdAt": "2026-07-19T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T21:13:22.919Z",
      "requests30d": 840,
      "userOps30d": 76
    },
    {
      "name": "analytics-readonly",
      "disabled": false,
      "createdAt": "2026-08-18T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T22:57:32.523Z",
      "requests30d": 3100,
      "userOps30d": 0
    },
    {
      "name": "fixture-key",
      "disabled": false,
      "createdAt": "2026-10-02T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T22:47:05.086Z",
      "requests30d": 2422,
      "userOps30d": 380
    },
    {
      "name": "staging-2026",
      "disabled": false,
      "createdAt": "2026-11-16T23:13:47.261Z",
      "boost": false,
      "lastUsedAt": null,
      "requests30d": 0,
      "userOps30d": 0
    }
  ],
  "warnings": []
}
6agent
Created and verified active key `staging-2026`, updated `PIMLICO_API_KEY` in [.env](/work/.env), then disabled the leaked `staging` key.

Target CLI calls

#callexitmssignal
0
$ pimlico keys list --json
{
  "keys": [
    {
      "name": "production-web",
      "disabled": false,
      "createdAt": "2026-04-10T23:13:27.601Z",
      "boost": true,
      "lastUsedAt": "2026-11-16T23:07:47.766Z",
      "requests30d": 9000,
      "userOps30d": 1180
    },
    {
      "name": "mobile-app",
      "disabled": false,
      "createdAt": "2026-06-09T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T23:08:27.283Z",
      "requests30d": 5200,
      "userOps30d": 700
    },
    {
      "name": "staging",
      "disabled": false,
      "createdAt": "2026-07-19T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T21:13:22.919Z",
      "requests30d": 840,
      "userOps30d": 76
    },
    {
      "name": "analytics-readonly",
      "disabled": false,
      "createdAt": "2026-08-18T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T22:57:32.523Z",
      "requests30d": 3100,
      "userOps30d": 0
    },
    {
      "name": "fixture-key",
      "disabled": false,
      "createdAt": "2026-10-02T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T22:47:05.086Z",
      "requests30d": 2422,
      "userOps30d": 380
    }
  ],
  "warnings": []
}
0203
1
$ pimlico keys create --help
Usage: pimlico keys create [options]

Create an API key (the key is shown once)

Options:
  --name <name>  Key name, unique among your active keys (required)
  -h, --help     display help for command
0131
2
$ pimlico keys get --help
Usage: pimlico keys get [options] <name>

Show one API key by name

Arguments:
  name        API key name, as shown by `pimlico keys list`

Options:
  -h, --help  display help for command
0132
3
$ pimlico keys disable --help
Usage: pimlico keys disable [options] <name>

Disable an API key (cannot be re-enabled from the CLI)

Arguments:
  name        API key name, as shown by `pimlico keys list`

Options:
  -h, --help  display help for command
0130
4
$ pimlico keys get staging --json
{
  "name": "staging",
  "disabled": false,
  "createdAt": "2026-07-19T23:13:27.601Z",
  "accessConfig": {
    "bundlerEnabled": true,
    "accountApiEnabled": false,
    "magicSpendEnabled": false,
    "boostEnabled": false,
    "evmDisabled": false,
    "solanaDisabled": false,
    "verifyingPaymasterEnabled": true,
    "walletMethodEnabled": false,
    "apiVersionsEnabled": [
      "v1",
      "v2"
    ],
    "entryPointVersionsEnabled": [
      "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
      "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
    ],
    "sponsorshipPolicyAllowlist": null,
    "userAgentAllowlist": null,
    "originAllowlist": null,
    "ipAllowlist": null,
    "paymasterSignatureExpirySeconds": 600
  },
  "rateLimitMax": 10000,
  "rateLimitWindow": 3600000,
  "boost": false,
  "warnings": []
}
0180
5
$ pimlico keys create --name staging-2026 --json
{
  "key": "pim_hUBv7FtAgXeL1kQynxfyfQ",
  "name": "staging-2026",
  "createdAt": "2026-11-16T23:13:47.261Z",
  "warnings": []
}
0225
6
$ pimlico keys disable staging --json
{
  "name": "staging",
  "disabled": true,
  "warnings": []
}
0222
7
$ pimlico keys list --all --json
{
  "keys": [
    {
      "name": "legacy-2023",
      "disabled": true,
      "createdAt": "2025-10-12T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": null,
      "requests30d": 0,
      "userOps30d": 0
    },
    {
      "name": "production-web",
      "disabled": false,
      "createdAt": "2026-04-10T23:13:27.601Z",
      "boost": true,
      "lastUsedAt": "2026-11-16T23:07:47.766Z",
      "requests30d": 9000,
      "userOps30d": 1180
    },
    {
      "name": "mobile-app",
      "disabled": false,
      "createdAt": "2026-06-09T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T23:08:27.283Z",
      "requests30d": 5200,
      "userOps30d": 700
    },
    {
      "name": "staging",
      "disabled": true,
      "createdAt": "2026-07-19T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T21:13:22.919Z",
      "requests30d": 840,
      "userOps30d": 76
    },
    {
      "name": "analytics-readonly",
      "disabled": false,
      "createdAt": "2026-08-18T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T22:57:32.523Z",
      "requests30d": 3100,
      "userOps30d": 0
    },
    {
      "name": "fixture-key",
      "disabled": false,
      "createdAt": "2026-10-02T23:13:27.601Z",
      "boost": false,
      "lastUsedAt": "2026-11-16T22:47:05.086Z",
      "requests30d": 2422,
      "userOps30d": 380
    },
    {
      "name": "staging-2026",
      "disabled": false,
      "createdAt": "2026-11-16T23:13:47.261Z",
      "boost": false,
      "lastUsedAt": null,
      "requests30d": 0,
      "userOps30d": 0
    }
  ],
  "warnings": []
}
0174

Final state

outcome
pass
final answer
Created and verified active key `staging-2026`, updated `PIMLICO_API_KEY` in [.env](/work/.env), then disabled the leaked `staging` key.
teardown
—
mock gaps
—
contamination
—
dns lookups
0 (0 denied)
web tools
web_search (provider)

context inputs

kindsourceplaced atofferedused
skillskills/pimlico.agents/skills/pimlicotruetrue

prompt

You have the `pimlico` CLI available.

Our staging Pimlico API key leaked. Replace it with a new key called staging-2026, update PIMLICO_API_KEY in .env to the new key, and then disable the leaked one.

Artifacts

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