Skip to main content

Agent API Reference

The Agent is the first service most developers put in front of applications. It handles gateway-mode policy enforcement, MCP input and output checks, health and metrics endpoints, and proxy access to many Orchestrator api/v1 management APIs. If you are building a production AI gateway, the Agent is the surface your application and SDK integrations usually hit first.

Base URL and Role

Local development:

http://localhost:8080

The Agent does two different jobs:

  • gateway mode endpoints such as /api/policy/pre-check and /api/audit/llm-call
  • proxy mode access to control-plane endpoints like /api/v1/process, /api/v1/dynamic-policies, /api/v1/llm-providers, /api/v1/connectors, and /api/v1/executions

Authentication

All protected endpoints other than health and metrics require Basic auth:

curl http://localhost:8080/api/v1/llm-providers \
-H "Authorization: Basic $(echo -n 'client-id:client-secret' | base64)"

Common headers:

HeaderUse
AuthorizationBasic auth for protected APIs
Tenant (from Basic auth)Preferred tenant scope where required
X-Org-IDBackward-compatible tenant scope on older handlers
X-Axonflow-ClientOptional <client>/<version> identification (e.g. mcp-proxy/0.3.1, claude-code-plugin/1.9.1). Telemetry and origin classification only — never part of authentication; malformed values are silently ignored. See Auth And Header Matrix.
Content-Type: application/jsonPOST and PUT requests

Core Agent Endpoints

Health and observability

MethodPathPurpose
GET/healthLiveness and readiness check
GET/metricsJSON metrics snapshot
GET/prometheusPrometheus scrape endpoint

Health response:

{
"status": "healthy",
"service": "axonflow-agent",
"tier": "Evaluation",
"timestamp": "2026-04-21T09:12:44Z",
"version": "7.2.0",
"capabilities": [
{"name": "health_check", "since": "1.0.0", "description": "Basic health endpoint"},
{"name": "proxy_llm_call", "since": "1.0.0", "description": "Proxy mode LLM calls with policy enforcement"}
],
"sdk_compatibility": {
"min_sdk_version": {"python": "6.0.0", "typescript": "5.0.0", "go": "5.0.0", "java": "5.0.0"},
"recommended_sdk_version": {"python": "6.4.0", "typescript": "5.4.0", "go": "5.4.0", "java": "5.4.0"}
}
}

The tier field was added in platform v7.2.0 and reports the license tier the agent has loaded. Possible values:

  • starting — license check has not completed yet; retry after a second
  • community — no license loaded (community mode)
  • Community, Evaluation, Professional, Enterprise, Plus — the validated license tier string (capitalized)

Operators can check the tier with a single curl:

curl -s http://localhost:8080/health | jq -r .tier

The capabilities array lists what the running platform supports. See Version Compatibility for how SDKs v3.8.0+ use it for runtime feature discovery.

OTLP telemetry ingest (Enterprise)

MethodPathPurpose
POST/v1/logsOTLP/HTTP log ingest (Claude Code / Cowork OpenTelemetry exports land as canonical audit records)
POST/v1/metricsOTLP/HTTP metric ingest

Both routes accept standard OTLP/HTTP payloads (application/x-protobuf or application/json) and are authenticated — org and tenant attribution comes from the authenticated credentials, never from the (spoofable) OTLP resource attributes. On Community builds the routes are mounted but return 501 Not Implemented; the ingest plane is an Enterprise feature.

Gateway mode

MethodPathPurpose
POST/api/policy/pre-checkApprove or block a request before your app calls an LLM directly
POST/api/audit/llm-callRecord the LLM response after your app completes the call

Gateway mode is useful when you want AxonFlow governance, audit, cost tracking, and policy decisions, but your application keeps direct control over the provider call itself.

Pre-check response (approved):

{
"approved": true,
"context_id": "ctx_abc123",
"requires_redaction": false,
"policies": [],
"approved_data": {
"customer_profile": {
"customer_id": "cust-123",
"tier": "gold"
}
},
"expires_at": "2026-03-29T12:05:00Z"
}

Pre-check response (blocked):

{
"approved": false,
"block_reason": "PII detected: US Social Security Number",
"policies": ["sys_pii_ssn"],
"expires_at": "2026-03-29T12:05:00Z"
}

Verified request fields for POST /api/policy/pre-check:

FieldRequiredNotes
client_idYesMust match the authenticated client in licensed modes
user_tokenYesUsed to resolve user context and tenant
queryYesInput query or prompt
data_sourcesNoOptional approved MCP data sources
contextNoAdditional policy context

Verified response fields from the handler:

