Open
Conversation
Adds the @coinbase/agentkit AgentTaxActionProvider so AgentKit agents can
handle US tax compliance end-to-end on Base:
- calculate_tax — sales tax calculation (AgentTax engine v1.5,
51 jurisdictions, zip-level local rates)
- get_local_rate — zip-level combined state + local rate lookup
- check_nexus_status — per-state sales tax nexus status
- export_1099_da — IRS Form 1099-DA draft data export
- remit_tax_onchain — tax-compliant USDC remittance on Base that
appends the AgentTax Base Builder Code
(bc_626v2pr2) to transaction calldata via
ERC-8021 for attribution in the Base
developer dashboard.
Public actions (calculate_tax, get_local_rate) work without an API key.
Authenticated actions fall back to demo data without a key and return real
data for the configured entity when a key is provided. The remit action
optionally logs the onchain transaction to the AgentTax audit trail when
a key is configured.
Includes 37 unit tests covering schemas, Builder Code encoding, all five
actions, builder-code opt-out, demo-mode behavior, and error paths.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🟡 Heimdall Review Status
|
check_nexus_status and export_1099_da now surface AgentTax API validation
errors (HTTP 200 with {success: false, error}) as clean error strings,
matching the pattern already used by calculate_tax and get_local_rate.
Adds 3 new tests (40 total, 903/903 suite passing).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
AgentTaxActionProviderso AgentKit agents can handle US sales tax compliance end-to-end on Base. The newremit_tax_onchainaction appends the AgentTax Base Builder Code (bc_626v2pr2) to USDC transfer calldata via ERC-8021 for attribution in the Base developer dashboard.Why
Agent marketplaces, x402 micropayment services, and autonomous commerce platforms on Base have a shared unsolved problem: who collects and remits sales tax on these transactions? As agent-to-agent commerce grows, more of the AgentKit ecosystem is accepting USDC for digital goods and services — but none of it currently has a compliance layer.
AgentTax is a compliance API purpose-built for the agent economy (51-jurisdiction sales tax engine, ~43,000 zip-level local rates, IRS 1099-DA export, nexus monitoring). This action provider lets any AgentKit agent use it natively.
Actions
calculate_taxget_local_ratecheck_nexus_statusexport_1099_daremit_tax_onchainPublic actions work without an API key. Authenticated actions fall back to AgentTax demo data without a key and return real data for the configured entity when a key is provided.
Base Builder Code integration
The
remit_tax_onchainaction appends the ERC-8021 suffix0x62635f36323676327072320b0080218021802180218021802180218021to the USDC transfer calldata. Decoded:
bc_626v2pr2(ASCII) + length byte (0x0b) + 8021 magic pattern. Gas overhead is ~450 gas per transaction (16 gas per non-zero byte). Smart contracts ignore the trailing bytes, so the transfer behaves normally.Attribution can be opted out via
builderCodeEnabled: falsein the provider config. Registered via https://dashboard.base.org.Testing
transaction_typeenum, state code normalization, ZIP format, requiredcounterparty_id[ascii code][length byte][magic pattern])success: falsebody handling, and network failure pathsremit_tax_onchainassertions: USDC transfer selector, correct per-network USDC address, Builder Code suffix presence, opt-out behavior, audit log on/off, recipient validation, non-Base network rejectionsupportsNetworkacross EVM/non-EVM/api/v1/calculatecontract and response parses cleanlyUsage
Full README with per-action docs:
typescript/agentkit/src/action-providers/agenttax/README.mdLinks
Checklist
typescript/agentkit/src/action-providers/agenttax/src/action-providers/index.ts.changeset/add-agenttax-action-provider.md