You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add example for configuring an anonymizer for LangGraph (#607)
## Overview
Show how to set up an anonymizer with LangGraph to redact sensitive
data.
## Type of change
**Type:** Other
## Checklist
<!-- Put an 'x' in all boxes that apply -->
- [x] I have read the [contributing guidelines](README.md)
- [x] I have tested my changes locally using `docs dev`
- [x] All code examples have been tested and work correctly
- [x] I have used **root relative** paths for internal links
- [ ] I have updated navigation in `src/docs.json` if needed
- [ ] I have gotten approval from the relevant reviewers
- [ ] (Internal team members only / optional) I have created a preview
deployment using the [Create Preview Branch
workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml)
## Additional notes
<!-- Any other information that would be helpful for reviewers -->
---------
Co-authored-by: Lauren Hirata Singh <[email protected]>
By default, the trace will be logged to the project with the name `default`. To configure a custom project name, see [Log to a project](#log-to-a-project).
32
32
33
-
For more information, see [Trace with LangGraph](langsmith/trace-with-langgraph).
33
+
For more information, see [Trace with LangGraph](/langsmith/trace-with-langgraph).
34
34
35
35
<observability />
36
+
37
+
## Use anonymizers to prevent logging of sensitive data in traces
38
+
39
+
You may want to mask sensitive data to prevent it from being logged to LangSmith. You can create [anonymizers](/langsmith/mask-inputs-outputs#rule-based-masking-of-inputs-and-outputs) and apply them to
40
+
your graph using configuration. This example will redact anything matching the Social Security Number format XXX-XX-XXXX from traces sent to LangSmith.
41
+
42
+
:::python
43
+
```python Python
44
+
from langchain_core.tracers.langchain import LangChainTracer
45
+
from langgraph.graph import StateGraph, MessagesState
46
+
from langsmith import Client
47
+
from langsmith.anonymizer import create_anonymizer
0 commit comments