FieldMeaning
context_idCorrelation ID for the later audit call
approvedWhether the request can proceed
requires_redactionWhether downstream redaction is required
approved_dataOptional MCP data returned by approved sources
policiesPolicies that matched or influenced the decision
rate_limitOptional rate-limit status
budget_infoOptional budget decision details
expires_atExpiry for the pre-check context
block_reasonReason when the request is denied

Example:

curl -X POST http://localhost:8080/api/policy/pre-check \
-H "Content-Type: application/json" \
-H "Authorization: Basic $(echo -n 'client-id:client-secret' | base64)" \
-d '{
"client_id": "client-id",
"user_token": "user-123",
"query": "Summarize the incident report",
"context": {
"department": "security",
"workflow": "triage"
}
}'

For POST /api/audit/llm-call, the verified required fields are context_id, client_id, provider, model, token_usage, latency_ms, and response_summary.

Verified request body fields for POST /api/audit/llm-call:

FieldRequiredNotes
context_idYesMust come from the earlier pre-check
client_idYesMust match the authenticated client in licensed modes
providerYesProvider used for the external call
modelYesModel used for the external call
token_usage.prompt_tokensYesPrompt/input tokens
token_usage.completion_tokensYesCompletion/output tokens
token_usage.total_tokensYesTotal token count
latency_msYesEnd-to-end provider latency
response_summaryYesShort response summary for audit storage
metadataNoOptional arbitrary metadata

Successful responses return:

{
"success": true,
"audit_id": "aud_abc123"
}

Example:

curl -X POST http://localhost:8080/api/audit/llm-call \
-H "Content-Type: application/json" \
-H "Authorization: Basic $(echo -n 'client-id:client-secret' | base64)" \
-d '{
"context_id": "ctx_abc123",
"client_id": "client-id",
"provider": "openai",
"model": "gpt-4o",
"token_usage": {
"prompt_tokens": 412,
"completion_tokens": 186,
"total_tokens": 598
},
"latency_ms": 842,
"response_summary": "Returned a concise incident summary for the analyst",
"metadata": {
"workflow": "incident-triage",
"environment": "production"
}
}'

MCP policy enforcement

MethodPathPurpose
POST/api/v1/mcp/check-inputEvaluate an MCP query before connector execution
POST/api/v1/mcp/check-outputEvaluate rows or payloads returned by a connector

These endpoints are what let you build governed database and SaaS integrations for AI agents. They are especially important when your application is exposing SQL, HTTP, Redis, MongoDB, or file-backed MCP connectors to higher-level agent frameworks.

Common MCP request fields:

EndpointKey request fields
/api/v1/mcp/check-inputclient_id, user_token, tenant_id, connector_type, statement, optional operation, optional tool, optional parameters, optional content_type
/api/v1/mcp/check-outputclient_id, user_token, tenant_id, connector_type, optional response_data, optional message, optional metadata

On check-input, connector_type names the server the tool lives on, and the optional tool field (v9.10.0+) names the specific tool being invoked on it. The two are the request-plane mirror of the Decision API's target.server / target.tool and are recorded on the decision audit row as policy_details.tool_server and policy_details.tool_name. Sending both lets policies scope to a single tool on a server rather than the whole connector; when tool is omitted, only the server axis is recorded. (Pre-v9.10.0 platforms ignore an unknown tool field rather than failing — but do not rely on tool-level scoping until you are on v9.10.0 or later.)

On check-input, the optional content_type field selects the request-redaction detector; empty defaults to text/plain. A content_type with no registered detector is rejected fail-closed with HTTP 415 and the flat error body {"success": false, "error": "no redaction detector registered for content_type: ...", "blocked": false} — the engine refuses to pass through content it cannot govern, so the caller must not forward it either.

Allowed responses return { allowed, policies_evaluated, decision_id } plus optional policy_info and the redaction fields described below — every governance decision (allow and block) mints a decision_id. Block responses additionally carry explainability context that has been emitted since platform v7.1.0:

Field on a blockTypeNotes
decision_idstring (UUID)Both endpoints. Pass to GET /api/v1/decisions/{decision_id}/explain for the full DecisionExplanation.
risk_levelenumcheck-input only. low / medium / high / critical. Mirrors the highest matched policy's risk level.
policy_matchesarray of ExplainPolicycheck-input only. Every policy that contributed to the block. Each element: policy_id, policy_name, risk_level, allow_override, optional policy_version.
override_availablebooleancheck-input only. true when at least one matched policy has allow_override: true AND the caller is permitted to override. Absent on pre-v7.1.0 platforms.
override_existing_idstringcheck-input only. Identifier of an active session override that is suppressing or modifying this decision.

check-output block responses carry allowed: false, block_reason, decision_id, policies_evaluated (always serialized, but 0 on block responses — the count is only populated on the allow path), and — on an exfiltration-limit block — exfiltration_info. There is no redacted_message field on check-output: when a string output is masked on the allow path, the masked text is returned in redacted_data (see below).

For JSON shapes and per-SDK reading patterns see MCP policy enforcement: explainability fields on a block.

Redaction fields on an allow (two-touch fulfillment)

When a POST /api/v1/decide verdict carries a redact_pii obligation, a PEP discharges it by calling the endpoint the obligation names and forwarding the engine-masked content (the two-touch model). These are the fields a PEP reads off the allow path of those endpoints — they are additive (omitempty), so callers that never enabled redaction see the byte-for-byte original shape.

check-input (request phase):

FieldTypeNotes
redaction_evaluatedbooleanLoad-bearing fail-closed signal. true ⇒ the redaction detector actually ran (regardless of whether it masked anything); read redacted / redacted_statement. false or absent ⇒ the detector did not run (no detection config enabled) ⇒ a PEP fulfilling a redact_pii obligation MUST fail closed — do not forward the statement as if it were clean. This distinguishes "ran, found nothing" from "didn't run." Emitted on every evaluated allow path since platform v8.6.0.
redactedbooleantrue when the engine masked PII in the statement.
redacted_statementstringThe engine-masked request statement. Forward this — never re-derive it client-side. When redacted is true, an empty redacted_statement is a contradiction; fail closed.

check-output (response phase):

FieldTypeNotes
redaction_evaluatedbooleanSame load-bearing fail-closed signal as on check-input, emitted on this endpoint since platform v9.7.0: true ⇒ the response-redaction pipeline actually ran (regardless of whether it masked anything). false or absent (including on any pre-v9.7.0 platform, which never emits it here) ⇒ the redactor did not run ⇒ a PEP fulfilling a response-phase redact_pii obligation MUST fail closed — the absence of redacted_data cannot be trusted as "nothing to mask."
redacted_datarows or stringThe engine-masked response. For row-style results (response_data) it holds the redacted rows; for string outputs (message) it holds the masked string. Present only when something was masked. Forward only the engine-returned content.

/decide is pre-call and only emits request-phase obligations, so response fulfillment is driven entirely by the PEP's call to check-output. Independent of redaction_evaluated, a response-leg PEP fails closed on any of: non-2xx status, allowed: false, engine unreachable/timeout, or a redacted_data of an unexpected (non-string, when a string was expected) shape — it must never forward the raw backend response when the engine round-trip did not cleanly succeed.

See Building a Policy Enforcement Point for the complete decide → fulfill → forward loop and every fail-closed rule.

Proxied control-plane APIs

The Agent also proxies many Orchestrator api/v1 families, including:

Path prefixCommon use
/api/v1/processGoverned request processing
/api/v1/dynamic-policiesTenant policy CRUD
/api/v1/llm-providersLLM provider management
/api/v1/templatesPolicy template discovery and apply
/api/v1/connectorsConnector marketplace and install
/api/v1/executionsReplay and debugging
/api/v1/auditSearch, summary, and tool-call audit
/api/v1/rbi, /api/v1/sebi, /api/v1/masfeat, /api/v1/euaiactRegulated-framework compliance modules (RBI FREE-AI, SEBI, MAS FEAT, EU AI Act). Agent proxies all four to the orchestrator so the compliance family is reachable through the single entry point.
/api/v1/policy-overridesCanonical GET alias for the tenant override list. Matches the policy-categories / static-policies / dynamic-policies naming pattern. Available on platform v7.2.0+.
Available on v7.2.0

Both the /api/v1/euaiact/* proxy prefix and the /api/v1/policy-overrides GET alias shipped in platform v7.2.0. Older platforms return 404 page not found for these paths; use /api/v1/static-policies/overrides for the override list on pre-v7.2.0 agents.

What Senior Engineers Usually Do Here

  • Platform teams terminate application traffic at the Agent and keep the Orchestrator on an internal network.
  • AI application teams use gateway mode when they already own the provider call stack and just need AxonFlow governance, audit, and policy enforcement.
  • Teams moving toward more centralized operations later adopt the broader Orchestrator APIs for provider routing, policy templates, replay, and connector lifecycle management.

That progression matters commercially too: community users can start with the Agent and solid governance basics, then move into evaluation or paid tiers when they need larger policy estates, richer control-plane automation, and stronger enterprise operations.

Operational Readiness Checklist

Before relying on this page in a production rollout, pair it with the core operations docs: