Skip to content

Commit d814d9d

Browse files
committed
fix: update langchain docs for passthrough guard pattern
- Enforcement mode table: monitor/log set context vars, not dict keys - Add CapiscioRequestContext read-back example (verified, claims, warnings) - Clarify guard is a pure passthrough — returns input unchanged
1 parent be50401 commit d814d9d

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

docs/how-to/integrations/langchain.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ guard = CapiscioGuard(mode="log") # Log only — good for development
6363
| Mode | On missing/invalid badge |
6464
|------|--------------------------|
6565
| `block` | Raises `CapiscioTrustError` |
66-
| `monitor` | Logs warning, adds `capiscio_warnings` to input, continues |
67-
| `log` | Logs info, adds `capiscio_warnings` to input, continues |
66+
| `monitor` | Logs warning, sets `verified=False` and `warnings` in `CapiscioRequestContext`, continues |
67+
| `log` | Logs info, sets `verified=False` and `warnings` in `CapiscioRequestContext`, continues |
68+
69+
In all modes the guard is a **pure passthrough** — it returns the input unchanged.
70+
Verification metadata is stored in the `CapiscioRequestContext` context variable,
71+
not in the output.
6872

6973
---
7074

@@ -208,6 +212,17 @@ set_capiscio_context(CapiscioRequestContext(
208212
))
209213
```
210214

215+
After guard execution, read the verification result from the same context:
216+
217+
```python
218+
from langchain_capiscio import get_capiscio_context
219+
220+
ctx = get_capiscio_context()
221+
ctx.verified # True if badge was valid
222+
ctx.claims # Decoded badge claims dict
223+
ctx.warnings # List of warning strings (monitor/log modes), or None
224+
```
225+
211226
---
212227

213228
## Full Example: A2A Agent with Trust + Events

0 commit comments

Comments
 (0)