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
-`uninstall(): void`: Restore original fetchand remove interceptor
334
+
-`install(client: TruseraClient, options?: InterceptorOptions): void`: Install HTTP interceptor for `fetch`, `axios` (if available), and `undici` (if available)
335
+
-`uninstall(): void`: Restore original fetch, eject axios interceptors, and restore undici functions
287
336
288
337
### `TruseraLangChainHandler`
289
338
290
339
#### Methods
291
340
292
-
-`constructor(client: TruseraClient)`: Create handler for LangChain callbacks
341
+
-`constructor(client: TruseraClient, options?: LangChainHandlerOptions)`: Create handler for LangChain callbacks with optional Cedar enforcement
293
342
-`getPendingEventCount(): number`: Get count of incomplete events
294
343
-`clearPendingEvents(): void`: Clear all pending events
295
344
345
+
#### LangChainHandlerOptions
346
+
347
+
```typescript
348
+
interfaceLangChainHandlerOptions {
349
+
enforcement?:"block"|"warn"|"log";
350
+
cedarEvaluator?:CedarEvaluator;
351
+
}
352
+
```
353
+
354
+
When `enforcement` is `"block"` and a Cedar policy denies a tool/LLM call, the handler throws an `Error`. In `"warn"` mode it logs via `console.warn`. In `"log"` mode (default) violations are tracked silently.
0 commit comments