Skip to content

Add AWS Comprehend PII redaction helper#490

Open
MulaNele wants to merge 2 commits into
arakoodev:tsfrom
MulaNele:aws-comprehend-redactor
Open

Add AWS Comprehend PII redaction helper#490
MulaNele wants to merge 2 commits into
arakoodev:tsfrom
MulaNele:aws-comprehend-redactor

Conversation

@MulaNele
Copy link
Copy Markdown

@MulaNele MulaNele commented May 12, 2026

Summary:

  • Adds ComprehendRedactor to the JS SDK AI package using @aws-sdk/client-comprehend.
  • Supports direct PII detection/redaction, wrapChat() for existing LLM endpoints, and Observable-style subscribe() / pipe() helpers for chainable redaction flows.
  • Exports the helper and related option/result/observable types from @arakoodev/edgechains.js/ai.
  • Adds mocked Vitest coverage under src/ai/src/testcases/comprehend, including direct redaction, endpoint wrapping, and Observable-style chaining.
  • Adds an aws-comprehend-redaction example with AWS environment setup notes.

Verification:

  • node node_modules\vitest\vitest.mjs run src/ai/src/testcases/comprehend/comprehendRedactor.test.ts — 7 tests passed
  • node node_modules\typescript\bin\tsc --noEmit --target ES2022 --module NodeNext --moduleResolution NodeNext --esModuleInterop --strict --skipLibCheck --types node src/ai/src/lib/comprehend/comprehendRedactor.ts src/ai/src/testcases/comprehend/comprehendRedactor.test.ts
  • node node_modules\prettier\bin\prettier.cjs --check src/ai/src/lib/comprehend/comprehendRedactor.ts src/ai/src/testcases/comprehend/comprehendRedactor.test.ts src/ai/src/index.ts README.md ../examples/aws-comprehend-redaction/src/index.ts ../examples/aws-comprehend-redaction/README.md ../examples/aws-comprehend-redaction/package.json ../examples/aws-comprehend-redaction/tsconfig.json
  • git diff --check

Note:

  • Full project typecheck currently hits pre-existing repo issues unrelated to this change, including src/document-loader/src/lib/pdf-loader/pdfLoader.ts missing pdf-parse/lib/pdf-parse.js types and existing implicit-any errors in older AI modules.

/claim #290

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@MulaNele
Copy link
Copy Markdown
Author

Implementation notes for reviewers:

  • Adds an AWS Comprehend-based redaction utility using the official @aws-sdk/client-comprehend package.
  • Supports direct text redaction, prompt option redaction, chat wrapper usage, and Observable-style subscribe/pipe helpers for chainable workflows.
  • Includes mocked unit coverage for entity detection, redaction, chat wrapping, observable helpers, and error propagation.
  • Adds a runnable example under examples/aws-comprehend-redaction.

@MulaNele
Copy link
Copy Markdown
Author

I have read the Arakoo CLA Document and I hereby sign the CLA

@MulaNele
Copy link
Copy Markdown
Author

recheck

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant