HTTP reference

AgentSecurity API

SDK applications authenticate with X-API-Key. Browser sessions use secure cookies and CSRF protection.

Create a decision

curl https://agentsecurity.pk/api/v1/decisions \
  -H "X-API-Key: $AGENT_SECURITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @decision.json

Core endpoint groups

  • PUT /api/v1/agents/{agent_id}/registration — idempotent discovery and policy sync.
  • POST /api/v1/decisions — authorize one exact operation.
  • POST /api/v1/tools/execute — trusted gateway execution.
  • GET /api/v1/security/approvals — dashboard approval queue.

Response behavior

Clients must honor Retry-After on 429/503 and reuse the original request ID and nonce for retries. Monthly quota exhaustion uses reason code MONTHLY_QUOTA_EXCEEDED.

Interactive schema

Use the generated OpenAPI reference for complete schemas. Never place an agent API key in frontend JavaScript.