Home / Use cases / langchain

Permissions for LangChain agents

LangChain makes tool-calling effortless. Kynara decides which tools your agent may actually use — on whose behalf, under what conditions — before any side effect runs.

QuickstartTry the sandbox

The problem

A LangChain agent calls whichever tool the model chooses, with whatever arguments it produces. There's no built-in concept of permissions: no rule for which agent may call which tool, on whose behalf, or under what conditions. For demos that's fine; for agents that send email, modify records, or move money, it's a liability.

How Kynara fits

from langchain.agents import AgentExecutor
from kynara_sdk.langchain import KynaraCallbackHandler

# One callback governs every tool the agent invokes
executor = AgentExecutor(
    agent=agent, tools=tools,
    callbacks=[KynaraCallbackHandler(kynara)],
)

# Or guard a single tool:
from langchain.tools import tool
from kynara_sdk import permission_required

@tool
@permission_required("crm.contacts.read", resource_arg="contact_id")
def get_contact(contact_id: str) -> str:
    return crm.fetch(contact_id)

On a deny, the call is blocked before the tool runs; on require_approval, the agent pauses for a human. Works the same for LangGraph nodes.

What you get

Allow / deny / require approval

Every consequential call is evaluated against RBAC + ABAC policies and runtime context before it executes.

Non-escalation guarantee

An agent can never exceed the permissions of the user it acts on behalf of.

Human-in-the-loop

Route destructive or external-facing actions to a human for approval, with full context.

Tamper-evident audit

Every decision is appended to a SHA-256 hash-chained log for forensics and compliance.

Go deeper: read the guide · docs · compare Kynara.

Stay in the loop

New guides on AI agent governance, MCP security, and compliance — no spam.

Govern your langchain agents

Free plan: 3 seats, 10k decisions/month.