Skip to main content

Direct REST API

You can call the AgenticGuard API directly without the SDK. This is useful for non-Python languages or custom integrations.

Base URL

https://api.agentic-guard.com

Authentication

All API calls require a JWT in the Authorization header:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Get a JWT by logging in:

curl -X POST https://api.agentic-guard.com/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "yourpassword"}'

Log a tool call

curl -X POST https://api.agentic-guard.com/audit \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agent_uuid_here",
"tool_name": "github",
"action": "list_repos",
"tool_url": "https://api.github.com/user/repos",
"decision": "allowed",
"reasoning": "Listing repos for analysis",
"task_id": "task_001",
"latency_ms": 142,
"status_code": 200
}'

Check a policy

curl -X POST https://api.agentic-guard.com/policy/check \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agent_uuid_here",
"tool": "github",
"action": "DELETE",
"reasoning": ""
}'

Response:

{
"decision": "deny",
"message": "DELETE operations are not permitted",
"rule_matched": "block-deletes"
}

JavaScript / Node.js example

const BASE = "https://api.agentic-guard.com";

async function checkPolicy(agentId: string, tool: string, action: string) {
const res = await fetch(`${BASE}/policy/check`, {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.AGENTICGUARD_JWT}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ agent_id: agentId, tool, action }),
});
return res.json();
}

Full API reference

See API Reference → for all endpoints.