Framework guide
Add Quasentra to OpenAI Agents SDK.
Only local FunctionTools can be intercepted by this adapter. Hosted tools need a server-side enforcement 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[openai-agents]"
1. Create your tools normally
from agents import function_tool
@function_tool
def customer_lookup(customer_id: str) -> str:
"""Read one customer record."""
return company_database[customer_id]
@function_tool
def customer_delete(customer_id: str) -> str:
"""Permanently delete one customer."""
del company_database[customer_id]
return "deleted"
These are ordinary OpenAI Agents SDK tools. Keep your real validation and business logic inside them.
2. Add the Quasentra adapter
agent = Agent(
name="Customer Support",
instructions="Resolve customer requests safely.",
tools=[customer_lookup, customer_delete],
)
agent = security.openai_agent(
agent_id="support-agent",
agent=agent,
permissions={
"customer.lookup": "ALLOW",
"customer.delete": "DENY",
},
)
result = await Runner.run(agent, "Look up customer CUST-100")
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
Hosted tools execute remotely and are rejected by the local adapter because local hooks cannot enforce their execution.
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.