Skip to content

feat(payments): add Pay for Data (Heurist) use case#1465

Open
joshuamarksmith wants to merge 6 commits into
awslabs:mainfrom
joshuamarksmith:feat/pay-for-data-heurist
Open

feat(payments): add Pay for Data (Heurist) use case#1465
joshuamarksmith wants to merge 6 commits into
awslabs:mainfrom
joshuamarksmith:feat/pay-for-data-heurist

Conversation

@joshuamarksmith
Copy link
Copy Markdown

A Strands-based finance research agent that calls paid Heurist x402 endpoints for real-time prices, SEC filings, and macro indicators. The AgentCorePaymentsPlugin intercepts HTTP 402 responses, asks the AgentCore payment manager to generate a payment proof against the configured payment instrument and payment session, and retries automatically — tool code stays an ordinary http_request call. Data is analyzed in AgentCore Code Interpreter and exported as charts and reports.

Highlights:

  • HTTP 402 payment processing via AgentCorePaymentsPlugin — no manual payment code in tools
  • Embedded wallet (Coinbase CDP) with USDC as the settlement asset
  • AgentCore Code Interpreter for pandas/matplotlib analysis and artifact export
  • Public PyPI dependencies only (bedrock-agentcore==1.9.0) — no bundled or file-based SDK components
  • Targets x402 on Base mainnet (Heurist endpoints settle on Base)

Adds:

  • 01-tutorials/13-AgentCore-payments/02-use-cases/pay-for-data/
    • pay-for-data.ipynb (notebook walkthrough)
    • heurist_finance_agent/ (agent, catalog, config, artifact_export)
    • scripts/ (sync_registry, run CLI entry points)
    • requirements.txt, .env.example, README.md, .gitignore

Updates:

  • 01-tutorials/13-AgentCore-payments/README.md: add Use Cases table entry
  • 01-tutorials/13-AgentCore-payments/02-use-cases/README.md: add use case overview and highlights

A Strands-based finance research agent that calls paid Heurist x402 endpoints
for real-time prices, SEC filings, and macro indicators. The
AgentCorePaymentsPlugin intercepts HTTP 402 responses, asks the AgentCore
payment manager to generate a payment proof against the configured payment
instrument and payment session, and retries automatically — tool code stays
an ordinary http_request call. Data is analyzed in AgentCore Code Interpreter
and exported as charts and reports.

Highlights:
- HTTP 402 payment processing via AgentCorePaymentsPlugin — no manual
  payment code in tools
- Embedded wallet (Coinbase CDP) with USDC as the settlement asset
- AgentCore Code Interpreter for pandas/matplotlib analysis and artifact
  export
- Public PyPI dependencies only (bedrock-agentcore==1.9.0) — no bundled or
  file-based SDK components
- Targets x402 on Base mainnet (Heurist endpoints settle on Base)

Adds:
- 01-tutorials/13-AgentCore-payments/02-use-cases/pay-for-data/
  - pay-for-data.ipynb (notebook walkthrough)
  - heurist_finance_agent/ (agent, catalog, config, artifact_export)
  - scripts/ (sync_registry, run CLI entry points)
  - requirements.txt, .env.example, README.md, .gitignore

Updates:
- 01-tutorials/13-AgentCore-payments/README.md: add Use Cases table entry
- 01-tutorials/13-AgentCore-payments/02-use-cases/README.md: add use case
  overview and highlights
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions github-actions Bot added the 01-tutorials 01-tutorials label May 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Latest scan for commit: 2391da9 | Updated: 2026-05-12 10:00:17 UTC

Security Scan Results

Scan Metadata

  • Project: ASH
  • Scan executed: 2026-05-12T09:59:56+00:00
  • ASH version: 3.0.0

Summary

Scanner Results

The table below shows findings by scanner, with status based on severity thresholds and dependencies:

Column Explanations:

Severity Levels (S/C/H/M/L/I):

  • Suppressed (S): Security findings that have been explicitly suppressed/ignored and don't affect the scanner's pass/fail status
  • Critical (C): The most severe security vulnerabilities requiring immediate remediation (e.g., SQL injection, remote code execution)
  • High (H): Serious security vulnerabilities that should be addressed promptly (e.g., authentication bypasses, privilege escalation)
  • Medium (M): Moderate security risks that should be addressed in normal development cycles (e.g., weak encryption, input validation issues)
  • Low (L): Minor security concerns with limited impact (e.g., information disclosure, weak recommendations)
  • Info (I): Informational findings for awareness with minimal security risk (e.g., code quality suggestions, best practice recommendations)

