콘텐츠로 이동

API introduction

Check prompts, attachments and AI responses for personal data, secrets and attacks before they reach an AI service. Each request returns one verdict.

Every analysis response carries a verdict. Branch on this one field.

verdict Meaning What your integration does
approve Nothing to stop Send it. If the response has modified_content (a masked copy), send that instead
escalate Needs a human decision Hold it; ask the user to confirm or route it to review
block Must not leave Do not send; show summary.notice to the user

Detected values are never returned. Responses name types and counts only; quoted text appears as [REDACTED:<chars>].

Callers that check data synchronously before it leaves for an AI, SaaS or the internet — isolated browsers (RBI), web proxies, DLP agents, browser extensions, in-house LLM gateways — call one endpoint per input path and branch on verdict alone. There are no product-specific fields.

Input path Endpoint Notes
A prompt typed into an input box (with earlier turns) POST /v1/analyze context · subject (user and department — values the caller holds) · destination (where it goes) · metadata (the caller’s correlation values)
A paste or short text POST /v1/analyze/text Fast mode without models — for latency-sensitive paths
Files being uploaded POST /v1/analyze/attachments A verdict per file, archives unpacked, unreadable files held (DRM documents decrypted by the caller)
An AI answer coming back (optional) POST /v1/analyze/response Before the user sees it
Result What the gateway does
approve Send it
approve + modified_content Send the masked text instead and tell the user with summary.notice
block Hold it and show summary.notice (kinds and counts only — no values)
escalate The caller’s policy — hold it, or ask the user
Timeout · 4xx · 5xx Hold it (fail-close). Retry 429 / 503 once after Retry-After

Recipes → Gateway pre-check below walks through it step by step, and examples whose names start with gw_ follow this flow. The Java, Go and Python code samples assume a server-to-server call (timeout, fail-close).

Send the API key in one header. Keys look like aeg_<env>_<key_id>_<secret> and are shown once, when issued.

X-API-Key: aeg_live_…
Authorization: Bearer aeg_live_…

Each key has scopes. A route outside the key’s scopes answers 403 before the body is read. To run requests from this page, use Set API key at the top right. The key is stored in this browser only and sent only to this server.

