LangChain Integration Demo
A runnable demo showing how to wrap LangChain tools with Faramesh governance.
What It Shows
Block dangerous commands — e.g.
rm -rf /is denied while safe commands likelsare allowedPolicy evaluation — Every tool call goes through Faramesh before execution
Approval flow — Commands that require approval pause until you approve in the dashboard
Run the Demo
1. Start Faramesh
2. Activate the LangChain policy
The demo uses profiles/langchain_filesystem_policy.yaml or policies/langchain_filesystem_policy.yaml. Activate it, or use a policy that requires approval for shell commands.
3. Run the demo
Or from the Faramesh examples:
4. Approve when prompted
If an action requires approval, open http://localhost:8000 (or your Horizon URL), go to Approvals, and approve or deny. The demo will continue once approved.
How It Works
The demo uses GovernedTool to wrap a shell tool. When the agent tries to run a command:
The call is submitted to Faramesh
The policy engine evaluates it (allow, deny, or require approval)
If denied → the tool raises
PermissionErrorIf pending approval → the tool waits (or exits with instructions)
If allowed → the tool executes and returns the result
See Framework Integrations for the full LangChain integration guide.
