[PR #4006] fix: correct Amazon Comprehend PII masking docs [closes DOC-1120] #4015

Open
opened 2026-06-05 18:53:54 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/4006
Author: @open-swe[bot]
Created: 5/14/2026
Status: 🔄 Open

Base: mainHead: open-swe/doc-1120-comprehend-pii


📝 Commits (1)

  • 7de2682 fix: correct Amazon Comprehend PII masking docs [DOC-1120]

📊 Changes

1 file changed (+118 additions, -104 deletions)

View changed files

📝 src/langsmith/mask-inputs-outputs.mdx (+118 -104)

📄 Description

Description

The Amazon Comprehend section of /langsmith/mask-inputs-outputs referenced comprehend.batch_detect_pii_entities, which does not exist in boto3 (and the linked AWS reference page was API_BatchDetectEntities, a generic-entity API, not a PII API). The per-run comprehend_anonymize example also only inspected data['messages'] or data['choices'][0]['message'], so PII slipped through for any run whose payload didn't match that exact shape (tool calls, retrievers, custom run types, etc.).

This PR rewrites both examples to recurse over the full payload and call the real detect_pii_entities API (with a per-flush dedupe cache in the batch example), adds a Warning callout explaining the lack of a Comprehend batch PII endpoint, and adds a short example showing how to wire Comprehend into create_anonymizer for use with LangChain agent middleware.

Release Note

none

Test Plan

  • Manually verify the rendered Amazon Comprehend section on a Mintlify preview build

Opened collaboratively by Kathryn May and open-swe.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/4006 **Author:** [@open-swe[bot]](https://github.com/apps/open-swe) **Created:** 5/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `open-swe/doc-1120-comprehend-pii` --- ### 📝 Commits (1) - [`7de2682`](https://github.com/langchain-ai/docs/commit/7de26827e9981859cd86877d4419247c54edbb86) fix: correct Amazon Comprehend PII masking docs [DOC-1120] ### 📊 Changes **1 file changed** (+118 additions, -104 deletions) <details> <summary>View changed files</summary> 📝 `src/langsmith/mask-inputs-outputs.mdx` (+118 -104) </details> ### 📄 Description ## Description The Amazon Comprehend section of `/langsmith/mask-inputs-outputs` referenced `comprehend.batch_detect_pii_entities`, which does not exist in boto3 (and the linked AWS reference page was `API_BatchDetectEntities`, a generic-entity API, not a PII API). The per-run `comprehend_anonymize` example also only inspected `data['messages']` or `data['choices'][0]['message']`, so PII slipped through for any run whose payload didn't match that exact shape (tool calls, retrievers, custom run types, etc.). This PR rewrites both examples to recurse over the full payload and call the real `detect_pii_entities` API (with a per-flush dedupe cache in the batch example), adds a Warning callout explaining the lack of a Comprehend batch PII endpoint, and adds a short example showing how to wire Comprehend into `create_anonymizer` for use with LangChain agent middleware. ## Release Note none ## Test Plan - [ ] Manually verify the rendered Amazon Comprehend section on a Mintlify preview build _Opened collaboratively by Kathryn May and open-swe._ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 18:53:54 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#4015