Core workflow
Create tools the security layer can understand.
A tool is a small business capability the model may request. Quasentra discovers its stable name, description and input schema, converts underscores to dots, and checks permission immediately before execution.
Plain Python tool
def customer_read(customer_id: str) -> dict:
"""Read one customer record by its public ID."""
if customer_id not in company_database:
raise ValueError("Customer not found")
return company_database[customer_id]
# Discovered action: customer.readTool design rules
- Give every tool a stable, unique name such as customer_read.
- Write a precise docstring; the model and dashboard use it to understand intent.
- Use typed, explicit parameters instead of one unrestricted dictionary.
- Validate identifiers and amounts inside the tool as normal application code.
- Keep one action per tool—do not create a universal run_anything tool.
- Never pass database passwords, API secrets or unrestricted clients to the model.
Attach tools to a plain Python agent
from dataclasses import dataclass
from quasentra import Quasentra
@dataclass
class SupportAgent:
tools: list
security = Quasentra(api_key=API_KEY, base_url=QUASENTRA_URL)
@security.protect(
"support-agent",
permissions={
"customer.read": "ALLOW",
"customer.delete": "DENY",
},
)
def build_agent():
return SupportAgent(tools=[customer_read, customer_delete])
agent = build_agent()Framework tool decorators
- LangChain/LangGraph: use @langchain.tools.tool.
- CrewAI: use @crewai.tools.tool("stable_name").
- OpenAI Agents: use @agents.function_tool.
Complete definitions are included on every framework page.
Default deny
A newly discovered tool without an explicit permission remains denied. A permission referencing a tool that was not discovered fails during startup instead of silently opening access.