Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions src/langsmith/encryption.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,38 +232,6 @@ Common fields to leave **unencrypted** for search and filtering:

- Checkpoint blobs (graph execution state)

#### Model-specific handlers

Register different handlers for different model types using `@encryption.encrypt.json.assistant`, `@encryption.encrypt.json.run`, etc. Use `ctx.field` to vary behavior by field:

```python
from langgraph_sdk import Encryption, EncryptionContext

encryption = Encryption()

@encryption.encrypt.json
async def default_encrypt(ctx: EncryptionContext, data: dict) -> dict:
return encrypt_with_skip_fields(data, SKIP_FIELDS)

@encryption.encrypt.json.assistant
async def encrypt_assistant(ctx: EncryptionContext, data: dict) -> dict:
if ctx.field == "context":
# Assistant context may contain API keys or system prompts—encrypt everything
return encrypt_with_skip_fields(data, skip_fields=set())
# Assistant metadata—skip system fields
return encrypt_with_skip_fields(data, SKIP_FIELDS)

@encryption.decrypt.json
async def default_decrypt(ctx: EncryptionContext, data: dict) -> dict:
return decrypt_encrypted_fields(data)

@encryption.decrypt.json.assistant
async def decrypt_assistant(ctx: EncryptionContext, data: dict) -> dict:
return decrypt_encrypted_fields(data)
```

Supported model types: `thread`, `assistant`, `run`, `cron`, `store`, `checkpoint`.

#### Deriving context from authentication

Instead of passing `X-Encryption-Context` explicitly, derive encryption context from the authenticated user:
Expand Down