Framework guide
Add Quasentra to LangChain.
LangChain agents run on LangGraph, so the adapter is named security.langgraph(). Add it when create_agent() is called.
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 "langchain>=1.0,<2" "langgraph>=1.0,<2"
1. Create your tools normally
from langchain.tools import tool
@tool
def customer_read(customer_id: str) -> str:
"""Return one customer's account status."""
return company_database[customer_id]["status"]
@tool
def email_send(recipient: str, subject: str, body: str) -> str:
"""Send an email to a customer."""
return mail_service.send(recipient, subject, body)
These are ordinary LangChain tools. Keep your real validation and business logic inside them.
2. Add the Quasentra adapter
tools = [customer_read, email_send]
security_middleware = security.langgraph(
agent_id="support-agent",
name="Customer Support Agent",
tools=tools,
permissions={
"customer.read": "ALLOW",
"email.send": "REQUIRE_APPROVAL",
},
)
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
Install middleware when the agent is created. Attaching it after construction is not a verified security boundary.
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.