Framework guide
Add Quasentra to LangGraph.
Create the middleware before compiling or starting the graph. Every protected tool must use this secured path.
Complete once before this pageInstall the matching package, create your API key and create the shared security = Quasentra(...) object.Shared setup →
python -m pip install "quasentra[langgraph]"
1. Create your tools normally
from langchain.tools import tool
@tool
def customer_read(customer_id: str) -> str:
"""Read a customer record by ID."""
return company_database[customer_id]
@tool
def customer_delete(customer_id: str) -> str:
"""Permanently delete a customer record."""
del company_database[customer_id]
return "deleted"
These are ordinary LangGraph tools. Keep your real validation and business logic inside them.
2. Add the Quasentra adapter
tools = [customer_read, customer_delete]
security_middleware = security.langgraph(
agent_id="support-agent",
name="Customer Support Agent",
tools=tools,
permissions={
"customer.read": "ALLOW",
"customer.delete": "DENY",
},
)
agent = create_agent(
model=model,
tools=tools,
middleware=[security_middleware],
)
This is the only framework-specific part. Registration, discovery, permission sync and runtime decisions happen automatically.
3. Replace the example values
| Example | Replace it with |
|---|---|
| support-agent | Your stable agent ID. Also allow this ID on its Quasentra API key. |
| Customer Support Agent | A readable dashboard name for the business role. |
| tools | The actual tools already used by this agent. |
| permissions | Your ALLOW, REQUIRE_APPROVAL and DENY choices for those tool actions. |
4. Check that it works
- Start the application once.
- Open Dashboard → Agents and confirm the agent and tools appear.
- Open Access Control and confirm every action has the expected permission.
- Run one allowed request and one denied request using test data.
- Confirm the denied function did not execute and the reason appears in Decisions.
Security boundary
Middleware must be present before the graph is compiled. Do not retain an unwrapped tool path for sensitive operations.
Do not give the model a second unprotected path to the same function or credential. For payments, production databases and other high-impact systems, review the Trusted Gateway after the basic integration works.