Browse documentation
Docs/Get Started

Last reviewed 2026-06-10 - available

Getting Started

Install the Qortara Governance sidecar and policy-check LangChain tool calls before they run.

Verified against: Qortara pre-launch docs

Download PDFDownload Markdowncontent/docs/quickstart.md

Getting Started

Qortara Governance is an open-source sidecar (Apache-2.0) that adds runtime policy decisions to LangChain agents. It intercepts tool dispatches before they execute, evaluates each one against a policy profile, and blocks the calls a policy denies. This means the action never runs, rather than getting cleaned up after the fact.

You can install it and run a governed agent today. Nothing here requires an account.

Prerequisites

  • Python 3.10 or newer.
  • An existing LangChain agent, or willingness to copy the small example below.
  • (Optional) LangGraph, if you build graph-based agents.

1. Install

Install the LangChain integration from PyPI:

pip install qortara-governance-langchain

If you use LangGraph, install the extra so the graph hooks are available:

pip install 'qortara-governance-langchain[langgraph]'

2. Wire The Sidecar Into An Agent

Wrap your tools in a `GovernedAgent`. Each time the model decides to call a tool, the sidecar evaluates the call against the named policy profile before the tool function runs.

from langchain_core.tools import tool
from qortara_governance_langchain import GovernedAgent

@tool
def fetch_customer_record(customer_id: str) -> dict:
    """Fetch a customer record from the CRM."""
    return crm.get(customer_id)

@tool
def delete_customer_record(customer_id: str) -> dict:
    """Delete a customer record from the CRM."""
    return crm.delete(customer_id)

# The policy profile decides which tool calls are allowed.
agent = GovernedAgent(
    tools=[fetch_customer_record, delete_customer_record],
    policy_profile="crm-readonly",
)

result = agent.invoke({"input": "Look up customer 42"})
print(result["output"])

With the `crm-readonly` profile, the read above is allowed and runs normally.

3. See A Denied Call

Ask the same agent to do something the profile forbids. The sidecar evaluates the `delete_customer_record` call, denies it, and the tool function is never invoked.

result = agent.invoke({"input": "Delete customer 42"})

A denied tool call raises a governance error instead of executing. The error carries the policy decision so you can log it:

from qortara_governance_langchain import PolicyDenied

try:
    agent.invoke({"input": "Delete customer 42"})
except PolicyDenied as denied:
    print(denied.decision.effect)   # "deny"
    print(denied.decision.reason)   # human-readable reason
    print(denied.decision.id)       # stable id for your logs

> Record `decision.id` next to your application logs. It lets a security team correlate what an agent attempted with what your policy allowed, across systems.

4. Edit The Policy Profile

A profile is a set of rules expressed against the tool call and its inputs. Start narrow, run the agent, watch the decisions, then widen as you gain confidence. A minimal profile that allows reads and denies writes looks like this:

profile: crm-readonly
rules:
  - effect: allow
    when:
      tool.name: fetch_customer_record
  - effect: deny
    when:
      tool.category: external_write

Rules are evaluated in order, and an explicit `deny` always wins over an `allow`. See the policy authoring guide for the full rule grammar.

Next Steps

  • [LangChain integration](/docs/integrations/langchain): the complete setup, including the sidecar lifecycle and LangGraph hooks.
  • [Policy authoring](/docs/guides/policy-authoring): the rule grammar, profiles, and how to test policies.
  • [Policy enforcement](/docs/concepts/policy-enforcement): how runtime decisions are made and why pre-execution interception matters.

Looking For The Hosted Service?

The steps above are the open-source path, and they are the right starting point for most teams.

Qortara Cloud Governance is a separate, hosted product designed to centralize policy, audit, and compliance evidence across many agents and organizations from one control plane. It is in pre-launch and has not been deployed. If running the control plane yourself is not where you want to spend effort, you can register interest for the pre-launch program: email [support@qortara.com](mailto:support@qortara.com?subject=Qortara%20Cloud%20Governance%20Inquiry) and we will share pilot terms with design-partner organizations as they become available.

---

LangChain and LangGraph are trademarks of LangChain, Inc. Qortara is an independent project and is not affiliated with, endorsed by, or sponsored by LangChain, Inc.