Other Columns:

  • Time: Duration taken by each scanner to complete its analysis
  • Action: Total number of actionable findings at or above the configured severity threshold that require attention

Scanner Results:

  • PASSED: Scanner found no security issues at or above the configured severity threshold - code is clean for this scanner
  • FAILED: Scanner found security vulnerabilities at or above the threshold that require attention and remediation
  • MISSING: Scanner could not run because required dependencies/tools are not installed or available
  • SKIPPED: Scanner was intentionally disabled or excluded from this scan
  • ERROR: Scanner encountered an execution error and could not complete successfully

Severity Thresholds (Thresh Column):

  • CRITICAL: Only Critical severity findings cause scanner to fail
  • HIGH: High and Critical severity findings cause scanner to fail
  • MEDIUM (MED): Medium, High, and Critical severity findings cause scanner to fail
  • LOW: Low, Medium, High, and Critical severity findings cause scanner to fail
  • ALL: Any finding of any severity level causes scanner to fail

Threshold Source: Values in parentheses indicate where the threshold is configured:

  • (g) = global: Set in the global_settings section of ASH configuration
  • (c) = config: Set in the individual scanner configuration section
  • (s) = scanner: Default threshold built into the scanner itself

Statistics calculation:

  • All statistics are calculated from the final aggregated SARIF report
  • Suppressed findings are counted separately and do not contribute to actionable findings
  • Scanner status is determined by comparing actionable findings to the threshold
Scanner S C H M L I Time Action Result Thresh
bandit 0 0 0 0 0 0 811ms 0 PASSED MED (g)
cdk-nag 0 0 0 0 0 0 28.3s 0 PASSED MED (g)
cfn-nag 0 0 0 0 0 0 10ms 0 PASSED MED (g)
checkov 0 0 0 0 0 0 4.6s 0 PASSED MED (g)
detect-secrets 0 0 0 0 0 0 777ms 0 PASSED MED (g)
grype 0 0 0 0 0 0 41.6s 0 PASSED MED (g)
npm-audit 0 0 0 0 0 0 169ms 0 PASSED MED (g)
opengrep 0 0 0 0 0 0 <1ms 0 SKIPPED MED (g)
semgrep 0 0 0 0 0 0 <1ms 0 MISSING MED (g)
syft 0 0 0 0 0 0 2.1s 0 PASSED MED (g)

Joshua Smith added 4 commits May 9, 2026 14:57
1. Fix requirements.txt: bedrock-agentcore[strands-agents]==1.9.0 (extras
   install required for AgentCorePaymentsPlugin)
2. Change default prompt to non-crypto macroeconomic query (FredMacroAgent
   GDP/unemployment summary) in run.py and README
3. Remove 'no bundled/file-based SDK' line from README, 02-use-cases/README,
   and tutorial-level README table entry
4. Expand notebook: add architecture diagram (ASCII), AgentCore payments
   capabilities table (payment manager, instrument, session, processing,
   limits), step-by-step payment flow explanation, and restructure into
   numbered steps
5. Add cleanup section (local cache + artifacts) and shared responsibility
   model table to notebook
Comment thread 01-tutorials/13-AgentCore-payments/02-use-cases/pay-for-data/requirements.txt Outdated
- agent.py: remove redundant 'No manual payment logic is needed' from docstring
- artifact_export.py: replace multi-strategy JSON fallback parser with a
  single json.loads — the Code Interpreter runs our own script that always
  emits print(json.dumps(payload)), so the output is deterministic JSON
- catalog.py: warn (via logging.warning) when a requested agent ID is not
  found in the live catalog, so renames or removals surface immediately
  rather than silently loading zero tools
- requirements.txt: pin strands-agents==1.36.0, strands-agents-tools==0.5.0,
  boto3==1.43.1, botocore==1.43.3 to match PR awslabs#1459 versions; keep
  bedrock-agentcore[strands-agents]==1.9.0 (newer than awslabs#1459)
- catalog.py line 199 (f-string suggestion): left as-is — the lines.append
  + join pattern is idiomatic for multi-line table construction and already
  uses f-strings inside the loop
@mvangara10
Copy link
Copy Markdown
Contributor

Please update the use case to use AgentCore runtime and AgentCore observability

Copy link
Copy Markdown

@leewc leewc left a comment

Choose a reason for hiding this comment

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

Changes LGTM from my side. You might want to address Madhu's comments

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

Labels

01-tutorials 01-tutorials

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants