Legacy Guard API Utilities
The Guard API session proxy has been deprecated. External agents now connect through gateway tokens and submit for governance via Agent Review. A small set of utility endpoints remains active.
/v1/guard/agents/register, /v1/guard/sessions,/v1/guard/check-tool, and /v1/guard/onboard — has been removed. These endpoints no longer exist and will return 404. External agents should connect via gateway tokens instead. POST /v1/guard/scan remains available as a scanner probe.How external agents connect now
External agents (LangChain, CrewAI, AutoGen, custom code) connect to Clevername through gateway tokens (cn-live-*). There are no sessions or registration calls. You issue a token from the dashboard, point your agent at the Clevername chat completions endpoint, and every call is automatically scanned and audited.
Legacy cnk_* tokens issued before the prefix change remain accepted — no need to reissue.
- Go to Dashboard → Settings → Keys and create a new gateway token.
- Set your agent's base URL to
https://clevername.net/api/hub/v1. - Use the gateway token as your
Authorization: Bearer cn-live-...header. - Submit the agent for Agent Review to get a full guardrail profile enforced at runtime.
Example: LangChain
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="claude-sonnet-5",
base_url="https://clevername.net/api/hub/v1",
api_key="cn-live-your-token-here", # pragma: allowlist secret
)
response = llm.invoke("Summarize the key benefits of agent governance.")
print(response.content)Active Endpoints
These endpoints under /v1/guard remain active:
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/guard/health/{agent_id} | Agent health check — returns current health score, drift status, and active restrictions. IDOR-safe: only returns data for agents the caller owns. |
| POST | /v1/guard/scan | Scanner probe. Send text and get back safe, scan_ms, flags, and mode. Useful for testing what the scanner would flag. |
| POST | /v1/guard/disputes | Submit a false positive dispute (event_id required). Use when CleverGuard blocked a legitimate request. With share_content: true the report is reviewed by an LLM in the background. |
| POST | /v1/guard/miss-reports | Submit a false negative (miss) report. Use when CleverGuard passed content it should have caught. GET on the same path lists your reports; GET /v1/guard/miss-reports/{id} fetches one. |
| GET | /v1/guard/tuning | List scanner tuning suggestions generated from confirmed reports. Per-suggestion routes: /request-approval, /approval-status, /apply, /reject. |
| GET | /v1/guard/agents/{agent_id}/profile | The agent's active guardrail profile (null if ungoverned). Sibling routes under /v1/guard/agents/{agent_id}/tuning manage per-agent tuning rules. |
False Positive Disputes
If CleverGuard blocks a legitimate request, you can dispute it with POST /v1/guard/disputes. The event_id of the blocked scan is required. If you set share_content: true, an LLM reviews the content in the background and records a verdict (false_positive, true_positive, or inconclusive); confirmed false positives generate tuning suggestions. The mirror-image report — the scanner missed something — goes to POST /v1/guard/miss-reports with the same body shape and message_content required.
POST /v1/guard/disputes
Authorization: Bearer cn-live-...
{
"event_id": "a1b2c3d4-...",
"user_reason": "This is a product serial number, not an SSN",
"message_content": "optional: the blocked text",
"conversation_id": "optional",
"agent_id": "optional",
"flag_types": ["pii"],
"severity_estimate": "medium",
"reporter_confidence": "likely",
"share_content": true
}
// Response
{
"miss_report_id": "...",
"status": "submitted",
"report_direction": "false_positive",
"llm_verdict": null,
"llm_confidence": null,
"llm_reasoning": null,
"tuning_suggestion_id": null,
"questionnaire_section": "Data (D-group, Q: D1–D3)"
}Rate limited to 5 reports per hour per user (disputes and miss reports combined).