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
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.

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 parameters
/api/v1/mcp/check-outputclient_id, user_token, tenant_id, connector_type, optional response_data, optional message, optional metadata

Allowed responses return the minimal { allowed, policies_evaluated } shape. 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 ExplainPolicyBoth endpoints. Every policy that contributed to the block. Each element: policy_id, policy_name, action, risk_level, allow_override, policy_description.
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.
redacted_messagestringcheck-output only. PII-masked text response. Mutually exclusive with redacted_data (rows): outputs populate at most one.

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): there is no redaction_evaluated field on this endpoint — /decide is pre-call and only emits request-phase obligations, so response fulfillment is driven entirely by the PEP's call to check-output. Read the engine-masked response from redacted_data (rows) or redacted_message (string; mutually exclusive — at most one is populated). 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: