fetch-bank-data — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited fetch-bank-data (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You pull fresh data from the user's customer-facing bank + credit-card sites and drop reasoned files into Drive dump/. Sync owns ingestion — your job ends when the files are in dump/. You do not touch SQLite, do not call the dashboard, do not send Telegram. Adding more issuers later (max, isracard, amex) is just one more [section] in .secrets/findash + one more mapping line below.
scripts/fetch_bank.js (parameterized by --company)scripts/package.json (israeli-bank-scrapers + puppeteer; run cd scripts && npm install once)[hapoalim] / [cal] sections of .secrets/findash (chmod 600)~/.cache/findash/chromium-profile/<companyId>/inbox/staging/./rclone.conf (always pass --config ./rclone.conf)[drive] section of .secrets/findash (root_folder_id=…, chmod 600). Folder layout: docs/drive-layout.md (root is the dump/ parent).data/finance.dbdocs/doc-types/full-statements.md (bank_api_dump, bank_api_notes, cal_api_dump, cal_api_notes)| company | scraper companyId | secrets section | env vars consumed by the script |
|---|---|---|---|
hapoalim | hapoalim | [hapoalim] | HAPOALIM_USER_CODE, HAPOALIM_PASSWORD |
cal | visaCal | [cal] | CAL_USERNAME, CAL_PASSWORD |
Both sections are key=value lines under their […] header in .secrets/findash. Hapoalim uses user_code= and password=. Cal uses username= and password= (not user_code — matches Cal's login UI and the library's credential shape).
Both also accept START_DATE from env (ISO YYYY-MM-DD) — the script falls back to 60 days back if unset.
Run all configured sources in parallel unless the user explicitly named one ("fetch cal", "pull from hapoalim" → just that one). For each source:
If a source has no credentials (no [<source>] section in .secrets/findash), silently skip that source and name it in the final summary. A one-bank user still gets a working skill.
Query SQLite for the latest transaction date on accounts at that institution:
SELECT MAX(t.date)
FROM transactions t JOIN accounts a ON a.id = t.account_id
WHERE a.institution = ?; -- 'Bank Hapoalim' or 'Cal'Subtract a few days (3–5) for overlap safety — sync dedups, so re-sending recent rows is harmless. If the query returns NULL (no data yet for that institution), fall back to 60 days back. Cal-specific note: the first-ever Cal fetch has no accounts row at all — institution will not match anything; that's fine, the same 60-day fallback applies.
The scraper reads credentials from .secrets/findash itself — never put them on the command line. That keeps the unattended claude -p run allowlist-safe (the command stays a clean node scripts/fetch_bank.js … prefix) and your password out of the transcript. Pass the step-2 window as a flag and read the JSON straight from stdout — no `>` redirection (the unattended run can't write to arbitrary paths):
node scripts/fetch_bank.js --company=hapoalim --start-date=YYYY-MM-DD--company=visaCal for Cal. Substitute the step-2 start date for YYYY-MM-DD (the skill auto-computes one — this flag is just the override). Omit --start-date to default to 60 days back. Read the result from the command's stdout. The script exits:
0 — success, full library result as JSON on stdout1 — scrape ran but success: false, errorType / errorMessage on stderr2 — missing creds / Node too old / Puppeteer launch failureOn 1 or 2: surface the error verbatim, recommend --setup (see "When things break" below), and proceed to the next source. Don't write any files for the failing source.
This is the whole point of the skill. The script returns raw library output; you interpret it. Different vocabulary per source kind:
Bank-account observations (Hapoalim):
<amount> ILS out to your brokerage on day 1, <amount> ILS back from your brokerage on day 4). Sync needs to know so it can classify both legs as transfer, not expense.accounts table: SELECT DISTINCT institution, name FROM accounts WHERE closed_on IS NULL;Then fuzzy-match against description / counterparty strings on each new txn — match your brokerage's name(s) and any savings/sprint indicators. Israeli brokerages often surface under several names (Hebrew + English), so match each known alias from the vocabulary above rather than a single exact string.
description/לטובת string has never been seen on this account before: SELECT 1 FROM transactions
WHERE account_id = ? AND (description LIKE ? OR counterparty = ?)
LIMIT 1;Flag with the counterparty name so sync knows to categorize carefully.
Credit-card observations (Cal):
type === 'installments'. Group by identifier. Note "<N>/<M> installments of group #<id>" with the merchant name. All installments of one physical purchase share the same identifier, so this groups them naturally.originalCurrency !== 'ILS'. Note the implied rate chargedAmount / originalAmount along with merchant + original currency.description never seen on any credit-card account in transactions (broader than Hapoalim's per-account check — the same merchant might have appeared on the Hapoalim Mastercard before). Query: SELECT 1 FROM transactions t JOIN accounts a ON a.id = t.account_id
WHERE a.kind = 'credit_card' AND t.description LIKE ?
LIMIT 1;status === 'pending'. Flag so sync inserts with a [pending] marker and reconciles when the row reappears completed.Cross-source observation (when both ran this turn):
completed charged amounts since the last Hapoalim card_payment (כאל) on Hapoalim's checking. Compare against the most recent (or next scheduled) card_payment on Hapoalim's side. Note any material divergence — the consolidated Cal-on-Hapoalim row should roughly match the Cal-side total.Each observation becomes one bullet in the sidecar notes file and (if compact enough) one tag in the filename.
Per source, per account, compose:
<YYYY-MM-DD>-<company>-<acct-suffix>-api-fetch[__<tag>__<tag>…].json
<YYYY-MM-DD>-<company>-<acct-suffix>-api-fetch[__<tag>__<tag>…].notes.mdWhere:
<YYYY-MM-DD> = today (the fetch date, not the txn date)<company> = hapoalim or cal<acct-suffix> = last 4 of the accountNumber field (Hapoalim returns a branch/account string; Cal returns a long card number)<tag> = compact kebab-case observation marker, joined with __Tag vocabulary (keep terse so the filename stays under ~180 chars total):
roundtrip-<amount-thousands>-<counterparty-slug> — e.g. roundtrip-5000-<brokerage>internal-<counterparty-slug> — e.g. internal-<brokerage>firsttime-<counterparty-slug>anomaly-<counterparty-slug>installments-<merchant-slug> — e.g. installments-amazonfx-<currency-lower>-<merchant-slug> — e.g. fx-usd-zarapending-<count> — e.g. pending-3cross-divergence-<thousands> — Cal vs Hapoalim card_payment mismatchIf a tag would push the filename past ~180 chars, drop the lowest-priority tags (anomaly < firsttime < internal < fx < installments < roundtrip < pending) and keep the rest in the sidecar.
Quiet day = no tags. Plain 2026-05-22-hapoalim-<acct-suffix>-api-fetch.json is correct when no patterns triggered.
inbox/staging/For each account on each source:
.json — the full library result for that account only (slice accounts[i]), pretty-printed. Preserves every field including ones we don't currently use. Sync re-parses from this..notes.md — one bullet per observation:# fetch notes — 2026-05-22 — cal <acct-suffix>
- installments: 2/6 of group #<identifier>, <merchant> <amount> ILS
- fx: AMAZON.COM USD 45.20 → ILS 167.10 (rate 3.697)
- first-time merchant: SHOPIFY APP STORE
- 3 rows pending; expect to reconcile on next fetchHeader line names date + company + acct suffix so a sync run reading both files together has the linkage even if the filenames get truncated by a UI.
If an account has zero txns since the start date, skip writing files for that account — the summary should say "no activity since <last-date>".
dump/rclone --config ./rclone.conf copy --drive-root-folder-id=<ROOT_ID> \
inbox/staging/ gdrive:dump/Root ID is root_folder_id=… from .secrets/findash [drive]. After upload succeeds, delete the local inbox/staging/<file> (the file lives in Drive now; sync owns the next move).
Print a compact per-source summary, nothing else. Examples:
Hapoalim: 23 txns on <acct-a>, 7 txns on <acct-b>, 0 flags. 2 files uploaded to dump/.
Cal: 17 txns on <acct-suffix>, 2 flags (installments-amazon, fx-usd-zara, pending-3). 1 file uploaded.If a source was skipped: Hapoalim: skipped (no [hapoalim] credentials). If a source failed: Cal: failed (errorType=GENERIC, errorMessage=…). Re-run: node scripts/fetch_bank.js --company=visaCal --setup.
Do not send to Telegram. Do not invoke sync. Do not touch the DB. End here.
success: false, errorType: 'INVALID_PASSWORD' or similar. Tell the user to re-run interactively to re-trust the device: node scripts/fetch_bank.js --company=hapoalim --setuperrorType: 'GENERIC' or 'TIMEOUT'. Re-run with --setup and solve the CAPTCHA visually: node scripts/fetch_bank.js --company=visaCal --setupaccounts row; sync auto-creates one on ingest.cd scripts && npm install first. Skill stops before invoking the script if the install hasn't happened.nvm install 22 && nvm use 22, retry.documents.drive_id (which differs per upload) and via (account_id, date, …) content keys when it actually ingests the txns.dump/. Hapoalim's files (if its run succeeded) are unaffected.[section] in .secrets/findash, new mapping row in the table above, new env-var pair to load. No script change unless the new issuer's credential shape doesn't match {username, password} or {userCode, password}.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.