Summary

Adds an AWSComprehend class to the JS SDK (@arakoodev/edgechains.js/ai) that integrates with AWS Comprehend to detect and redact personally identifiable information (PII) from text — useful for sanitizing prompts before sending them to LLMs.

/claim #290

What’s included

AWSComprehend class (src/ai/src/lib/aws-comprehend/aws-comprehend.ts)

  • detectPiiEntities() — detect PII entities with optional type filtering
  • containsPii() — quick boolean check for PII presence
  • redact() — replace PII with mask characters while preserving text structure
  • redactPrompt() — convenience one-liner that returns the redacted string

Tests (src/ai/src/tests/awsComprehend.test.ts)

  • Full vitest test suite with mocked AWS SDK
  • Tests for detection, filtering, redaction, custom mask characters, and constructor options

Example (examples/aws-comprehend-redaction/)

  • Working example app demonstrating all methods
  • Shows how to chain PII redaction with LLM calls

Dependencies

  • Added @aws-sdk/client-comprehend to package.json

Usage

import { AWSComprehend } from "@arakoodev/edgechains.js/ai";
const comprehend = new AWSComprehend();
// Redact PII before sending to LLM
const safePrompt = await comprehend.redactPrompt("My name is John Smith, SSN 123-45-6789");
// → "My name is **********, SSN ***********"

Claim

Total prize pool $75
Total paid $0
Status Pending
Submitted March 07, 2026
Last updated March 07, 2026

Contributors

MA

maoshuorz

@maoshuorz

100%

Sponsors

AR

Arakoo.ai

@arakoodev

$25
GI

gittare

@gittare

$50