Skip to main content

API Reference

Base URL: https://api.agentic-guard.com

All endpoints (except /auth/* and /health) require a JWT in the Authorization: Bearer header.

Authentication

POST /auth/signup

Create a new account.

curl -X POST /auth/signup \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "YourPass123!"}'

Response:

{ "access_token": "eyJ...", "token_type": "bearer" }

POST /auth/login

curl -X POST /auth/login \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "YourPass123!"}'

Agents

GET /agents

List all agents in your organization.

curl -H "Authorization: Bearer $JWT" /agents

Response:

[
{
"id": "uuid",
"name": "my-agent",
"api_key_prefix": "ag_xxx...",
"log_outputs": "none",
"created_at": "2026-07-16T10:00:00Z"
}
]

POST /agents

Create a new agent.

curl -X POST /agents \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{"name": "my-agent", "log_outputs": "none"}'

log_outputs options: full | hash | none

Response includes the plaintext api_key — shown once only.

GET /agents/{agent_id}/proxy-url

Get the proxy URL and usage instructions for an agent.

{
"proxy_url": "https://.../proxy/ag_xxx/",
"api_key_prefix": "ag_xxx...",
"usage_example": "httpx.get('{proxy_url}api.github.com/...')"
}

DELETE /agents/{agent_id}

Delete an agent and revoke its API key.


Credentials

GET /credentials

List credentials (values are not returned).

POST /credentials

curl -X POST /credentials \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{"name": "github-prod", "hostname": "api.github.com", "cred_type": "bearer", "value": "ghp_xxx"}'

cred_type options: bearer | header | query

DELETE /credentials/{credential_id}


Policies

GET /agents/{agent_id}/policy

Get the YAML policy for an agent.

POST /agents/{agent_id}/policy

Set or replace the policy for an agent.

curl -X POST /agents/{agent_id}/policy \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{"rules_yaml": "version: \"1\"\nrules:\n - tool: \"*\"\n action: DELETE\n decision: deny"}'

POST /policy/check

Check whether a hypothetical call would be allowed.

curl -X POST /policy/check \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{"agent_id": "uuid", "tool": "github", "action": "DELETE", "reasoning": ""}'

Audit Log

GET /audit

curl -H "Authorization: Bearer $JWT" \
"/audit?agent_id=uuid&limit=50&offset=0"

Query parameters: agent_id, decision (allowed/denied), tool_name, limit, offset

GET /audit/export/pdf

Download audit log as PDF.

curl -H "Authorization: Bearer $JWT" \
"/audit/export/pdf?days=30" \
-o agentic-guard-report.pdf

Proxy

ANY /proxy/{agent_api_key}/{path}

The transparent proxy endpoint. Accepts all HTTP methods.

Target URL is reconstructed as https://{path}?{query_string}.

Optional headers:

  • X-Agent-Reasoning — logged to audit
  • X-Agent-Task-Id — logged to audit

Health

GET /health

{ "status": "ok" }

No authentication required.