Skip to content

feat(ai): add AWS Comprehend PII redaction endpoint - #834

Open
alic3mai10ve6dec-ops wants to merge 329 commits into
arakoodev:mainfrom
alic3mai10ve6dec-ops:feat/aws-comprehend-redact-v2
Open

alic3mai10ve6dec-ops wants to merge 329 commits into
arakoodev:mainfrom
alic3mai10ve6dec-ops:feat/aws-comprehend-redact-v2

Conversation

@alic3mai10ve6dec-ops

Copy link
Copy Markdown

Summary

Adds AWSComprehendRedact class that chains with existing EdgeChains Endpoint classes to detect and redact PII using Amazon Comprehend.

Changes

  • New class: AWSComprehendRedact with full AWS SigV4 signing (no external deps)
  • 12 PII entity types: PERSON, EMAIL, PHONE_NUMBER, DATE, LOCATION, ORGANIZATION, ACCOUNT_NUMBER, ADDRESS, ID_NUMBER, CREDIT_CARD, BANK_ACCOUNT, SSN
  • Custom replacement templates: {ENTITY_TYPE} (default) or custom map
  • Auto-chunking for text > 9000 chars (Comprehend limit)
  • Entity type filtering - only detect specific types
  • 12 unit tests covering all entity types, chunking, filtering, and error handling
  • Working example in examples/aws-comprehend-redact/

Test plan

  • 12/12 unit tests passing
  • Example runs successfully against AWS Comprehend
  • No external dependencies added (pure AWS SigV4 signing)

Closes #831

actions-user and others added 30 commits January 27, 2024 15:59
* add wasi modules for jsonnet with external vars

* Update dependencies, remove unused code, and add wasm version of jsonnet

* revamp wasm compilation and serve flow

* fix the response Body

* simple working example of jsonnet

* complete jsonnet implementaion at wasmtime

* fix jsonnet_eval function

* add support for ext_string

* add docs in binding.rs

* add docs to run function

* fix http response at hyper side

* working example for nodejs with jsonnet

* add readme to jsonnet library

* update the workflow of webassembly

* add support for evaluateFile

* updated hydesearch example

* updated edgechain examples with arakoov/jsonnet

* fix shims build and upload release
* Update webassembly-pr-build.yml

* Update webassembly-pr-build.yml

* fix webassembly-pr-build.yml
actions-user and others added 26 commits May 20, 2026 02:24
Adds AWSComprehendRedact class that chains with existing EdgeChains
Endpoint classes to detect and redact PII using Amazon Comprehend.

- New class: AWSComprehendRedact with SigV4 signing
- Supports 12 PII entity types (PERSON, EMAIL, PHONE, DATE, etc.)
- Custom replacement templates ([{TYPE}] or [REDACTED])
- Auto-chunking for text > 9000 chars
- Filter to specific entity types
- Vitest test suite (12 tests)
- Working example: redact PII before sending to OpenAI

Resolves: arakoodev#290
Bounty: 0 USD
@alic3mai10ve6dec-ops

Copy link
Copy Markdown
Author

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

@alic3mai10ve6dec-ops

Copy link
Copy Markdown
Author

CI status note for maintainers:

Our branch passed both PR Build and CLA Assistant successfully at 09:46 UTC (run #935).

All subsequent runs (16:07+ UTC) fail with startup_failure - but so does every other pull_request_target trigger from forks during this window. The internal ts branch CLA run at 16:17 succeeded, confirming runners are up. This appears to be a transient GitHub Actions issue with fork PR tokens around 16:00 UTC.

Happy to re-trigger once the platform-side issue resolves, or a maintainer can re-run from the PR page. Code and tests are ready - 12/12 passing locally.

Thanks!

- Fix hmacSHA256 key type to accept string | Buffer
- Fix sha256Hex to use Buffer.toString('hex') instead of .map()
- Exclude examples/ from main tsconfig build
@alic3mai10ve6dec-ops

Copy link
Copy Markdown
Author

The Webassembly PR Build is failing due to a pre-existing infrastructure issue, not the code in this PR:

"This request has been automatically failed because it uses a deprecated version of . Please update your workflow to use v3/v4 of actions/cache to avoid interruptions."
The fix is a one-line change in :

I attempted to push this fix but the PAT used for this PR lacks the scope required to modify files under .

Note: The WASM build is triggered by the path filter, but this PR only modifies TypeScript files under — no WASM/Rust code is touched.

Happy to re-run once the cache version is updated. Thanks!

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.

7 participants