To call the API from a browser page on another origin (for example the docs site’s console), the server must list that exact origin in AEGIS_API_CORS_ORIGINS (CORS). Keys travel in headers only; no cookies. Operator routes (/v1/manage/* · /v1/admin/*) never take CORS.

Send what the user is about to send to POST /v1/analyze.

터미널 창
curl -s https://api-aegis.yatavai.com/v1/analyze \
-H "X-API-Key: $AEGIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "고객 홍길동 주민번호 900101-1234568 로 대출 심사 요약해줘"}'
{
"verdict": "block",
"summary": {
"notice": "입력한 내용에 주민등록번호 1건이 들어 있어 보내지 않았습니다.",
"summary": { "items": [ { "kind": "kr_rrn", "label_en": "resident registration number", "count": 1 } ] }
}
}

Every endpoint below has several ready-to-run examples: open it, choose one from Examples and press Execute. Response examples are real answers from a test server (all values are synthetic). Some examples added in this release (gw_, SDK 0.5, errors) were captured without models (L1 · L2), so text no rule catches may show escalate (l2_unavailable). Notices follow options.lang or Accept-Language.

To try verdicts without writing code, open the console: preview what a gateway would do (send, send masked, hold with a notice), send any analysis endpoint of this server from its examples and read the result, run the general, finance, non-life insurance, raw AI traffic and gateway detection suites in one go and compare with an earlier run, and see this key’s scopes, options and usage. Every endpoint has Open in console.

To check Endpoint Scope
A prompt (with chat history) POST /v1/analyze analyze
A prompt while the user types (fast, no models) POST /v1/analyze/text analyze
Many prompts at once POST /v1/analyze/batch analyze:batch
Uploaded files POST /v1/analyze/attachments analyze:files
An AI response before showing it POST /v1/analyze/response analyze
An agent tool call, MCP or A2A message POST /v1/analyze/agent analyze
Masking only POST /v1/mask mask
A policy draft before rollout POST /v1/policy/simulate policy

Every failure has the same shape. Branch on the HTTP status and error.code, not on message.

{
"error": {
"code": "VALIDATION_ERROR",
"message": "unknown option",
"request_id": "01a2216d-a7cb-76ae-b1b2-b51e393497ad",
"details": { "option": "no_such_option" }
}
}
HTTP code Meaning
400 VALIDATION_ERROR · OPTION_LOCKED Invalid body, field or option; a locked option sent with another value
401 AUTHENTICATION_ERROR Missing or invalid key
403 AUTHORIZATION_ERROR The key lacks the scope
404 NOT_FOUND Unknown route, or one the operator disabled
413 PAYLOAD_TOO_LARGE Body over the limit
429 RATE_LIMIT_EXCEEDED · QUOTA_EXHAUSTED Per-second or daily limit reached
503 SERVICE_UNAVAILABLE · CONFIG_NOT_LOADED Temporarily overloaded; configuration not loaded yet
504 TIMEOUT Processing deadline exceeded
  • Retry 429 and 503 after Retry-After (seconds). Do not retry other 4xx.
  • If you cannot get a verdict, treat it as block.
  • Send X-Request-Id ([A-Za-z0-9._:-]{1,64}) to correlate; it is echoed in the response headers and in error bodies. Quote it in support requests.
  • Default limits: text 1 MiB · batch 8 MiB · attachments 128 MiB / 32 files · 30 s per analysis (120 s for batch and attachments). Operators can change them.

All behaviour is chosen through options, layered built-in → server → key → request. GET /v1/options shows this key’s defaults and which options are locked. A locked option sent with another value returns 400 OPTION_LOCKED.

  • SDK 0.9.4 (v0.9.4) — judgments are the same as 0.9.3 (175 detection suite cases and 559 /v1/judge* responses compared, 0 changed; finance240 240/240). Under load /v1/analyze/batch · /v1/judge/batch have lower tail latency (batch and stream judgments no longer move to a separate pool of threads inside the server). Config bundles need no re-signing (>=0.1, <0.10 still applies).
  • SDK 0.9.3 (v0.9.3) — text attachments over 2 KB containing Korean and archives with Korean file names no longer fail with 500; they are judged. Other judgments are the same as 0.9.1 (175 detection suite cases and 559 /v1/judge* responses compared, 0 changed; finance240 240/240). Under load /v1/judge · /v1/judge/batch hold one inference slot per request (less /v1/judge/batch latency when saturated). Config bundles need no re-signing (>=0.1, <0.10 still applies).
  • SDK 0.9.1 (v0.9.1) — judgments are the same as 0.9.0 (175 detection suite cases and 559 /v1/judge* responses compared, 0 changed). Server-internal stability fix only (the analysis engine uses less thread stack while judging). Config bundles need no re-signing (>=0.1, <0.10 still applies).
  • SDK 0.9.0 (v0.9.0) — the default judgment models follow V2 (L1 mmBERT v16c · L2 Qwen3Guard 8B v17). On the finance test set (finance240) final decisions match V2 on 239/240. In attachments and tool results, values caught by “follow classification” rules (FC3 and below, such as account or vehicle plate numbers) now follow the channel’s policy handling (notice · allow) — an attachment is no longer blocked just because the rule’s action is mask (resident registration and card numbers are still blocked). /v1/judge* details now fill rule_handoff.policy_applied. Re-sign production config bundles with --engine-compat '>=0.1, <0.10'.
  • SDK 0.8.2 (v0.8.2) — judgments are the same as 0.8.0 (175 detection suite cases and 559 /v1/judge* responses compared, 0 changed). GET /health/ready adds the inference layer states l1 · l2 (off · ready · missing); status is unchanged. Operators can make the server refuse to start without its models with AEGIS_MODEL_REQUIRE (l1 · l1,l2). Config bundles need no re-signing (>=0.1, <0.9 still applies).
  • SDK 0.8 (v0.8.0) — judgments are the same as 0.5 (175 detection suite cases compared, 0 changed). The server can also boot on the SDK’s built-in sector bundle (general finance, non-life insurance, bank, capital, financial holding — AEGIS_API_BUNDLE_BUILTIN), so a demo or pilot needs no V2 DB export. Re-sign production config bundles with --engine-compat '>=0.1, <0.9'.
  • SDK 0.5 (develop 6163e5c) — POST /v1/analyze/ai-request: a known service’s write request is judged (L0) on its body text even when no prompt can be read (0.4 passed it as skip). A violation is a block in the service’s format with x-aegis-block: generic-body; a failed judgment is 503 (failclose). Answer fields to mask come from the host table. Text judgments are 25–32 % faster.
  • Docs — the gateway pre-check section, recipes, code samples in six languages (Go and PowerShell added; built from the edited body and parameters; Authorization: Bearer option), error examples (403, 413, 429, 503 with Retry-After and X-Request-Id), path parameter examples, a dark theme and a contents drawer on narrow screens.