Quick Start
Quick Start (Direct API)¶
Or use the API directly without the SDK:
Python JavaScript cURL
import requests
API_KEY = "xb_your_api_key_here"
response = requests.post(
"https://www.xybern.com/api/v1/enforce/intercept",
headers={"X-API-Key": API_KEY},
json={
"agent_id": "agent_crewai_001",
"action": {
"type": "tool_call",
"tool": "send_email",
"parameters": {"to": "cfo@company.com", "subject": "Q4 Report"}
},
"context": {"task": "financial_reporting", "session_id": "sess_abc123"}
}
)
result = response.json()
print(f"Decision: {result['decision']}") # ALLOW or DENY
print(f"Reason: {result['reason']}")
const API_KEY = "xb_your_api_key_here";
const response = await fetch("https://www.xybern.com/api/v1/enforce/intercept", {
method: "POST",
headers: { "X-API-Key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
agent_id: "agent_autogen_001",
action: {
type: "tool_call",
tool: "write_file",
parameters: { path: "/reports/q4.csv", content: "..." }
},
context: { task: "report_generation", session_id: "sess_xyz789" }
})
});
const result = await response.json();
console.log(`Decision: ${result.decision}`); // ALLOW or DENY
curl -X POST https://www.xybern.com/api/v1/enforce/intercept \
-H "X-API-Key: xb_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agent_langgraph_001",
"action": {
"type": "tool_call",
"tool": "query_database",
"parameters": {"table": "customers", "query": "SELECT * FROM customers"}
},
"context": {"task": "data_analysis", "session_id": "sess_lan001"}
}'