Skip to content

feat(plaid): add the Plaid bank-data integration - #6749

Open
j15z wants to merge 1 commit into
stagingfrom
feat/plaid-integration
Open

feat(plaid): add the Plaid bank-data integration#6749
j15z wants to merge 1 commit into
stagingfrom
feat/plaid-integration

Conversation

@j15z

@j15z j15z commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add the Plaid integration: 10 bank-data tools under tools/plaid/ — transactions sync (cursor-based), accounts, real-time balances, identity, ACH/EFT/BACS/IBAN auth numbers, item health, institution search/get, public-token exchange, and a sandbox token creator
  • ApiKey block with per-operation conditional fields, sandbox/production environment switch, canvas sentences, 8 catalog templates, and 7 suggested agent skills
  • plaid-errors extractor so failures surface as Plaid's error_message (ERROR_CODE) instead of a generic HTTP error
  • Consolidates the duplicated numeric/boolean coercion helpers into blocks/utils.ts (brex and plaid now share one implementation)
  • Wire-side guards on the LLM tool-call path: null/empty/string-typed optionals are coerced or dropped before reaching Plaid
  • Includes small stale docs regeneration for 5 other integrations (generator output had drifted upstream)

Known follow-up (not in this PR): get_auth/get_identity outputs persist to execution logs unredacted for workspaces without a PII redaction policy — same pre-existing gap as Brex cash accounts and Rippling worker data. The right fix is a tool-declared entity hook into the staged PII redaction pipeline (US_BANK_NUMBER and IBAN_CODE are already supported entity types).

Type of Change

  • New feature

Testing

  • 30 unit tests (mappers, wire guards, block params switch, error extractor)
  • All 10 operations live-verified against the Plaid sandbox; block exercised end-to-end in the canvas UI
  • Full audit suite (27 audits), lint, and type-check green

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 15, 2026 11:45pm

Request Review

@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Introduces bank-account, balance, identity, and ACH/auth-number flows plus long-lived access tokens; sensitive outputs may persist in execution logs without tool-level PII redaction (noted as a follow-up in the PR).

Overview
Adds a Plaid workflow block and integration catalog entry with 10 API-key operations: cursor-based transaction sync, accounts, live balances, identity, auth/routing numbers, Item health, institution search/get, public-token exchange, and sandbox token creation. The block uses per-operation subblocks (environment, access token, filters), canvas sentences, templates, and agent skills; docs and PlaidIcon are wired through icon maps and the block registry.

Shared block helpers toOptionalFiniteNumber and toOptionalBoolean move into blocks/utils.ts; Brex drops its local copies and imports the shared helpers (Plaid uses them for sync page size and flags).

A plaid-errors entry in error-extractors.ts surfaces Plaid failures as error_message (ERROR_CODE) instead of generic HTTP errors.

Docs-only churn from regeneration: Ashby webhook docs add Temporary as an employment type; a few integration pages get trivial BlockInfoCard whitespace or trailing blank lines.

Reviewed by Cursor Bugbot for commit 410d6f9. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a complete Plaid bank-data integration with ten tools, block and catalog registration, response normalization, error extraction, documentation, and tests. It also centralizes optional numeric and boolean block coercion shared with Brex.

  • Supports transaction synchronization, account and balance retrieval, identity and authorization data, Item health, institution discovery, token exchange, and sandbox token creation.
  • Adds environment-aware request construction, credential-safe tool parameter visibility, and Plaid-specific error messages.
  • Registers the integration across block, tool, icon, generated metadata, documentation, templates, and skills catalogs.

Confidence Score: 4/5

The PR appears safe to merge, with only a non-blocking TypeScript const-assertion issue in the Plaid block configuration.

The Plaid operation IDs, registry entries, credential visibility, request mappings, and response transforms are consistently wired; the accepted concern only weakens compile-time typing for two operation lists.

Files Needing Attention: apps/sim/blocks/blocks/plaid.ts

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/plaid.ts Defines the Plaid block, conditional fields, operation dispatch, templates, and skills; the two operation constants omit required const assertions.
apps/sim/tools/plaid/utils.ts Provides environment selection, credential headers, wire-value normalization, and response mappers for shared Plaid behavior.
apps/sim/tools/plaid/sync_transactions.ts Implements cursor-based transaction synchronization with optional request controls and normalized pagination output.
apps/sim/tools/plaid/get_auth.ts Implements retrieval and normalization of ACH, EFT, BACS, and international account identifiers.
apps/sim/tools/error-extractors.ts Adds extraction of Plaid developer messages and error codes from Plaid error envelopes.
apps/sim/tools/registry.ts Registers all ten Plaid tools consistently with their block operation identifiers.
apps/sim/blocks/utils.ts Centralizes optional finite-number and boolean coercion for Plaid and Brex block execution.

Sequence Diagram

sequenceDiagram
  participant User as Workflow or Agent
  participant Block as Plaid Block
  participant Tool as Selected Plaid Tool
  participant API as Plaid API
  User->>Block: Operation and inputs
  Block->>Block: Select tool and coerce optionals
  Block->>Tool: Credentials and operation parameters
  Tool->>API: Environment-specific HTTPS request
  API-->>Tool: Plaid response or error envelope
  Tool->>Tool: Normalize response or extract error
  Tool-->>User: Typed workflow output
Loading

Reviews (1): Last reviewed commit: "feat(plaid): add the Plaid bank-data int..." | Re-trigger Greptile

Comment on lines +7 to +16
const ACCESS_TOKEN_OPERATIONS = [
'sync_transactions',
'get_accounts',
'get_balances',
'get_identity',
'get_auth',
'get_item',
]

const ACCOUNT_FILTER_OPERATIONS = ['get_accounts', 'get_balances', 'get_identity', 'get_auth']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Const operation arrays are widened

These operation groups directly control conditional visibility and required fields, but without const assertions their identifiers widen to string[], weakening compile-time protection against invalid operation values.

Suggested change
const ACCESS_TOKEN_OPERATIONS = [
'sync_transactions',
'get_accounts',
'get_balances',
'get_identity',
'get_auth',
'get_item',
]
const ACCOUNT_FILTER_OPERATIONS = ['get_accounts', 'get_balances', 'get_identity', 'get_auth']
const ACCESS_TOKEN_OPERATIONS = [
'sync_transactions',
'get_accounts',
'get_balances',
'get_identity',
'get_auth',
'get_item',
] as const
const ACCOUNT_FILTER_OPERATIONS = [
'get_accounts',
'get_balances',
'get_identity',
'get_auth',
] as const

Context Used: TypeScript conventions and type safety (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 410d6f9. Configure here.

{ label: 'Sandbox', id: 'sandbox' },
],
value: () => 'production',
condition: { field: 'operation', value: 'create_sandbox_public_token', not: true },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sandbox flow defaults to production

Medium Severity

create_sandbox_public_token always calls the sandbox host while hiding environment, but that field still defaults to production for every other operation including exchange_public_token. The natural create-then-exchange sandbox path therefore hits production with a sandbox public token and fails with an environment mismatch until environment is manually flipped.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 410d6f9. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant