I’ve been exploring Langgraph recently and really like what it offers for building AI workflows. However, I’m running into a problem that’s blocking me from using it for real projects. All my application logs seem to automatically get sent to Langsmith, which is a big issue for me. Since my agent conversations will contain sensitive business information, I can’t have this data being transmitted to external services. This limitation means I can only create simple demos right now. Does anyone know if there’s a configuration option or setting that would let me keep all the logging local and prevent data from being sent to Langsmith? I’d appreciate any guidance on how to handle this privacy concern while still being able to use Langgraph effectively.
Had the same privacy issues with Langgraph in enterprise setups. Check your app’s initialization code too - developers sometimes turn on tracing without realizing it. What worked for me was building a custom callback handler that dumps everything to local storage instead. You can override the default tracing by creating your own callback system. Captures the same info but keeps it in your infrastructure. You get monitoring without the external data risk. Also audit your whole codebase for any langsmith imports - these can trigger tracing even when your environment variables are right.
Deal with this constantly - compliance teams won’t get off my back about it. Environment variables work great, but I always add one extra step that’s saved me tons of headaches.
Make a startup script that checks and logs your tracing settings before the app starts. Just print the LANGCHAIN_TRACING_V2 value to console. Sounds dumb but you’d be shocked how many production fires happen because someone’s local .env had tracing on and got deployed by mistake.
For logging, I built a simple wrapper around Langgraph calls that sends all trace data to our internal ELK stack instead. Takes 30 minutes to set up and you get the same visibility without external calls. I’ve used this across three projects now.
This tutorial covers building agent systems with proper logging controls - should help you set up monitoring while keeping everything internal. The callback override approach is definitely the way to go for production.
Set LANGCHAIN_TRACING_V2 to false before running your app – this disables Langsmith logging. I encountered similar issues with confidential data, and this solution worked for me. Additionally, you can unset LANGCHAIN_API_KEY to sever all connections to Langsmith. For production environments, it’s advisable to include LANGCHAIN_TRACING_V2=false in your deployment configuration to prevent any accidental logging. This approach has proven effective across various Langgraph projects without causing disruptions.