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 like ls are allowed

  • Policy 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

cd

cd

cd

Or from the Faramesh examples:

cd faramesh-horizon-code
FARAMESH_API_BASE

cd faramesh-horizon-code
FARAMESH_API_BASE

cd faramesh-horizon-code
FARAMESH_API_BASE

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:

  1. The call is submitted to Faramesh

  2. The policy engine evaluates it (allow, deny, or require approval)

  3. If denied → the tool raises PermissionError

  4. If pending approval → the tool waits (or exits with instructions)

  5. If allowed → the tool executes and returns the result

See Framework Integrations for the full LangChain integration guide.

Was this helpful?

Was this helpful?

Was this helpful?

Previous

More

Previous

More

Previous

More

Next

More

Next

More

Next

More

Table of content

Table of content

Table of content

LangChain

LangChain