Skip to main content
LangGraph applications can use Dome in two ways: call the content Guards inside your graph nodes, or wrap the whole graph with secure_agent() for the full trust stack.

Install

The trust-adapters extra installs LangGraph along with the Trust Runtime dependencies. See Install Dome for every extra. For content Guards alone, pip install "vijil-dome[local]" next to your existing LangGraph install is enough.

Guard Graph Nodes

Create the Dome instance once and scan at the graph boundaries. A scanning node can end the run early by routing to a terminal node:
Use async_guard_input() and async_guard_output() in asynchronous nodes.

Add the Full Trust Stack

secure_agent() accepts a StateGraph and returns a SecureGraph, which replaces graph.compile():
The secured graph applies content Guards on model calls, checks tool calls against the Agent’s permission policy, and emits audit events. Pass compile_kwargs through secure_agent() when your graph needs compile options such as a checkpoint saver.
LangGraph tool access control is best-effort. The compiled graph must expose tool functions that the adapter can discover and wrap. Streaming output is checked only after chunks are yielded, so an output Guard cannot retract content that a client already received.

Next Steps

Trust Runtime

Constraints, attestation, and audit events

Use Guardrails

Scan patterns for streaming and tool use
Last modified on August 12, 2026