Docs
Developer Documentation

Documentation

Everything you need to integrate Reglint's Layer 2 Agent Monitor into your AI pipeline, and how employees and admins use the Chrome Extension and Command Center.

Arabic Detection Benchmark

We measured the deployed engine on 305 Arabic test cases across the four major dialects (MSA, Gulf, Egyptian, Levantine) and all 24 base categories of the engine's 29-category taxonomy, balanced with 50 hard negatives. Every number comes straight from the run — no rounding up, no cherry-picking. The 5 extended categories (AML_STRUCTURING, KYC_BYPASS, UNAUTHORIZED_FINANCIAL_ACTION, UNAUTHORIZED_DISCLOSURE, UNSOLICITED_MARKETING) are detected by the engine but not yet stratified in this benchmark — coming in the next revision.

100% recall (95% CI 98.2–100)
99.5% precision (95% CI 97.3–99.9)
0.0% false-negative rate (95% CI 0–1.8)

205 violations caught, 0 missed, 1 false positive of 95 clean cases (a masked card with Eastern-Arabic digits). Single full-mode run on the deployed engine.

Full methodology, per-category and per-dialect tables, and honest limitations →
0

Getting Started

Get your API key and send your first compliance scan in minutes.

1

Get your API Key

Sign up at reglint.ai, then go to Settings → API Keys → Generate Key. Copy your key — it is shown once only.
2

Send your first request

Call the monitor endpoint with your agent's output and your API key:
javascript
const response = await fetch(
  'https://www.reglint.ai/api/monitor/scan',
  {
    method: 'POST',
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      agent_output: agentReply,          // your agent's response
      user_input: customerMessage,       // the message it answers (recommended: gives the engine context)
      agent_name: "my-agent",
      industry: "healthcare",
      mode: "full"
    })
  }
);
const result = await response.json();
// safe_to_deliver is true only for PASS and ALERT; branch on final_decision to deliver the right text.
switch (result.final_decision) {
  case 'BLOCK':
    return "Request blocked due to compliance violation.";       // the only hard stop
  case 'REDACT':
    return result.redacted_output;                              // deliver the redacted text
  case 'ALERT_HITL':
    return "Your request is being reviewed. We'll follow up.";  // held for review; poll disposition-status
  default:
    // PASS / ALERT: redacted_output when an identifier was masked (it equals your text when nothing was masked)
    return result.redacted_output ?? agentReply;
}

Send the customer message too. The monitor judges the agent's reply against the question it answers, so adding user_input (the customer's message) — and conversation_history for multi-turn chats — gives a better judgement. A scan sent without them (or with an empty user_input) is still scanned in full, but it is labelled reply only: the response carries metadata.context_mode: "reply_only" (otherwise "with_context") and the scan detail page shows a "Reply only" badge. The label never changes the decision.

Step 3 — Handle the response

The monitor returns a structured JSON object with the decision and all violations found:

json
{
  "scan_id": "59c7c06e-d2b8-42e0-b3b0-eac578d1caf0",
  "timestamp": "2026-09-19T17:08:17.987Z",
  "final_decision": "BLOCK | REDACT | ALERT | ALERT_HITL | PASS",
  "safe_to_deliver": false,
  "violations_count": 1,
  "violations": [
    {
      "violation_id": "SSN_EXPOSURE",
      "severity": "critical",
      "law": "Privacy Act 1974",
      "description": "Social Security Number exposed in agent output",
      "violating_text": "123-45-6789",
      "recommended_action": "REDACT",
      "source": "rules_engine",
      "floor_violation": false
    }
  ],
  "original_output": "Your SSN is 123-45-6789...",
  "redacted_output": "Your SSN is [REDACTED: SSN_EXPOSURE]...",
  "processing_time_ms": 340,
  "behavior": "block",
  "metadata": {
    "mode": "full",
    "rules_engine_matches": 1,
    "rag_used": true,
    "claude_used": true
  }
}

MENA example: a reply such as رقم الهوية الوطنية للعميل هو 1012345678 on a key whose markets include MENA returns SA_NATIONAL_ID (Saudi Personal Data Protection Law), and an IBAN such as SA03 8000 0000 6080 1016 7519 returns GCC_EG_IBAN. The Rule IDs table below lists the MENA rules too (SA_, AE_, EG_, QA_, KW_, BH_, GCC_ and AR_ ids).

Monitor Endpoint

POSThttps://www.reglint.ai/api/monitor/scan
HEADERx-api-key: YOUR_API_KEY
0b

API Reference

Every request and response field of POST /api/monitor/scan, the decision vocabulary, identifiers, errors and latency.

Machine-readable: https://www.reglint.ai/openapi.json (OpenAPI 3.1 — the scan endpoint, its errors and the outbound webhook). Import it into Postman, Insomnia or a code generator.

Request fields

POST https://www.reglint.ai/api/monitor/scan with header x-api-key and a JSON body (at most 1 MB). Only agent_output is required; the key's policy fills industry, mode, countries and rules when the request leaves them out. Unknown fields are ignored.

FieldTypeMeaning
agent_outputstring, requiredThe reply your agent is about to send. A raw OpenAI / Anthropic message object (text content or tool calls) is also accepted; any other type (number, boolean, an object with no text) is a 400 VALIDATION_ERROR on agent_output.
user_inputstringThe customer message the reply answers (optional, recommended). Gives the engine the context of the request (e.g. who is asking, what was asked); without it the reply is judged on its own.
agent_namestringWhich agent produced it — groups scans in the Violations Hub and the AI register.
industrystringRule set to apply (see Industries). If the key's policy sets an industry, the key's industry is used and this field is ignored; the response then carries X-Reglint-Industry-Applied (the one used) and X-Reglint-Industry-Overridden (the one you sent). Default: general.
mode"full" | "fast"full (default): rules + legal retrieval + model review, ~5–6 s. fast: deterministic rules only, under 1 s.
language"en" | "ar"Optional; detected from the text when absent. Any case is accepted; any other value (e.g. "fr") is a 400 VALIDATION_ERROR on language.
countriesstring[]ISO codes whose law applies, e.g. ["sa"]. Absent → the key policy's countries.
actor_type"agent" | "human"Who wrote the text. When omitted: agent for an API-key call; the Reglint browser extension sends human.
channelstringWhere it is sent. Optional. Agents and API calls: api, email, sms, chat, web, voice, phone, webhook. Browser extension: gmail, outlook, teams, slack, whatsapp, linkedin, chatgpt, claude-web, gemini, deepseek, copilot, perplexity (host forms such as mail.google.com are mapped). Any other value (e.g. "fax") is a 400 VALIDATION_ERROR on channel.
customer_idstringYour end user's id (optional, for your own correlation).
privacy_mode"strict" | "trust" | "authenticated" | "custom"Default strict. authenticated needs auth_context; custom needs custom_rules.
ai_system{ provider, model, version, name }The AI system that produced the reply (all optional strings). Fills the agent's AI register entry ("declared").
agent_metaobjectWhat your agent SDK knows: model, provider, provider_region, temperature, tools, system_prompt_hash, sdk, sdk_version — every field optional; provider / model fill the AI register ("Reported by SDK").
agent_meta.system_promptstring (≤ 32,000 chars)The system prompt TEXT, on the first scan and after a change: Reglint audits it automatically after the response. Never forwarded to the scan engine or stored on the scan.

Response fields

FieldMeaning
final_decisionBLOCK | REDACT | ALERT_HITL | ALERT | PASS — the one value your code branches on.
safe_to_delivertrue only for PASS and ALERT. A REDACT is deliverable too (as redacted_output), so branch on final_decision, never on safe_to_deliver alone.
violations[]One entry per finding: violation_id, severity, recommended_action, law, description, violating_text, source (rules_engine, claude_analysis, custom_policy …).
redacted_outputYour text with every identifier and every REDACT span masked. Deliver it on REDACT; on PASS / ALERT deliver it when present (it equals your text when nothing was masked).
original_outputYour text — except on BLOCK, where it is "[BLOCKED]", and on ALERT_HITL, where it is "[HELD_FOR_REVIEW]", in every privacy_mode (strict, the default, included). The real text still reaches the audit record and the Review Queue; never deliver original_output on those decisions.
privacy_modeThe privacy mode the scan ran in (strict when the request sent none).
behaviorThe key's extension setting — block (default) | warn-only | log-only: what the browser extension does with a non-PASS result. It is not the decision: a PASS scan carries "behavior": "block" on a key whose extension setting is block.
custom_rules_appliedtrue when privacy_mode: "custom" rules were applied. It does not say whether a company (custom) policy fired: that shows as a violation with source: "custom_policy" (e.g. CP-001), and custom_policies_evaluated tells whether every policy got a verdict.
on_errorThe key's "if Reglint can't answer in time" setting (allow | block) — on every response, decisions and errors alike.
metadata.primary_classThe class of the top finding (see below); null on PASS.
scan_idLook the scan up in the Violations Hub (Scan ID search) or the Review Queue.

recommended_action and final_decision

Each finding carries a recommended_action; the scan's final_decision is the strongest of them (BLOCK > HITL > REDACT > ALERT > PASS), after your key's rules:

recommended_actionfinal_decision it leads toWhat to do
BLOCKBLOCKDo not deliver — the only hard stop.
HITLALERT_HITLHold: a reviewer approves, rejects or edits it in the Review Queue.
REDACTREDACTDeliver redacted_output.
ALERTALERTDeliver (redacted_output when present); your team is notified.
PASSPASS (when nothing stronger)A finding kept for the audit trail only — your key set this class to PASS. Nothing to do.

metadata.primary_class is the class of the top finding (highest action, then highest severity, first listed on a tie). It can differ from violations[0].violation_id: a Layer-1 rule reports its class (GCC_EG_IBAN → BANK_ACCOUNT_DATA, AR_KYC_BYPASS_SOLICITATION → KYC_BYPASS), and the list is not sorted by action. It is null on PASS even when a PASS-level finding is listed.

Identifiers

An identifier finding — SSN, national ID, passport, driver licence, policy / insurance ID, card, account, IBAN or routing number — under a market your key has switched off, or with no article in the law of your key's countries, is ALERT, not REDACT or BLOCK, and the number is always masked in redacted_output whenever an identifier finding exists, whatever the decision. Why: without an article there is no legal basis to block the reply, but the number still never leaves unmasked. Such a finding carries "identifier_no_article_cap": true and cites "no specific article in <country> law" (or the country's data-protection article when one exists).

Raise it per key (REDACT or BLOCK) — or lower it — like any class: in Settings → API keys → Policy (the identifier rows show "Default (ALERT · masked)"), in rules_config (e.g. { "SSN_EXPOSURE": "BLOCK" }), or for a whole language group with the group keys (en, ar, ar.sa …). Your own setting is never capped. Where your countries' law does have an article, the built-in action applies.

Identifier classes: SSN_EXPOSURE, NATIONAL_ID_EXPOSURE, SA_NATIONAL_ID, AE_EMIRATES_ID, EG_NATIONAL_ID, QA_QID, BH_CPR, KW_CIVIL_ID, PASSPORT_EXPOSURE, DPPA_DRIVER_DATA, INSURANCE_ID_EXPOSURE, CREDIT_CARD_EXPOSURE, ACCOUNT_NUMBER_EXPOSURE, BANK_ACCOUNT_DATA, GCC_EG_IBAN, ROUTING_NUMBER.

Errors

Every error has the same JSON shape — error.code (stable, branch on it), error.message (human-readable) and, for a field problem, error.field. Some add a top-level field (named in the table).

json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "agent_meta.temperature must be a number between 0 and 10",
    "field": "agent_meta.temperature"
  }
}
Statuserror.codeWhenRetry?
400VALIDATION_ERROR · AGENT_OUTPUT_REQUIRED · INVALID_REQUEST_BODY · INVALID_MODE · INVALID_PRIVACY_MODE · AUTH_CONTEXT_REQUIRED · CUSTOM_RULES_REQUIREDThe request is malformed (field in error.field).No — fix the request.
401UNAUTHORIZEDx-api-key missing, invalid, revoked or expired.No.
403NO_SUBSCRIPTION (+ error.upgrade_url) · MODEL_SWITCH_FORBIDDENNo active subscription; or a test-only parameter on a customer key.No.
413PAYLOAD_TOO_LARGEBody over 1 MB.No — shorten agent_output.
429RATE_LIMIT_EXCEEDED (Retry-After header; RateLimit-* headers; retry_after in seconds)More than 120 scans per minute on this API key.Yes, after Retry-After.
429AGENT_CALL_LIMIT_REACHED (+ top-level upgrade_url)The plan's monthly scan quota is used up.No — upgrade, or wait for the next period.
500INTERNAL_ERRORUnexpected server error.Yes, with backoff; the key's on_error decides what your wrapper delivers meanwhile.
502 / 503LAMBDA_ERROR · SERVICE_UNAVAILABLE · NOT_CONFIGUREDThe scan service could not be reached or is not configured.Yes, with backoff (on_error applies).

Authentication and quota errors (401, 403, 429) should always fail closed in your wrapper — scans are not happening. Network errors and 5xx follow the key's on_error (default block).

Latency

Full mode (the default) typically answers in ~5–6 s end to end; fast mode in under 1 s. A scan with a long reply, an image to read, or many company policies takes longer — use a 30-second client timeout.

1

How It Works

Understand the Layer 2 Agent Monitor and the scan lifecycle.

What is Layer 2 Agent Monitor?

Traditional compliance tools scan inputs (documents, code, forms). The Layer 2 Agent Monitor sits downstream of your AI agent and inspects the agent's output before it reaches the end user. It acts as a real-time compliance filter — catching PII, protected health information, and regulatory violations that a language model may inadvertently expose.

Scan Lifecycle

💬

Agent Response

Your AI agent generates a text response

🔍

Reglint Scans

Regex rules run against the output in milliseconds

⚖️

Decision

BLOCK · REDACT · ALERT · PASS

👤

User Sees Result

Safe or redacted response delivered; violations logged

BLOCKResponse suppressed entirely

The agent output is never delivered. The most severe violations (e.g. bare SSNs, credit card numbers) trigger this.

REDACTSensitive text replaced

Matched substrings are replaced with [REDACTED] and the sanitised response is delivered instead.

ALERTResponse passes, team notified

The response is delivered unchanged, but a compliance alert is emailed to your configured receivers and logged in your Agents dashboard.

ALERT_HITLAlert held for human approval

A variant of ALERT: instead of being finalized automatically, the item is routed to a pending Review Queue for a person to approve, reject, or edit. Whether an item becomes ALERT_HITL is determined by the engine.

PASSNo violations found

The output is clean. The scan completes in under 1 s (fast mode) or ~5–6 s (full mode) and the response is forwarded immediately.

ALERT_HITLReview Queue — human-in-the-loop

When the engine assigns ALERT_HITL, the item is held for human review rather than being finalized automatically. It appears in the pending Review Queue at /dashboard/agents/queue (linked from the Violations Hub). A reviewer resolves each pending item with one of three actions:

  • Approve — accept the pending item.
  • Reject — decline the pending item.
  • Edit — revise the item, optionally with a note, before resolving.
2

Industries

Pass industry in your API call to focus Reglint on the regulations that matter most to you.

The industry field is optional but recommended. When set, Reglint prioritises the rule sets most relevant to your sector, improving signal quality and reducing noise.

Supported values and their primary regulation coverage:

healthcare→
HIPAAHITECHGINAADA
fintech→
PCI-DSSGLBAFCRAECOA
insurance→
Claims handlingMandatory disclosuresPolicy & national IDsSaudi PDPL
privacy→
GDPRCCPAEU AI ActBIPA
hr→
Title VIIADEAADAGINA
general→
All 157 laws and regulations

Usage

Add the industry field to your request payload:

json
{
  "agent_output": "...",
  "agent_name":   "MedicalAdvisorBot",
  "industry":     "healthcare",
  "mode":         "full"
}
3

Scan Mode

Choose between instant regex scanning or deep RAG + Claude analysis.

fastRules Engine only
  • ✓Regex pattern matching only
  • ✓Latency under 1 s
  • ✓Fully deterministic
  • –No legal citations or context
  • –No behavioural violations (discrimination, elder abuse, KYC bypass, structuring, collection abuse)
fullDefault
  • ✓Rules Engine → RAG → Claude
  • ✓~5–6 s
  • ✓Contextual + legal citations
  • ✓Fine ranges per violation

What fast mode covers

fast = deterministic patterns only (IDs, IBANs, cards, credentials, contact data). Behavioural violations (discrimination, elder abuse, KYC bypass, structuring, collection abuse) require full mode. Measured on 2026-09-21 on our 323-case Arabic test corpus: fast mode caught 61.3% of violations (56.7% with the exact expected decision); full mode caught 100%. Full is the default.

javascript
// Full — rules engine + RAG + Claude (default; omit mode to get it)
body: JSON.stringify({ agent_output: agentResponse, mode: "full" })

// Fast — deterministic patterns only (IDs, IBANs, cards, credentials, contact data).
// Behavioural violations (discrimination, elder abuse, KYC bypass, structuring,
// collection abuse) are NOT detected in fast mode.
body: JSON.stringify({ agent_output: agentResponse, mode: "fast" })
4

Default Action

Override how Reglint handles all violations in a single request.

default_action lets you override the action for all violations in a single request — useful for testing, or when you want a blanket policy for a specific agent.

AUTO

Reglint uses each rule's own default action (recommended). Same as omitting the field.

BLOCK

All violations trigger BLOCK — output is suppressed entirely.

REDACT

All violations trigger REDACT — sensitive text is masked in the response.

ALERT

All violations trigger ALERT — response is delivered, compliance team is notified.

Note: default_action overrides rules_config for all violations. If not set, per-rule configuration applies.

javascript
// AUTO — Reglint decides per rule (recommended)
body: JSON.stringify({ agent_output: agentResponse, default_action: "AUTO" })

// BLOCK — suppress everything
body: JSON.stringify({ agent_output: agentResponse, default_action: "BLOCK" })

// REDACT — mask sensitive data only
body: JSON.stringify({ agent_output: agentResponse, default_action: "REDACT" })

// ALERT — deliver + notify compliance team
body: JSON.stringify({ agent_output: agentResponse, default_action: "ALERT" })
5

Per-Rule Configuration

Override the action for individual rules stored in your customer config.

Each customer can store a rules_config map in DynamoDB. When Reglint processes a request for your customer ID, it merges your overrides with the Reglint defaults. Set a rule to IGNORE to disable it entirely.

Example config stored for your customer:

json
{
  "SSN_EXPOSURE":          "BLOCK",
  "EMAIL_EXPOSURE":        "REDACT",
  "MEDICAL_DATA_EXPOSURE": "ALERT",
  "PHONE_EXPOSURE":        "IGNORE"
}
Valid values:BLOCKREDACTALERTIGNORE

How Reglint Decides Severity

Reglint evaluates each scan in two layers. Understanding this helps you choose the right mode for your use case.

Layer 1: Rules Engine (Fast Mode)

Each of the 123 rules has a documented default action (BLOCK / REDACT / ALERT). The rules engine runs in both fast and full modes and follows these defaults exactly.

Layer 2: Claude AI (Full Mode Only)

In mode: full, Claude evaluates the violation in the context of your industry. Claude may upgrade severity (e.g., ALERT → REDACT) if the legal framework requires stricter handling. Claude does not downgrade.

Choosing Your Mode

  • Fast mode: under 1 s, deterministic patterns only (IDs, IBANs, cards, credentials, contact data). Misses behavioural violations — on our Arabic test corpus it caught 61.3% of violations (56.7% with the exact expected decision).
  • Full mode: ~5–6 s, context-aware. Best for healthcare, finance, HR.

Enforcement Patterns: When Reglint Intervenes

Reglint returns a decision + a redacted version of the AI response. You decide when and how to act on it. Three common patterns are shown below — pick the one that matches your industry's compliance posture.

Pattern 1: Pre-Display Enforcement (Strict)

Hold the AI response, scan it through Reglint, then display based on the decision. The user never sees a violation. Best for: healthcare (HIPAA), finance (GLBA), HR (EEOC).

const FALLBACK = 'Sorry, I cannot share that response right now.';
// The key's on_error ("allow" | "block"), from the last scan response; "block" until one is seen.
let onError = 'block';

async function handleUserMessage(userMessage) {
  // 1. Get AI response (held in memory, not displayed yet)
  const aiResponse = await callAIAgent(userMessage);

  // 2. Scan with Reglint BEFORE showing user
  let scan;
  try {
    const res = await fetch('https://www.reglint.ai/api/monitor/scan', {
      method: 'POST',
      headers: {
        'x-api-key': process.env.REGLINT_API_KEY,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        agent_output: aiResponse,
        industry: 'healthcare',
        mode: 'full'
      }),
      signal: AbortSignal.timeout(30000)
    });
    const body = await res.json().catch(() => null);
    if (body?.on_error === 'allow' || body?.on_error === 'block') onError = body.on_error;
    if ([401, 403, 429].includes(res.status)) return FALLBACK;          // always withheld
    if (!res.ok || !body) return onError === 'allow' ? aiResponse : FALLBACK; // 5xx: the key decides
    scan = body;
  } catch {
    return onError === 'allow' ? aiResponse : FALLBACK;                 // network error / timeout: the key decides
  }

  // 3. Apply decision — user sees only the safe version
  switch (scan.final_decision) {
    case 'BLOCK':
      return 'Sorry, I cannot help with that request.';
    case 'REDACT':
      return scan.redacted_output;  // Reglint provides this
    case 'ALERT_HITL':
      return FALLBACK;              // held for review — never the original
    case 'ALERT':
    case 'PASS':
    default:
      return scan.redacted_output ?? aiResponse;   // identifiers stay masked on ALERT / PASS too
  }
}

User experience: safe content only. Latency cost: under 1 s (fast mode) or ~5–6 s (full mode).

Pattern 2: Post-Display Warning (Soft)

Display the AI response immediately, scan in parallel, then show a warning if a violation is detected. Best for: marketing chatbots, internal tools, low-risk content.

async function handleUserMessage(userMessage) {
  // 1. Get AI response and display immediately
  const aiResponse = await callAIAgent(userMessage);
  displayInChat(aiResponse);

  // 2. Scan in background (non-blocking)
  fetch('https://www.reglint.ai/api/monitor/scan', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.REGLINT_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      agent_output: aiResponse,
      industry: 'general',
      mode: 'full'
    })
  })
  .then(r => r.json())
  .then(scan => {
    // 3. Show warning AFTER the response if violation detected
    if (scan.final_decision !== 'PASS') {
      showWarning(`Compliance flag: ${scan.violations[0].violation_id}`);
    }
  });
}

User experience: fast response, occasional warnings. Latency cost: 0ms (scan runs in parallel).

Pattern 3: Audit-Only Logging (Silent)

Display AI responses without intervention. Use Reglint to log every interaction for compliance reporting and audits. Best for: enterprise audit trails, regulated industries requiring records, monitoring without UX changes.

async function handleUserMessage(userMessage) {
  // 1. Get AI response and display immediately — no intervention
  const aiResponse = await callAIAgent(userMessage);
  displayInChat(aiResponse);

  // 2. Log to Reglint for compliance audit (silent, fire-and-forget)
  fetch('https://www.reglint.ai/api/monitor/scan', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.REGLINT_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      agent_output: aiResponse,
      user_input: userMessage,
      industry: 'fintech',
      mode: 'full',
      consent_for_training: false
    })
  });
  // No await — fire and forget. Audit happens server-side.
}

User experience: identical to no Reglint. Compliance benefit: full audit trail in your Reglint dashboard.

Which Pattern Should You Use?

Industry / Use CaseRecommended PatternWhy
Healthcare (HIPAA)Pre-Display (Strict)PHI must never reach unauthorized users
Finance (GLBA, SOX)Pre-Display (Strict)Financial data exposure has legal liability
HR / HiringPre-Display (Strict)Discrimination prevention is non-negotiable
Marketing chatbotsPost-Display (Soft)Speed matters more than strict compliance
Internal toolsAudit-OnlyEmployees trusted, but need audit trail
Customer support (general)Post-Display or Pre-DisplayDepends on data sensitivity
Education / EdTech (FERPA)Pre-Display (Strict)Student records protected by federal law

Reglint provides the decision. You provide the policy. The same rules can produce different user experiences depending on your enforcement pattern. This flexibility lets Reglint serve every industry without forcing a one-size-fits-all approach.

All 123 Rule IDs

Use any of these IDs as keys in your rules_config:

#Rule IDDefault ActionSeverityLaw
1SSN_EXPOSUREREDACTcriticalPrivacy Act 1974
2CREDIT_CARD_EXPOSUREREDACTcriticalPCI DSS Requirement 3.2
3EMAIL_EXPOSUREALERTlowGDPR Article 5, CCPA §1798.100
4PHONE_EXPOSUREALERThighTCPA, GDPR Article 5
5MEDICAL_DATA_EXPOSUREBLOCKcriticalHIPAA §164.514, GDPR Article 9
6FINANCIAL_DATA_EXPOSUREREDACTcriticalGLBA, PCI DSS
7PASSWORD_EXPOSUREBLOCKcriticalGDPR Article 32, NIST SP 800-63B
8DISCRIMINATORY_CONTENTBLOCKcriticalTitle VII, ECOA, ADA
9BIOMETRIC_DATABLOCKcriticalBIPA, GDPR Article 9
10CHILD_DATABLOCKcriticalCOPPA, GDPR Article 8
11LOCATION_TRACKINGALERThighCCPA, State Location Privacy Laws
12DATA_BULK_EXPOSUREBLOCKcriticalGDPR Article 5(1)(c), CCPA
13FERPA_STUDENT_DATAALERTcriticalFERPA 20 U.S.C. §1232g
14TCPA_MARKETINGALERThighTCPA 47 U.S.C. §227
15CAN_SPAM_VIOLATIONALERThighCAN-SPAM Act 15 U.S.C. §7704
16VPPA_VIDEO_DATAALERThighVPPA 18 U.S.C. §2710
17DPPA_DRIVER_DATAREDACTcriticalDPPA 18 U.S.C. §2721
18ECPA_WIRETAPALERTcriticalECPA 18 U.S.C. §2511
19GINA_GENETIC_DATAALERTcriticalGINA 42 U.S.C. §2000ff
20FTC_DARK_PATTERNSALERThighFTC Dark Patterns Report 2022
21EU_AI_ACT_HIGH_RISKALERTcriticalEU AI Act Article 6
22GDPR_CONSENT_VIOLATIONBLOCKcriticalGDPR Article 7
23AGE_DISCRIMINATIONBLOCKcriticalADEA 29 U.S.C. §623
24IMMIGRATION_STATUSALERTcriticalImmigration and Nationality Act
25RACIAL_LANGUAGEBLOCKcriticalCivil Rights Act Title VI
26GLBA_FINANCIAL_PRIVACYBLOCKcriticalGLBA 15 U.S.C. §6802
27SOX_FINANCIAL_MANIPULATIONALERThighSOX Section 302
28ROUTING_NUMBERREDACTcriticalGLBA
29ACCOUNT_NUMBER_EXPOSUREREDACTcriticalGLBA
30FCRA_BACKGROUND_CHECKALERThighFCRA 15 U.S.C. §1681
31PASSPORT_EXPOSUREREDACTcriticalPrivacy Act 1974
32CONTACT_PHI_COMBINATIONREDACThighGDPR Article 5
33INSURANCE_ID_EXPOSUREALERThighHIPAA §164.514, GLBA
34CFAA_UNAUTHORIZED_ACCESSALERTcriticalCFAA 18 U.S.C. §1030
35HITECH_BREACH_NOTIFICATIONALERTcriticalHITECH Act §13402 (notification in the case of breach)
36FTC_DECEPTIVE_CLAIMSALERThighFTC Act Section 5 15 U.S.C. §45
37GUARANTEED_OUTCOME_CLAIMALERThighFTC Act Section 5 15 U.S.C. §45
38KYC_BYPASS_COMMITMENTBLOCKcriticalIdentity verification before account access (KYC)
39ADA_ACCESSIBILITY_BARRIERALERThighADA Title II, WCAG 2.1 AA
40CMIA_HEALTH_DATAALERTcriticalCMIA Cal. Health & Safety Code §56
41SHIELD_ACT_DATA_EXPOSUREALERThighNY SHIELD Act N.Y. Gen. Bus. Law §899-aa
42EPRIVACY_TRACKING_CONSENTALERThighePrivacy Directive 2002/58/EC
43ADPPA_DATA_MINIMIZATIONALERThighADPPA (proposed) H.R. 8152
44STATE_PRIVACY_DATA_RIGHTSALERThighState Privacy Laws (TX, FL, OR, MT, DE, IA, IN, NJ, KY)
45MEDICAL_PHI_SOLICITATIONALERTcriticalHIPAA Privacy Rule (45 CFR Part 164)
46DISCRIMINATORY_SOLICITATIONALERTcriticalECOA Reg B 12 CFR §202.5, Title VII 42 U.S.C. §2000e, Fair Lending
47PHI_TARGETED_MARKETINGALERTcriticalHIPAA §164.508(a)(3)
48SSN_SOLICITATIONALERTlowGLBA §501(b), GLBA Safeguards Rule 16 CFR §314, NIST SP 800-53 IA-5
49PII_SOLICITATIONALERTmediumGLBA §501(b), GLBA Safeguards Rule 16 CFR §314, NIST SP 800-53 IA-5 (data minimisation)
50CONTACT_INFO_SOLICITATIONALERTlowGLBA §501(b), GLBA Safeguards Rule 16 CFR §314, NIST SP 800-53 IA-5 (data minimisation)
51FINANCIAL_PII_INSECURE_REQUESTBLOCKhighGLBA §501(b), GLBA Safeguards Rule 16 CFR §314, PCI DSS Req 3.2, NIST SP 800-53 IA-5
52OTP_SOLICITATIONBLOCKcriticalGLBA §501(b), GLBA Safeguards Rule 16 CFR §314, NIST SP 800-53 IA-5 (authenticator management)
53SANCTIONS_AWARENESSALERThighOFAC Regulations (31 CFR Chapter V), IEEPA, Executive Orders
54ELDER_FINANCIAL_ABUSEBLOCKcriticalElder Justice Act, State Elder Abuse Statutes
55PREGNANCY_DISCRIMINATION_CONTEXTALERThighTitle VII (sex discrimination includes pregnancy), FMLA
56RELIGIOUS_DISCRIMINATION_CONTEXTALERThighTitle VII, EEOC Religious Discrimination Guidelines
57NATIONAL_ORIGIN_DISCRIMINATIONALERThighTitle VII, IRCA (Immigration Reform and Control Act), EEOC
58MENTAL_HEALTH_DISCRIMINATIONALERThighADA (Americans with Disabilities Act), Mental Health Parity Act
59VETERAN_STATUS_DISCRIMINATIONALERThighUSERRA, VEVRAA
60FAMILIAL_STATUS_DISCRIMINATIONALERThighTitle VII (sex discrimination), Family Responsibilities Discrimination
61AGE_DISCRIMINATION_LANGUAGEALERThighADEA (Age Discrimination in Employment Act)
62PRIVACY_ACT_THIRD_PARTYREDACTcritical5 U.S.C. § 552a(b)
63EG_NATIONAL_IDREDACThighقانون حماية البيانات الشخصية 151/2020، المادة 1 + اللائحة التنفيذية قرار 816/2025
64SA_NATIONAL_IDREDACThighنظام حماية البيانات الشخصية السعودي، المادة 1 + اللائحة التنفيذية لنظام حماية البيانات الشخصية
65AE_EMIRATES_IDREDACThighمرسوم بقانون اتحادي رقم 45 لسنة 2021 في شأن حماية البيانات الشخصية (الإمارات)
66QA_QIDREDACThighقانون رقم 13 لسنة 2016 بشأن حماية خصوصية البيانات الشخصية (قطر)
67KW_CIVIL_IDREDACThighلائحة حماية خصوصية البيانات — قرار 26/2024 الهيئة العامة للاتصالات وتقنية المعلومات (الكويت)
68BH_CPRREDACTmediumقانون رقم (30) لسنة 2018 بإصدار قانون حماية البيانات الشخصية (البحرين)
69GCC_EG_IBANREDACThighقوانين حماية البيانات الخليجية/المصرية + تعليمات ساما لحماية عملاء البنوك
70AR_PHONE_EXPOSUREALERTmediumقوانين حماية البيانات الخليجية/المصرية (بيانات الاتصال)
71AR_ID_SOLICITATIONALERTlowقوانين حماية البيانات الخليجية/المصرية (طلب بيانات تعريفية في المحادثة)
72AR_CONTACT_SOLICITATIONALERTlowقوانين حماية البيانات الخليجية/المصرية (طلب بيانات اتصال في المحادثة)
73AR_PASSWORD_EXPOSUREBLOCKcriticalقوانين حماية البيانات + معايير أمن المعلومات (كشف كلمات المرور)
74AR_CREDENTIAL_OVER_CHATBLOCKcriticalقوانين حماية البيانات + معايير أمن المعلومات (إرسال بيانات اعتماد عبر المحادثة أو تطبيقات المراسلة)
75AR_OTP_SOLICITATIONBLOCKcriticalقوانين حماية البيانات + معايير أمن المعلومات (سرية رموز التحقق لمرة واحدة)
76AR_MEDICAL_DATABLOCKhighاللائحة التنفيذية 816/2025 (بيانات حساسة) / نظام حماية البيانات السعودي المادة 1 (البيانات الصحية)
77AR_UNSAFE_MEDICAL_ADVICEBLOCKcriticalنظام مزاولة المهن الصحية السعودي ولائحته التنفيذية
78AR_CONTROLLED_SUBSTANCEBLOCKcriticalنظام مكافحة المخدرات والمؤثرات العقلية السعودي؛ الهيئة العامة للغذاء والدواء
79AR_SELF_HARM_IDEATIONBLOCKcriticalنظام الرعاية الصحية النفسية السعودي
80SELF_HARM_RISKBLOCKcriticalJoint Commission NPSG 15.01.01 (suicide risk); FDA / DEA dispensing rules (21 CFR 1306)
81AR_SELF_HARM_NO_SUPPORTBLOCKcriticalنظام الرعاية الصحية النفسية السعودي
82SELF_HARM_NO_CRISIS_RESOURCEBLOCKcriticalJoint Commission NPSG 15.01.01 (suicide risk)
83AR_INTERPRETER_DENIALBLOCKhighنظام مزاولة المهن الصحية السعودي
84DISABILITY_ACCESS_DENIALBLOCKhighAmericans with Disabilities Act (ADA) — effective communication (auxiliary aids and services)
85AR_GENETIC_UNDERWRITINGBLOCKhighنظام حماية البيانات الشخصية السعودي
86AR_PURCHASED_LIST_MARKETINGBLOCKhighنظام الاتصالات وتقنية المعلومات
87PURCHASED_LIST_MARKETINGBLOCKhighTelephone Consumer Protection Act - 47 U.S.C. 227
88FCRA_ADVERSE_ACTION_CONCEALEDBLOCKhighFair Credit Reporting Act - 15 U.S.C. 1681 § 1681b
89HOUSING_STATUS_DISCRIMINATIONBLOCKhighFair Housing Act (42 U.S.C. 3604)
90STRUCTURING_ASSISTANCEBLOCKcriticalBank Secrecy Act - 31 U.S.C. 5324 (structuring transactions to evade reporting)
91AR_STRUCTURING_ASSISTANCEBLOCKcriticalنظام مكافحة غسل الأموال — تجزئة العمليات لتفادي الإبلاغ
92CONCEALMENT_OFFERHITLhighBank Secrecy Act - 31 U.S.C. 5318 (AML program, CDD, SAR)
93MODEL_IDENTITY_MISMATCHALERTlowOperational Compliance — AI system register accuracy
94UNVERIFIED_TRANSFER_ACTIONHITLcriticalBank Secrecy Act - 31 U.S.C. 5318 (AML program, CDD, SAR)
95AUDIT_RECORD_DESTRUCTION_STATEMENTBLOCKcriticalOperational Compliance — integrity of audit and monitoring records
96SYSTEM_PROMPT_DISCLOSUREBLOCKhighOperational Compliance — confidentiality of the AI system configuration
97FRAUD_CONTROL_DISCLOSUREBLOCKhighOperational Compliance — confidentiality of fraud and AML controls
98CONFIDENTIAL_POLICY_DISCLOSUREBLOCKhighOperational Compliance — confidentiality of internal policies
99UNDISCLOSED_COMMISSIONBLOCKhighOperational Compliance — disclosure of commissions and conflicts of interest
100CUSTOMER_RECORD_DELETIONHITLcriticalOperational Compliance — human approval before deleting customer records
101LIMIT_CHANGEHITLcriticalOperational Compliance — human approval before changing customer limits
102HIDDEN_FEE_CONCEALMENTBLOCKhighOperational Compliance — disclosure of fees and charges
103AUDIT_RECORD_DESTRUCTIONHITLcriticalOperational Compliance — integrity of audit and monitoring records
104AR_SOFT_ENDORSEMENTALERTmediumأنظمة العمل وحماية البيانات — موافقة الوكيل على طلب يمس فئة محمية أو بيانات طرف ثالث
105UNAUTHORIZED_DISCLOSUREBLOCKcriticalPDPL (personal data disclosure); Title VII §704(a) 42 U.S.C. §2000e-3(a) (retaliation)
106SOFT_COMMITMENT_THIRD_PARTYALERTmediumGLBA §6802; FTC Act §5 — commitment to retrieve or share a third party's data
107DEVICE_IDENTIFIER_EXPOSUREREDACThighTelecom subscriber data — CPNI / device identifiers (47 U.S.C. §222); أنظمة حماية البيانات الشخصية
108CPNI_THIRD_PARTY_USAGEBLOCKcriticalCPNI 47 U.S.C. §222; أنظمة حماية البيانات الشخصية وسرية الاتصالات
109AR_LENDING_DISCRIMINATIONBLOCKhighمبادئ وقواعد حماية عملاء المؤسسات المالية — البنك المركزي السعودي (ساما)، مبدأ المعاملة العادلة
110AR_LABOR_RIGHTS_DENIALHITLhighنظام العمل السعودي
111LABOR_RIGHTS_DENIALHITLhighFLSA 29 U.S.C. §206; state wage-payment laws
112AR_DOBALERTmediumقوانين حماية البيانات الخليجية/المصرية (بيانات تعريفية)
113AR_KYC_BYPASS_SOLICITATIONBLOCKcriticalمتطلبات مكافحة غسل الأموال وتمويل الإرهاب (KYC) — السعودية/الإمارات/مصر/قطر/الكويت/البحرين
114AR_KYC_DEFERRALALERTlowمتطلبات مكافحة غسل الأموال وتمويل الإرهاب (KYC) — التحقق من الهوية قبل التنفيذ
115AR_UNAUTH_FINANCIAL_ACTIONALERThighالأنظمة المصرفية وضوابط تنفيذ العمليات المالية والتفويض — إجراء مالي قبل التحقق من هوية العميل
116THIRD_PARTY_ACCOUNT_DISCLOSUREHITLhighGLBA 15 U.S.C. §6802 (disclosure of nonpublic personal information to third parties)
117IMPERSONATIONBLOCKcriticalFTC Impersonation Rule - 16 CFR Part 461 § 461.2
118IMPERSONATION_HUMAN_CLAIMBLOCKcriticalFederal Trade Commission Act - 15 U.S.C. 45
119AR_IMPERSONATION_HUMAN_CLAIMALERThighلا توجد مادة محددة
120UNVERIFIED_IDENTITY_DISCLOSUREHITLhighIdentity verification before account access (KYC)
121AR_ELDER_FINANCIAL_ABUSEBLOCKcriticalحماية كبار السن من الاستغلال المالي — ضوابط التفويض على حسابات الغير
122AR_EMPLOYMENT_DISCRIMINATIONBLOCKhighنظام العمل السعودي — المادة 3
123GUARANTEE_WITH_ID_REQUESTHITLhighFTC Act Section 5 15 U.S.C. §45
6

How to Adjust Rules

Compliance rules are regex patterns paired with an enforcement action and severity level.

Each rule is a plain JavaScript / JSON object. Reglint evaluates rules in order of severity — critical first — and takes the highest-priority action that matches. A single scan can detect multiple violations.

Rules are maintained in your Lambda layer configuration and hot-reloaded on deploy. Contact support@reglint.ai or edit the rules file directly in your infrastructure repository to add, remove, or tune patterns.

Rule Object Shape

Every rule must include these fields:

typescript
// A single compliance rule object
const rule = {
  pattern:      "\\b(?!000|666|9\\d{2})\\d{3}-(?!00)\\d{2}-(?!0000)\\d{4}\\b",
  violation_id: "SSN_EXPOSURE",
  law:          "HIPAA § 164.514 / CCPA",
  description:  "Social Security Number detected in agent output",
  action:       "BLOCK",    // "BLOCK" | "REDACT" | "ALERT"
  severity:     "critical", // "critical" | "high" | "medium"
};
FieldTypeDescription
patternstring (RegExp)Regular expression source (no delimiters). Flags i and g are applied automatically.
violation_idstringUnique machine-readable identifier. Appears in logs and dashboard.
lawstringThe regulation this rule enforces — e.g. "HIPAA § 164.514", "GDPR Art. 9".
descriptionstringHuman-readable explanation of what the rule catches.
action"BLOCK" | "REDACT" | "ALERT"Enforcement action when the pattern matches.
severity"critical" | "high" | "medium"Controls prioritisation when multiple rules fire.

When to use BLOCK vs REDACT vs ALERT

BLOCK

Use when exposure of any kind is unacceptable.

SSN\b\d{3}-\d{2}-\d{4}\bbare Social Security Number
Credit Card\b(?:4\d{12}(?:\d{3})?|5[1-5]\d{14})\bLuhn-valid card numbers
REDACT

Use when the response is still useful after masking the sensitive token.

Date of Birth\b(0?[1-9]|1[0-2])[\/\-](0?[1-9]|[12]\d|3[01])[\/\-](\d{2}|\d{4})\bMM/DD/YYYY or MM-DD-YY
Phone Number\b(\+1[\s.-]?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}\bUS phone formats
ALERT

Use when you need visibility but the data is low-risk or contextually acceptable.

MRNMRN[:\s#]*\d{5,10}Medical Record Number reference
ICD Code\b[A-Z]\d{2}(?:\.\d{1,2})?\bICD-10 diagnostic codes
7

How to Add a Webhook

Send scan results from your agent infrastructure directly to Reglint.

1

Obtain your webhook secret

Go to Settings → API & Integrations in the Reglint dashboard and copy the value of AGENT_MONITOR_SECRET. Store it as an environment variable in your agent host — never hard-code it.
2

Configure the endpoint

Point your agent to the webhook URL below. The endpoint is public and does not require a JWT — it is secured solely by the shared secret header.
POSThttps://www.reglint.ai/api/agent-monitor/webhook
HEADERx-reglint-secret: <your-secret>
3

Build the payload

Construct a JSON body matching the WebhookPayload interface. The four required fields are scan_id, customer_id, agent_name, and final_decision. All other fields are optional but recommended for full dashboard visibility.
4

Handle the response

On success the server returns HTTP 200 with { "received": true, "id": "agv_..." }. The endpoint is idempotent on scan_id — retrying a duplicate payload with the same ID will update mutable fields without creating a duplicate record.

Full Payload Shape

TypeScript interface — all optional fields are marked with ?.

typescript
// Full WebhookPayload shape (TypeScript)
interface LambdaViolation {
  violation_id?:   string;  // e.g. "SSN_EXPOSURE"
  type?:           string;  // legacy alias for violation_id
  law?:            string;  // e.g. "HIPAA § 164.514"
  description?:    string;
  violating_text?: string;  // the exact matched substring
  action?:         string;  // BLOCK | REDACT | ALERT
  severity?:       string;  // critical | high | medium
}

interface WebhookPayload {
  scan_id:             string;          // unique scan UUID (idempotency key)
  customer_id:         string;          // your Reglint user ID
  agent_name:          string;          // human-readable agent label
  industry?:           string;          // e.g. "healthcare", "fintech", "insurance" (the key policy editor values)
  final_decision:      string;          // "BLOCK" | "REDACT" | "ALERT" | "PASS"
  violations_count:    number;
  violations:          LambdaViolation[];
  original_output?:    string;          // raw agent text before redaction
  redacted_output?:    string;          // text with identifiers replaced by [REDACTED]; deliver it on PASS / ALERT / REDACT
  agent_endpoint?:     string;          // URL of the calling agent (optional)
  processing_time_ms?: number;          // scan duration
}

JavaScript Example

Using the native fetch API (Node 18+, browser, Deno, Bun).

javascript
// JavaScript — send a scan result to Reglint
const payload = {
  scan_id:          crypto.randomUUID(),
  customer_id:      "usr_YOUR_REGLINT_USER_ID",
  agent_name:       "MedicalAdvisorBot",
  industry:         "healthcare",
  final_decision:   "BLOCK",
  violations_count: 1,
  violations: [
    {
      violation_id:   "SSN_EXPOSURE",
      law:            "HIPAA § 164.514",
      description:    "SSN detected in agent response",
      violating_text: "123-45-6789",
      action:         "BLOCK",
      severity:       "critical",
    },
  ],
  original_output:    "Your SSN is 123-45-6789, here is your summary…",
  redacted_output:    "Your SSN is [REDACTED], here is your summary…",
  processing_time_ms: 42,
};

const res = await fetch(
  "https://www.reglint.ai/api/agent-monitor/webhook",
  {
    method:  "POST",
    headers: {
      "Content-Type":    "application/json",
      "x-reglint-secret": process.env.REGLINT_WEBHOOK_SECRET,
    },
    body: JSON.stringify(payload),
  }
);

const data = await res.json();
// { received: true, id: "agv_..." }
console.log(data);

Python Example

Using the requests library.

python
# Python — send a scan result to Reglint
import os
import uuid
import requests

payload = {
    "scan_id":          str(uuid.uuid4()),
    "customer_id":      "usr_YOUR_REGLINT_USER_ID",
    "agent_name":       "MedicalAdvisorBot",
    "industry":         "healthcare",
    "final_decision":   "BLOCK",
    "violations_count": 1,
    "violations": [
        {
            "violation_id":   "SSN_EXPOSURE",
            "law":            "HIPAA § 164.514",
            "description":    "SSN detected in agent response",
            "violating_text": "123-45-6789",
            "action":         "BLOCK",
            "severity":       "critical",
        }
    ],
    "original_output":    "Your SSN is 123-45-6789, here is your summary…",
    "redacted_output":    "Your SSN is [REDACTED], here is your summary…",
    "processing_time_ms": 42,
}

response = requests.post(
    "https://www.reglint.ai/api/agent-monitor/webhook",
    json=payload,
    headers={
        "x-reglint-secret": os.environ["REGLINT_WEBHOOK_SECRET"],
    },
    timeout=10,
)

data = response.json()
# {'received': True, 'id': 'agv_...'}
print(data)

Response Codes

StatusMeaning
200 OKPayload received and stored (or idempotent duplicate).
400 Bad RequestMissing required fields: scan_id, customer_id, agent_name, or final_decision.
401 UnauthorizedThe x-reglint-secret header is missing or does not match.
500 Internal Server ErrorUnexpected server error — retry with exponential back-off.

Implementation tip

Generate a fresh scan_id (UUID v4) for every unique scan. If your infrastructure retries on failure, reuse the same scan_id — Reglint will upsert rather than duplicate. Use a queue (SQS, RabbitMQ) to buffer webhooks and retry on 5xx with exponential back-off.

8

Complete Integration Example

A production-ready pattern for wrapping any AI agent with Reglint compliance.

This example wraps any AI agent call with Reglint and handles all four decision outcomes. Drop it into your backend as a utility and call it wherever you invoke an agent.

If Reglint can't answer in time

Each API key has one setting for what a client does with a message when a scan cannot complete — a timeout, a network error or a server error (5xx): Allow the message (send it unchecked) or Block the message (hold it). Set it in Settings → API keys → Policy, next to Markets. Block is the default for every key, new and existing: until an admin explicitly chooses Allow, a failed scan holds the message.

Every scan response for the key — a decision or an error — carries it as on_error ("allow" | "block"), because when the API is unreachable there is no response to read: a client keeps the last value it saw and, until it has seen one, blocks. The examples on this page, the Chrome extension and the Simulator all follow it. 401, 403 and 429 are always withheld whatever the setting says: they mean scans are not happening.

The trade-off is availability against safety. Allow keeps people and agents working during an outage, but anything sent in that window was never checked. Block guarantees nothing leaves unchecked, but stops sending until Reglint answers again. Regulated customers (healthcare, finance, HR, government) should keep Block. Allow is an explicit choice for teams that put availability first, and the Policy Editor shows this warning next to it.

It does not change how a scan that does complete is decided: human review (HITL) holds and the hard-floor rules are unaffected, and the key's separate engine fail mode still decides what happens when the analysis step fails inside a scan that returns.

javascript
const REGLINT_ENDPOINT =
  'https://www.reglint.ai/api/monitor/scan';
const FALLBACK = "I can't share that response. A member of our team will follow up.";
// Your key's "If Reglint can't answer in time" setting (Settings → API keys → Policy). Every scan
// response for the key, success or error, carries it as on_error ("allow" | "block"); keep the last
// one seen. Until one has been seen (the very first call fails) the safe default is "block".
let onError = 'block';

async function runAgentWithReglint(userMessage, agentName, industry) {
  const agentResponse = await myAIAgent.run(userMessage);
  const unavailable = () => onError === 'allow'
    ? { delivered: true, message: agentResponse, violations: [], scanned: false }
    : { delivered: false, message: FALLBACK, violations: [], scanned: false };

  let result;
  try {
    const res = await fetch(REGLINT_ENDPOINT, {
      method: 'POST',
      headers: {
        'x-api-key': process.env.REGLINT_API_KEY,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        agent_output: agentResponse,
        agent_name: agentName,
        industry: industry,
        mode: 'full',
        default_action: 'AUTO'
      }),
      signal: AbortSignal.timeout(30000)
    });
    const body = await res.json().catch(() => null);
    if (body?.on_error === 'allow' || body?.on_error === 'block') onError = body.on_error;
    // 401 / 403 / 429: scans are not happening. Always withhold, whatever on_error says.
    if ([401, 403, 429].includes(res.status)) {
      return { delivered: false, message: FALLBACK, violations: [], scanned: false };
    }
    // 5xx or any other error: the key's on_error decides.
    if (!res.ok || !body) return unavailable();
    result = body;
  } catch (err) {
    // Network error or timeout: the key's on_error (the last value seen) decides.
    return unavailable();
  }

  switch (result.final_decision) {
    case 'BLOCK':
      return {
        delivered: false,
        message: "Unable to process this request due to compliance restrictions.",
        violations: result.violations
      };
    case 'REDACT':
      return {
        delivered: true,
        message: result.redacted_output,
        violations: result.violations
      };
    case 'ALERT_HITL':
      // Held for review: not delivered until a reviewer approves / edits (poll disposition-status).
      return {
        delivered: false,
        message: "Your request is being reviewed. We'll follow up shortly.",
        violations: result.violations
      };
    case 'ALERT':
      return {
        delivered: true,
        message: agentResponse,
        violations: result.violations
      };
    case 'PASS':
    default:
      return {
        delivered: true,
        message: agentResponse,
        violations: []
      };
  }
}
BLOCK

delivered: false — show a generic error to the user.

REDACT

delivered: true — serve redacted_output instead of the original.

ALERT

delivered: true — serve redacted_output (any identifier stays masked; otherwise it equals the original). Compliance team is notified via email.

PASS

delivered: true — serve redacted_output (equals the original when nothing was masked). No violations found, no action needed.

9

Supported Integrations

Reglint is model-agnostic. Any LLM output, any framework, any language.

Reglint exposes a plain HTTP REST API — there is no SDK required and no vendor lock-in. If your agent can make an HTTP POST request, it works with Reglint. The table below lists tested integrations with copy-paste examples.

Pass agent_name as a human-readable label so violations are correctly attributed in your Agents dashboard.

Also send agent_meta: what your code knows about the AI system behind the agent — { "model": "gpt-4o-mini", "provider": "OpenAI", "system_prompt": "…" }. The model and provider fill the agent's identity on the Actors page (“Reported by SDK”). Send the system prompt text on the first scan of the process and whenever it changes (at most 32,000 characters): Reglint audits it automatically and the Build card shows the result. Every example below sends it.

Pega, Appian and UiPath

Each platform calls the same endpoint: POST https://www.reglint.ai/api/monitor/scan with the header x-api-key and a JSON body { "agent_output": <reply>, "user_input": <customer message>, "agent_name": <bot name> }. Branch on final_decision: BLOCK stops, REDACT sends redacted_output, ALERT_HITL waits for review, PASS / ALERT send the reply. There is no Reglint connector to install on these platforms.

  • Pega — create a Connect REST rule for the endpoint (POST, JSON), map the reply and the customer message into the request data transform, and add a decision shape on final_decision before the Send Email / chat step.
  • Appian — add a Connected System (HTTP, API key header) and an Integration object for the POST; call it from the process model before the message is sent, and route with an XOR gateway on final_decision.
  • UiPath — use the HTTP Request activity (UiPath.WebAPI.Activities) with the POST body above, deserialize the response (Deserialize JSON), and put a Switch on final_decision before the activity that sends the message.
Provider / FrameworkTypeagent_name suggestionNotes
OpenAI (GPT-4, GPT-3.5)LLM"gpt4o-agent"Scan chat.completions response before returning to user.
Anthropic ClaudeLLM"claude-agent"Scan message.content[0].text from Messages API.
Google GeminiLLM"gemini-agent"Scan response.candidates[0].content.parts[0].text.
Meta Llama (via Ollama)Local LLM"ollama-llama3"Run Ollama locally; scan response.response field.
MistralLLM"mistral-agent"Mistral API or local — scan the text output.
CohereLLM"cohere-agent"Scan response.text from Co.generate or Co.chat.
LangChainFramework"langchain-chain"Callback handler or a last runnable step that scans the final output — complete code in 9b. Framework recipes.
LlamaIndexFramework"llamaindex-query"Wrap QueryEngine.query() response.response.
CrewAIFramework"crewai-crew"Scan crew.kickoff() final output string.
Any custom model (HTTP API)Custom"custom-model"Works with any model accessible via HTTP — local or hosted.

TypeScript + OpenAI (GPT-4o)

Full compliance wrapper using the OpenAI Node SDK and fetch.

typescript
import OpenAI from 'openai';

const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
const REGLINT_ENDPOINT = 'https://www.reglint.ai/api/monitor/scan';
const MODEL = 'gpt-4o';
const SYSTEM_PROMPT = 'You are a helpful assistant.';
// agent_meta: what this code knows about the AI system. The prompt text is sent on the first scan of the process
// (and again whenever it changes), so Reglint audits it automatically; its sha256 is sent every time.
let promptSent = false;
const FALLBACK = "I can't share that response. A member of our team will follow up.";
// The key's on_error ("allow" | "block"), from the last scan response; "block" until one is seen.
let onError: 'allow' | 'block' = 'block';

async function runCompliantAgent(userMessage: string): Promise<{
  delivered: boolean;
  message: string;
  violations: unknown[];
}> {
  // 1. Get GPT-4o response
  const completion = await openai.chat.completions.create({
    model: MODEL,
    messages: [
      { role: 'system', content: SYSTEM_PROMPT },
      { role: 'user',   content: userMessage },
    ],
  });
  const rawOutput = completion.choices[0].message.content ?? '';

  // 2. Scan with Reglint
  const withheld = { delivered: false, message: FALLBACK, violations: [] };
  const unavailable = () => (onError === 'allow' ? { delivered: true, message: rawOutput, violations: [] } : withheld);
  let scan;
  try {
    const res = await fetch(REGLINT_ENDPOINT, {
      method: 'POST',
      headers: {
        'x-api-key': process.env.REGLINT_API_KEY!,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        agent_output: rawOutput,
        agent_name:   'gpt4o-assistant',
        industry:     'general',
        mode:         'full',
        agent_meta: {
          model:    completion.model,             // e.g. "gpt-4o-2024-08-06"
          provider: 'OpenAI',
          ...(promptSent ? {} : { system_prompt: SYSTEM_PROMPT }),
        },
      }),
      signal: AbortSignal.timeout(30_000),
    });
    const body = await res.json().catch(() => null);
    if (res.ok) promptSent = true;
    if (body?.on_error === 'allow' || body?.on_error === 'block') onError = body.on_error;
    if ([401, 403, 429].includes(res.status)) return withheld; // scans are not happening: always withheld
    if (!res.ok || !body) return unavailable();                 // 5xx: the key's on_error decides
    scan = body;
  } catch {
    return unavailable();                                       // network error / timeout: the key's on_error
  }

  // 3. Enforce decision
  switch (scan.final_decision) {
    case 'BLOCK':
      return { delivered: false, message: 'Response blocked due to compliance violation.', violations: scan.violations };
    case 'REDACT':
      return { delivered: true, message: scan.redacted_output ?? FALLBACK, violations: scan.violations };
    case 'ALERT_HITL':   // held for review: not delivered (poll disposition-status for the reviewer's decision)
      return { delivered: false, message: FALLBACK, violations: scan.violations };
    default:             // PASS / ALERT: redacted_output keeps any identifier masked
      return { delivered: true, message: scan.redacted_output ?? rawOutput, violations: scan.violations ?? [] };
  }
}

const result = await runCompliantAgent('Summarize the customer account.');
console.log(result.delivered ? result.message : '⛔ Blocked');

Python + OpenAI

Using the openai Python SDK, with agent_meta so the agent's model, provider and system prompt reach Reglint.

python
import os
import requests
from openai import OpenAI

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
REGLINT_API_KEY  = os.environ["REGLINT_API_KEY"]
REGLINT_ENDPOINT = "https://www.reglint.ai/api/monitor/scan"
MODEL = "gpt-4o-mini"
SYSTEM_PROMPT = "You are a helpful insurance claims assistant."
FALLBACK = "I can't share that response. A member of our team will follow up."
ON_ERROR = "block"        # the key's on_error, from the last scan response
PROMPT_SENT = False       # the prompt text goes on the first scan of the process (Reglint audits it)


def run_compliant_openai(user_message: str, industry: str = "insurance") -> dict:
    global ON_ERROR, PROMPT_SENT

    # 1. Call OpenAI
    completion = client.chat.completions.create(
        model=MODEL,
        messages=[{"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": user_message}],
    )
    raw_output = completion.choices[0].message.content or ""

    # 2. Scan with Reglint (agent_meta = what this code knows about the AI system)
    agent_meta = {"model": completion.model, "provider": "OpenAI"}
    if not PROMPT_SENT:
        agent_meta["system_prompt"] = SYSTEM_PROMPT
    withheld = {"delivered": False, "message": FALLBACK, "violations": []}
    unavailable = lambda: {"delivered": True, "message": raw_output, "violations": []} if ON_ERROR == "allow" else withheld
    try:
        r = requests.post(
            REGLINT_ENDPOINT,
            json={
                "agent_output": raw_output,
                "agent_name":   "claims-assistant",
                "industry":     industry,
                "mode":         "full",
                "agent_meta":   agent_meta,
            },
            headers={"x-api-key": REGLINT_API_KEY},
            timeout=30,
        )
    except requests.RequestException:
        return unavailable()          # network error / timeout: the key's on_error
    try:
        body = r.json()
    except ValueError:
        body = None
    if isinstance(body, dict) and body.get("on_error") in ("allow", "block"):
        ON_ERROR = body["on_error"]
    if r.ok:
        PROMPT_SENT = True
    if r.status_code in (401, 403, 429):
        return withheld               # scans are not happening: always withheld
    if not r.ok or not isinstance(body, dict):
        return unavailable()          # 5xx: the key's on_error decides

    # 3. Enforce the decision
    if body["final_decision"] == "BLOCK":
        return {"delivered": False, "message": FALLBACK, "violations": body.get("violations", [])}
    if body["final_decision"] == "REDACT":
        return {"delivered": True, "message": body.get("redacted_output") or FALLBACK, "violations": body.get("violations", [])}
    if body["final_decision"] == "ALERT_HITL":   # held for review: not delivered until a reviewer decides
        return {"delivered": False, "message": FALLBACK, "violations": body.get("violations", [])}
    # PASS / ALERT: redacted_output keeps any identifier masked (it equals raw_output when nothing was masked)
    return {"delivered": True, "message": body.get("redacted_output") or raw_output, "violations": body.get("violations", [])}

Python + Anthropic Claude

Using the anthropic Python SDK with Reglint compliance scanning.

python
import os
import requests
import anthropic

claude = anthropic.Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
REGLINT_API_KEY  = os.environ["REGLINT_API_KEY"]
REGLINT_ENDPOINT = "https://www.reglint.ai/api/monitor/scan"
FALLBACK = "I can't share that response. A member of our team will follow up."
SYSTEM_PROMPT = "You are a helpful assistant."
# The key's "If Reglint can't answer in time" setting: every scan response for the key, success or
# error, carries it as on_error ("allow" | "block"). Keep the last one seen; "block" until one is seen.
ON_ERROR = "block"
PROMPT_SENT = False   # agent_meta.system_prompt goes on the first scan of the process (Reglint audits it)


def run_compliant_claude(user_message: str, industry: str = "general") -> dict:
    """Run a Claude agent and scan its output with Reglint before returning."""
    global ON_ERROR, PROMPT_SENT

    # 1. Call Claude
    message = claude.messages.create(
        model="claude-opus-4-7",
        max_tokens=1024,
        system=SYSTEM_PROMPT,
        messages=[{"role": "user", "content": user_message}],
    )
    raw_output = message.content[0].text

    # 2. Scan with Reglint
    withheld = {"delivered": False, "message": FALLBACK, "violations": []}
    unavailable = lambda: {"delivered": True, "message": raw_output, "violations": []} if ON_ERROR == "allow" else withheld
    try:
        r = requests.post(
            REGLINT_ENDPOINT,
            json={
                "agent_output":   raw_output,
                "agent_name":     "claude-opus-4-agent",
                "industry":       industry,
                "mode":           "full",
                "default_action": "AUTO",
                # what this code knows about the AI system
                "agent_meta": {
                    "model": message.model,
                    "provider": "Anthropic",
                    **({} if PROMPT_SENT else {"system_prompt": SYSTEM_PROMPT}),
                },
            },
            headers={"x-api-key": REGLINT_API_KEY},
            timeout=30,
        )
    except requests.RequestException:
        return unavailable()          # network error / timeout: the key's on_error (last seen)
    try:
        body = r.json()
    except ValueError:
        body = None
    if isinstance(body, dict) and body.get("on_error") in ("allow", "block"):
        ON_ERROR = body["on_error"]
    if r.ok:
        PROMPT_SENT = True
    if r.status_code in (401, 403, 429):
        return withheld               # scans are not happening: always withheld
    if not r.ok or not isinstance(body, dict):
        return unavailable()          # 5xx: the key's on_error decides
    scan = body

    decision = scan["final_decision"]

    if decision == "BLOCK":
        return {
            "delivered": False,
            "message":   "Blocked — compliance violation detected.",
            "violations": scan.get("violations", []),
        }
    elif decision == "REDACT":
        return {
            "delivered": True,
            "message":   scan.get("redacted_output") or FALLBACK,
            "violations": scan.get("violations", []),
        }
    elif decision == "ALERT_HITL":   # held for review: not delivered until a reviewer decides
        return {"delivered": False, "message": FALLBACK, "violations": scan.get("violations", [])}
    else:  # ALERT or PASS: redacted_output keeps any identifier masked
        return {
            "delivered": True,
            "message":   scan.get("redacted_output") or raw_output,
            "violations": scan.get("violations", []),
        }


if __name__ == "__main__":
    result = run_compliant_claude("Show me the patient's latest test results.", industry="healthcare")
    if result["delivered"]:
        print("Agent:", result["message"])
    else:
        print("Blocked:", result["message"])
        for v in result["violations"]:
            print(f"  • {v.get('violation_id')} — {v.get('law')}")

Python + Llama (via Ollama)

Run a local Llama model with Ollama and scan its output — zero cloud LLM dependency.

python
import os
import requests

# Ollama runs locally at http://localhost:11434 by default
OLLAMA_ENDPOINT  = "http://localhost:11434/api/generate"
REGLINT_API_KEY  = os.environ["REGLINT_API_KEY"]
REGLINT_ENDPOINT = "https://www.reglint.ai/api/monitor/scan"
FALLBACK = "Response withheld: the compliance check is unavailable."
# The key's "If Reglint can't answer in time" setting: every scan response for the key, success or
# error, carries it as on_error ("allow" | "block"). Keep the last one seen; "block" until one is seen.
ON_ERROR = "block"


def run_compliant_llama(prompt: str, model: str = "llama3.2") -> dict:
    """Run a local Llama model via Ollama and scan its output with Reglint."""
    global ON_ERROR

    # 1. Call Ollama / local Llama
    ollama_res = requests.post(
        OLLAMA_ENDPOINT,
        json={"model": model, "prompt": prompt, "stream": False},
        timeout=60,
    ).json()
    raw_output = ollama_res.get("response", "")

    # 2. Scan with Reglint (full mode: patterns + legal judgment)
    withheld = {"delivered": False, "message": FALLBACK, "violations": []}
    unavailable = lambda: {"delivered": True, "message": raw_output, "violations": []} if ON_ERROR == "allow" else withheld
    try:
        r = requests.post(
            REGLINT_ENDPOINT,
            json={
                "agent_output": raw_output,
                "agent_name":   f"ollama-{model}",
                "industry":     "privacy",
                "mode":         "full",
                # what this code knows about the AI system (no system prompt in this example: none to send)
                "agent_meta":   {"model": model, "provider": "Ollama (self-hosted)", "system_prompt": None},
            },
            headers={"x-api-key": REGLINT_API_KEY},
            timeout=30,
        )
    except requests.RequestException:
        return unavailable()          # network error / timeout: the key's on_error (last seen)
    try:
        body = r.json()
    except ValueError:
        body = None
    if isinstance(body, dict) and body.get("on_error") in ("allow", "block"):
        ON_ERROR = body["on_error"]
    if r.status_code in (401, 403, 429):
        return withheld               # always withheld
    if not r.ok or not isinstance(body, dict):
        return unavailable()          # 5xx: the key's on_error decides
    scan = body

    decision = scan["final_decision"]
    latency  = scan.get("processing_time_ms")
    print(f"[Reglint] decision={decision}, violations={scan.get('violations_count', 0)}, latency={latency}ms")

    if decision == "BLOCK":
        return {"delivered": False, "message": "Response blocked.",                      "violations": scan.get("violations", [])}
    elif decision == "REDACT":
        return {"delivered": True,  "message": scan.get("redacted_output") or FALLBACK,  "violations": scan.get("violations", [])}
    elif decision == "ALERT_HITL":   # held for review
        return {"delivered": False, "message": FALLBACK,                                 "violations": scan.get("violations", [])}
    else:  # PASS / ALERT: redacted_output keeps any identifier masked
        return {"delivered": True,  "message": scan.get("redacted_output") or raw_output, "violations": scan.get("violations", [])}


if __name__ == "__main__":
    result = run_compliant_llama("Tell me about this user's medical history.")
    if result["delivered"]:
        print("Output:", result["message"])
    else:
        print("Blocked — not delivered to user.")

Works With Any Language

Reglint is a plain REST API — no SDK needed. Any programming language that can send an HTTP POST request works out of the box. The integration is always the same three steps:

  1. Get your agent's raw output.
  2. POST it to the Reglint monitor endpoint with your API key.
  3. Check final_decision and enforce accordingly.
PythonTypeScriptJavaScriptGoRustJavaRubyPHPC#KotlinSwiftBash / cURL
bash
# The simplest possible integration — any language, any shell
curl -X POST https://www.reglint.ai/api/monitor/scan \
  -H "x-api-key: $REGLINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_output":   "'"$AGENT_OUTPUT"'",
    "agent_name":     "my-agent",
    "industry":       "healthcare",
    "mode":           "full"
  }' | jq '.final_decision'
9b

Framework recipes

Complete, copyable wrappers for LangChain and the OpenAI Agents SDK — every decision handled.

LangChain — callback handler

A BaseCallbackHandler that scans the outermost chain's final output (not every intermediate step), stops a BLOCK or held reply, and invoke_compliant() returns the text to deliver. For a guard as the last step of the chain instead (a runnable), see sdk-wrappers.md and the Simulator's LangChain snippet.

python
# LangChain (Python): a callback handler that scans the chain's FINAL output with Reglint.
# A callback can observe the output but not replace it, so the handler records the scan and stops a BLOCK / held reply,
# and invoke_compliant() returns the text to deliver (redacted_output for REDACT and whenever an identifier was masked).
import hashlib, os
import langchain_core, requests
from langchain_core.callbacks import BaseCallbackHandler

REGLINT_ENDPOINT = "https://www.reglint.ai/api/monitor/scan"
FALLBACK = "I can't share that response. A member of our team will follow up."
HELD = "Your request is being reviewed. We'll follow up."
# The key's on_error ("allow" | "block") from the last scan response; "block" until one is seen.
ON_ERROR = "block"

class ReglintStopped(Exception):
    def __init__(self, scan: dict):
        super().__init__(scan.get("final_decision"))
        self.scan = scan

class ReglintCallbackHandler(BaseCallbackHandler):
    raise_error = True  # let ReglintStopped reach the caller

    def __init__(self, agent_name: str, provider: str, model: str, system_prompt: str | None = None):
        self.agent_name, self.provider, self.model, self.system_prompt = agent_name, provider, model, system_prompt
        self.scan: dict | None = None
        self._sent: set[str] = set()

    def _agent_meta(self) -> dict:
        meta = {"model": self.model, "provider": self.provider, "sdk": "langchain", "sdk_version": langchain_core.__version__}
        if self.system_prompt:
            h = "sha256:" + hashlib.sha256(self.system_prompt.encode()).hexdigest()
            meta["system_prompt_hash"] = h
            if h not in self._sent and len(self.system_prompt) <= 32_000:
                meta["system_prompt"] = self.system_prompt  # first scan / after a change: Reglint audits it
                self._sent.add(h)
        return meta

    def on_chain_end(self, outputs, *, run_id, parent_run_id=None, **kwargs):
        global ON_ERROR
        if parent_run_id is not None:  # only the outermost chain's final answer, not every step
            return
        text = outputs if isinstance(outputs, str) else getattr(outputs, "content", None) or str(outputs)
        unavailable = {"final_decision": "UNAVAILABLE"}
        try:
            r = requests.post(REGLINT_ENDPOINT, timeout=30,
                              headers={"x-api-key": os.environ["REGLINT_API_KEY"]},
                              json={"agent_output": text, "agent_name": self.agent_name, "actor_type": "agent",
                                    "ai_system": {"provider": self.provider, "model": self.model},
                                    "agent_meta": self._agent_meta()})
        except requests.RequestException:  # network error / timeout: the key's on_error
            if ON_ERROR == "allow":
                return                      # deliver unscanned (an explicit choice on the key)
            raise ReglintStopped(unavailable)
        try:
            body = r.json()
        except ValueError:
            body = None
        if isinstance(body, dict) and body.get("on_error") in ("allow", "block"):
            ON_ERROR = body["on_error"]
        if r.status_code in (401, 403, 429):
            raise ReglintStopped(unavailable)  # scans are not happening: always fail closed
        if not r.ok or not isinstance(body, dict):  # 5xx: the key's on_error
            if ON_ERROR == "allow":
                return
            raise ReglintStopped(unavailable)
        self.scan = body
        if body["final_decision"] in ("BLOCK", "ALERT_HITL"):
            raise ReglintStopped(body)

def invoke_compliant(chain, inputs: dict, handler: ReglintCallbackHandler) -> str:
    handler.scan = None
    try:
        output = chain.invoke(inputs, config={"callbacks": [handler]})
    except ReglintStopped as stop:
        return HELD if stop.scan.get("final_decision") == "ALERT_HITL" else FALLBACK  # BLOCK / unavailable
    text = output if isinstance(output, str) else getattr(output, "content", str(output))
    scan = handler.scan or {}  # empty: Reglint unavailable and the key's on_error is "allow"
    if scan.get("final_decision") == "REDACT":
        return scan.get("redacted_output") or FALLBACK
    return scan.get("redacted_output") or text  # PASS / ALERT: any identifier stays masked

# Usage
# handler = ReglintCallbackHandler("claims-assistant", provider="OpenAI", model="gpt-4o-2024-08-06", system_prompt=SYSTEM)
# answer = invoke_compliant(prompt | llm | StrOutputParser(), {"question": q}, handler)

OpenAI Agents SDK — output guardrail

Limitation: an Agents SDK output guardrail can only trip (stop the run) or let the answer through — it cannot rewrite the answer and has no "hold for review". So it can express BLOCK, but not REDACT or HITL by itself. The pattern below covers all five decisions: the guardrail trips on BLOCK and ALERT_HITL and hands the scan back as output_info; after the run your code delivers redacted_output (REDACT, or PASS / ALERT with an identifier masked); a held reply is sent only once a reviewer approves it in the Review Queue.

python
# OpenAI Agents SDK (Python). An output guardrail can only trip (stop the run) — it cannot rewrite the answer, so it
# cannot express REDACT, and a trip cannot mean "hold for a reviewer". The pattern: the guardrail trips on BLOCK and
# ALERT_HITL and returns the scan as output_info; after the run you deliver redacted_output (REDACT, or PASS / ALERT
# with an identifier masked). A held reply (ALERT_HITL) is delivered only after a reviewer approves it in the Review Queue.
import os, httpx
from agents import (Agent, GuardrailFunctionOutput, OutputGuardrailTripwireTriggered, RunContextWrapper, Runner,
                    output_guardrail)

REGLINT_ENDPOINT = "https://www.reglint.ai/api/monitor/scan"
FALLBACK = "I can't share that response. A member of our team will follow up."
HELD = "Your request is being reviewed. We'll follow up."
# The key's on_error ("allow" | "block") from the last scan response; "block" until one is seen.
ON_ERROR = "block"

@output_guardrail
async def reglint_guardrail(ctx: RunContextWrapper, agent: Agent, output) -> GuardrailFunctionOutput:
    global ON_ERROR
    unavailable = {"final_decision": "UNAVAILABLE"}
    try:
        async with httpx.AsyncClient(timeout=30) as client:
            r = await client.post(REGLINT_ENDPOINT, headers={"x-api-key": os.environ["REGLINT_API_KEY"]},
                                  json={"agent_output": str(output), "agent_name": agent.name, "actor_type": "agent",
                                        "agent_meta": {"model": agent.model if isinstance(agent.model, str) else None,
                                                       "provider": "OpenAI", "sdk": "openai-agents",
                                                       "system_prompt": agent.instructions if isinstance(agent.instructions, str) else None}})
    except httpx.HTTPError:  # network error / timeout: the key's on_error
        return GuardrailFunctionOutput(output_info=unavailable, tripwire_triggered=ON_ERROR != "allow")
    try:
        body = r.json()
    except ValueError:
        body = None
    if isinstance(body, dict) and body.get("on_error") in ("allow", "block"):
        ON_ERROR = body["on_error"]
    if r.status_code in (401, 403, 429):  # scans are not happening: always fail closed
        return GuardrailFunctionOutput(output_info=unavailable, tripwire_triggered=True)
    if not r.is_success or not isinstance(body, dict):  # 5xx: the key's on_error
        return GuardrailFunctionOutput(output_info=unavailable, tripwire_triggered=ON_ERROR != "allow")
    return GuardrailFunctionOutput(output_info=body, tripwire_triggered=body["final_decision"] in ("BLOCK", "ALERT_HITL"))

agent = Agent(name="Claims assistant", instructions="You are a claims assistant.", model="gpt-4o",
              output_guardrails=[reglint_guardrail])

async def answer(question: str) -> str:
    try:
        run = await Runner.run(agent, question)
    except OutputGuardrailTripwireTriggered as e:
        scan = e.guardrail_result.output.output_info or {}
        return HELD if scan.get("final_decision") == "ALERT_HITL" else FALLBACK   # BLOCK / unavailable
    scan = next((g.output.output_info for g in run.output_guardrail_results), {}) or {}
    if scan.get("final_decision") == "REDACT":
        return scan.get("redacted_output") or FALLBACK   # the guardrail could not rewrite it — you do
    return scan.get("redacted_output") or str(run.final_output)   # PASS / ALERT: identifiers stay masked
10

Email Alerts

Who gets notified when violations are detected. In production, the API-key administrator controls this in Settings → Notifications.

Reglint can email your team when compliance violations are detected. In production, the API-key administrator controls alerts in Settings → Notifications: per API key, email alerts on or off, which decisions (BLOCK / REDACT / ALERT) send, source (all, AI agents only, employees only), minimum severity, the receivers, and immediate or daily-digest delivery for ALERT. Items held for review always notify.

The email_alerts request field is for testing, like the Simulator: when present it overrides the key's settings for that request and the response includes "email_alerts_override": true. Omit it in production code.

Production (no email_alerts)

Omit email_alerts and the scanning key's Settings → Notifications apply. A key nobody has edited sends BLOCK, REDACT and ALERT alerts, from all sources and every severity, immediately, to your account alert email.

javascript
// Production: no email_alerts — the key's administrator sets alerts in Settings → Notifications
const response = await fetch('https://www.reglint.ai/api/monitor/scan', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    agent_output: agentResponse,
    agent_name:   'my-bot',
    industry:     'healthcare',
    mode:         'full',
  }),
});

Who Receives Alerts

SourceRecipients
API / SDK agent or Chrome extension (production)The receivers in the scanning key's Settings → Notifications, when the scan passes its filters (on/off, decision, source, minimum severity). Default: your account alert email.
Request with email_alerts (testing)The receivers of every enabled entry whose alert_on and severity_min match. The key's settings are not used for that request.
Held for review (ALERT_HITL)Always sent, immediately, ignoring every filter: the key's receivers (or, under the testing override, your account alert email plus every enabled email_alerts receiver).

Hourly Limit, Digest and On/Off Switch

  • Hourly limit. Each account gets up to 20 individual alert emails per clock hour by default (adjustable from 1 to 500 in Settings → Profile). Alerts over the limit are not lost: they go into the digest.
  • Digest. Alerts over the limit, and alerts from scans marked as test traffic, are batched into one digest email per recipient, hourly or daily as you choose. If total alert volume across Reglint spikes, alerts may temporarily move to the digest to protect delivery.
  • On/off switch. Turn a key's alert emails off in Settings → Notifications. With alerts off, BLOCK / REDACT / ALERT emails stop for that key; scans are still logged on the dashboard.
  • Daily digest for ALERT. A key can send ALERT emails as one daily digest instead of one email each. BLOCK, REDACT and held-for-review items stay immediate.
  • Never deferred. Items held for review (ALERT_HITL) are always emailed immediately. They are never rate-limited, batched into the digest or dropped, even with alerts off.

Custom Email Routing (for testing)

For testing, add email_alerts to a request body to route that scan's alerts by decision and severity. In production, set the same routing per key in Settings → Notifications instead.

javascript
// FOR TESTING ONLY — email_alerts overrides the key's Settings → Notifications for this request
// (the response then includes "email_alerts_override": true)
const response = await fetch('https://www.reglint.ai/api/monitor/scan', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    agent_output: agentResponse,
    agent_name:   'healthcare-bot',
    industry:     'healthcare',
    mode:         'full',
    email_alerts: [
      {
        alert_on:     ['BLOCK', 'REDACT'],
        severity_min: 'high',
        receivers:    ['compliance@yourcompany.com'],
      },
    ],
  }),
});

Configuration Schema

typescript
// TypeScript — email_alerts schema (testing override)
email_alerts?: Array<{
  enabled?:      boolean;                           // default: true — set false to skip
  alert_on?:     ('BLOCK' | 'REDACT' | 'ALERT')[]; // default: all three
  severity_min?: 'low' | 'medium' | 'high' | 'critical'; // default: 'low'
  receivers:     string[];  // required: one or more email addresses
}>

enabled — disable an alert config without removing it

Set enabled: false to temporarily silence a config entry. Useful during deployments, incident response, or testing — the config stays in your code so you can re-enable with a one-character change.

javascript
// Temporarily disable alerts without deleting the config
email_alerts: [{
  enabled:      false,          // ← flip to true to re-enable
  alert_on:     ['BLOCK', 'REDACT', 'ALERT'],
  severity_min: 'high',
  receivers:    ['compliance@company.com'],
}]

alert_on — decisions that trigger an alert

BLOCK

Critical violations — request was suppressed entirely

REDACT

Sensitive data was masked in the response

ALERT

Borderline issues flagged but response delivered

Default: all three when omitted.

severity_min — minimum severity threshold

critical

Only critical violations (SSN, PHI, PCI, credentials)

high

Critical + High (medical data, financial info, location)

medium

Critical + High + Medium (emails, phone numbers)

low

All violations — broadest coverage, most noise

Default: low (sends for all severities).

Multi-Team Routing

Pass multiple configs in the array — each entry is evaluated independently. Different teams get different alerts from the same scan:

javascript
// FOR TESTING ONLY — in production, set receivers per key in Settings → Notifications
body: JSON.stringify({
  agent_output: agentResponse,
  agent_name:   'customer-service-prod',
  industry:     'general',
  email_alerts: [
    {
      // Critical incidents → CISO immediately
      alert_on:     ['BLOCK'],
      severity_min: 'critical',
      receivers:    ['ciso@company.com'],
    },
    {
      // All violations → Compliance team
      alert_on:     ['BLOCK', 'REDACT', 'ALERT'],
      severity_min: 'low',
      receivers:    ['compliance@company.com'],
    },
    {
      // High-severity → Security team
      alert_on:     ['BLOCK', 'REDACT'],
      severity_min: 'high',
      receivers:    ['security@company.com'],
    },
  ],
})

Industry Examples

Healthcare — Compliance Team

email_alerts: [{
  alert_on: ['BLOCK', 'REDACT', 'ALERT'],
  severity_min: 'low',
  receivers: ['hipaa-compliance@hospital.com'],
}]

Banking — Fraud + Compliance

email_alerts: [{
  alert_on: ['BLOCK', 'REDACT'],
  severity_min: 'high',
  receivers: [
    'fraud@bank.com',
    'compliance@bank.com',
  ],
}]

HR — Legal Team

email_alerts: [{
  alert_on: ['BLOCK', 'ALERT'],
  severity_min: 'medium',
  receivers: ['hr-legal@company.com'],
}]

SaaS — On-Call Only Critical

email_alerts: [{
  alert_on: ['BLOCK'],
  severity_min: 'critical',
  receivers: ['oncall@company.com'],
}]

Environment-Based Routing

Use different alert configs per environment to avoid dev noise in production inboxes:

javascript
// FOR TESTING ONLY — send email_alerts from dev / staging; in production omit it
// and let the API-key administrator control alerts in Settings → Notifications.
// Development — critical only, dev team
const devAlerts = [{
  alert_on:     ['BLOCK'],
  severity_min: 'critical',
  receivers:    ['dev-team@company.com'],
}];

// Staging — high severity, QA team
const stagingAlerts = [{
  alert_on:     ['BLOCK', 'REDACT'],
  severity_min: 'high',
  receivers:    ['qa-team@company.com'],
}];

const email_alerts = process.env.NODE_ENV === 'staging'    ? stagingAlerts
                   : process.env.NODE_ENV === 'production' ? undefined   // Settings → Notifications
                   : devAlerts;

How It Works

1

Your agent sends a scan request with optional email_alerts config.
2

Reglint scans the output and determines final_decision and per-violation severity.
3

For each email_alerts entry, Reglint checks: is final_decision in alert_on? Is top severity ≥ severity_min?
4

If both conditions match, an alert is due for every address in receivers. With no email_alerts, the account alert email is used.
5

Within your hourly limit the alert is emailed right away; over it (or for test traffic) it goes into the digest. ALERT_HITL is always emailed right away.
6

Multiple configs → multiple independent recipients. One scan, many teams.

What's in Each Alert Email

✓Agent name
✓Industry
✓Final decision
✓Violation count
✓Top violations with severity
✓Scan ID
✓Timestamp
✓Dashboard link
✓Laws violated

Do

  • ✓Use severity_min: "high" for production critical paths
  • ✓Send to security@ AND compliance@ for critical violations
  • ✓Use distribution lists, not personal emails
  • ✓Test with alert_on: ["BLOCK"] first, then expand
  • ✓Use different configs per environment

Don't

  • ✗Send severity_min: "low" to executive emails (too noisy)
  • ✗Hardcode personal email addresses
  • ✗Set alert_on: ["ALERT"] only — you'll miss BLOCK events
  • ✗Forget to test your alert config before going to production

Per-scan recipient control

API and SDK agents can set recipients per scan via the email_alerts array. Each entry can target different receivers, severity thresholds, and decision filters. When it is omitted, and always for the Chrome extension, alerts go to the account alert email in Settings → Notifications.

11

Request-Level Customization

Override rule actions per-scan without touching your DynamoDB config — useful for testing, staging, or context-specific agents.

Reglint supports two levels of rule customization:

DB

Stored config (DynamoDB)

Persistent, per-customer overrides. Supports BLOCK, REDACT, ALERT, and IGNORE. Set via the Reglint dashboard or direct DynamoDB update. Applied to all scans for your customer ID.

API

Per-request override (API body)

One-time overrides sent in the request body as rules_config. Supports BLOCK, REDACT, ALERT only (not IGNORE). Applied only to this scan — no persistence.

How to Send Per-Request Overrides

Include rules_config directly in your scan request body:

javascript
// Override specific rules for this scan only — no DynamoDB update needed
body: JSON.stringify({
  agent_output: agentResponse,
  agent_name:   'medical-chatbot',
  industry:     'healthcare',
  mode:         'full',
  rules_config: {
    SSN_EXPOSURE:          'REDACT',   // downgrade from BLOCK for this scan
    MEDICAL_DATA_EXPOSURE: 'ALERT',    // downgrade from BLOCK for demo purposes
    LOCATION_TRACKING:     'ALERT',    // keep at default (no change needed if same)
  }
})

Priority Order

When multiple configuration levels exist, Reglint resolves them in this priority order (highest wins):

javascript
// Priority order (highest wins):
// 1. per-request rules_config  ← this request's body
// 2. default_action            ← blanket override, if set
// 3. DynamoDB customer config  ← stored per-customer overrides
// 4. Reglint built-in default  ← each rule's default_action field

// Example: rule SSN_EXPOSURE has built-in default = BLOCK
// DynamoDB config says SSN_EXPOSURE = REDACT
// This request says rules_config.SSN_EXPOSURE = ALERT
// → Final action = ALERT  (per-request wins)
PrioritySourceScopeSupports IGNORE?
1 (highest)Per-request rules_configThis scan onlyNo
2default_action (body field)All rules, this scanNo
3DynamoDB customer configAll scans, this customerYes
4 (lowest)Reglint built-in defaultUniversal fallbackN/A

Rule Groups

Instead of naming every rule, rules_config also accepts group keys whose value is { default_action }. A group sets the action for a whole set of rules at once:

Group keyApplies to
enAll non-Arabic (Layer-1) rules
arAll 13 Arabic Layer-1 rules
ar.sa · ar.ae · ar.eg · ar.qa · ar.kw · ar.bhThat country’s national-ID rule
json
{
  "rules_config": {
    "ar": { "default_action": "alert_hitl" },   // all Arabic rules → hold for review
    "ar.sa": { "default_action": "block" },      // …but Saudi national-ID → block
    "AR_MEDICAL_DATA": "REDACT"                   // …and this one rule → redact
  }
}

Group precedence (highest wins): per-rule id override › country group (ar.sa) › language group (ar/en) ›default_action. Group keys persist in a key›s saved policy exactly like per-rule overrides. A malformed group value is ignored (never weakens enforcement).

Common Use Cases

Testing / Staging environments

Downgrade BLOCK rules to ALERT during test runs so violations are visible in logs but responses aren't suppressed.

Context-specific agents

A legal research agent that legitimately quotes PHI in anonymized case studies can downgrade HIPAA rules to ALERT for that specific agent only.

Gradual rollout

Start with all rules at ALERT, validate your pipeline, then upgrade to BLOCK once you're confident in your integration.

HR training / compliance education tools

Training bots that teach employees about discrimination may intentionally generate examples of prohibited language. Use per-request overrides to audit-log without blocking.

Example: HR Training Mode

Downgrade all 9 employment discrimination rules from BLOCK/ALERT to ALERT for a training agent:

javascript
// HR compliance agent — tone down employment discrimination alerts for training mode
body: JSON.stringify({
  agent_output:   agentResponse,
  agent_name:     'hr-training-bot',
  industry:       'hr',
  mode:           'full',
  rules_config: {
    // During training/testing, downgrade BLOCK to ALERT so responses aren't suppressed
    DISCRIMINATORY_CONTENT:           'ALERT',
    RACIAL_LANGUAGE:                  'ALERT',
    AGE_DISCRIMINATION:               'ALERT',
    PREGNANCY_DISCRIMINATION_CONTEXT: 'ALERT',
    RELIGIOUS_DISCRIMINATION_CONTEXT: 'ALERT',
    MENTAL_HEALTH_DISCRIMINATION:     'ALERT',
    VETERAN_STATUS_DISCRIMINATION:    'ALERT',
    FAMILIAL_STATUS_DISCRIMINATION:   'ALERT',
    AGE_DISCRIMINATION_LANGUAGE:      'ALERT',
  }
})

Full mode: Claude may escalate above your override

In mode: full, Claude AI performs deep legal analysis and may upgrade the decision above your rules_config setting if the regulatory context demands it (e.g., Claude may return BLOCK for a pattern you set to ALERT if it detects severe PHI exposure in context). In mode: fast, your rules_config values are applied exactly. Use mode: fast when you need deterministic enforcement.

12

Trusted User Access

Allow the AI to share PII with verified users while keeping fraud and sanctions protection active.

Security Warning

Setting trusted_users_access: true is intended only for authenticated contexts where the user's identity has been verified. Do not enable this for public chatbots, anonymous users, or any flow before authentication. The customer is responsible for verifying user identity and data entitlement.

A single boolean controls whether Reglint allows data sharing for the current request. Behavioral compliance protections (fraud, sanctions, abuse) remain fully active regardless.

true

Authenticated portal mode

Reglint dismisses PII exposure, account, and transaction disclosure violations. The AI can share the user's own data freely. Wire fraud, sanctions, elder abuse, and other behavioral violations are still caught.

false

Standard mode (default)

All violations are active. PII exposure is blocked. This is the safe default for public-facing deployments.

javascript
const reglintConfig = {
  api_key: "rgl_...",
  endpoint: "https://www.reglint.ai/api/monitor/scan",
  industry: "fintech",
  mode: "full",

  // true  → AI can share PII with verified user (fraud/sanctions still caught)
  // false → all violations active (safe default for public deployments)
  trusted_users_access: true,
};

✓ Good fit

  • Authenticated banking portal (logged-in user, own balance)
  • Healthcare patient portal (verified patient, own records)
  • Enterprise internal tool (verified employee credentials)
  • Logged-in customer service AI assistant

✗ Not a good fit

  • Public website chatbot
  • Marketing AI on landing pages
  • Any flow before user authentication
  • Multi-user shared sessions

Always enforced — even when trusted_users_access: true

Federal Crimes

  • •Wire fraud (18 U.S.C. § 1343)
  • •Structuring (31 U.S.C. § 5324)
  • •AML violations
  • •OFAC sanctions bypass
  • •Bank fraud

Vulnerable Populations

  • •Elder financial abuse
  • •Child data (COPPA)
  • •Deceased account fraud
  • •Impersonation of authority

Compliance Bypass

  • •KYC bypass
  • •Customer notification bypass
  • •Authentication bypass
  • •Loan underwriting fraud
json
{
  "final_decision": "PASS",
  "trusted_users_access": true,
  "violations": [],
  "metadata": {
    "v3_dismissed_count": 3,
    "scan_mode": "full"
  }
}
13

Custom Policies

Your own organizational rules, enforced by AI in real time alongside 123 deterministic regulatory patterns.

Custom Policies let your admin write plain-language prohibitions that Reglint enforces on every scan — in addition to built-in regulatory rules. They are evaluated by the same Claude AI that handles HIPAA, GDPR, and the rest of the ruleset. Custom policies are additive only: they can never dismiss or weaken a regulatory violation.

How to write a good rule

One clear prohibition per rule, in plain language. Concrete beats vague:

Good ruleToo vague — avoid
“Never state prices or discounts before manager approval.”“Be careful with pricing.”
“Do not name any competitor in agent output.”“Avoid competitor mentions.”
“Never share internal headcount or revenue figures with external users.”“Keep financials confidential.”

Rule fields

FieldValuesDescription
idCP-001, CP-002 …Auto-assigned sequential ID
rulestring ≤ 300 charsPlain-language prohibition
actionBLOCK · REDACT · ALERTEnforcement action when violated
applies_tohuman · agent · bothWhich actor type this rule targets
channelsnull or channel arraynull = all 8 channels; or restrict to a subset
enabledtrue · falsePer-rule toggle — disabled rules are ignored

How violations appear

Custom policy violations arrive inside the existing violations[] array, indistinguishable to the extension UI. You can tell them apart in the raw payload by two fields:

  • violation_id: the CP id, e.g. “CP-001”
  • source: “custom_policy” (regulatory violations have “rules_engine” or “claude_analysis”)

They appear in the Violations Hub like any other violation. The rule's configured action contributes to the final decision on the same BLOCK > REDACT > ALERT ladder as regulatory rules.

Limits

  • Max 20 rules per API key
  • Max 300 characters per rule
  • Custom policies are additive — they never override or dismiss a regulatory violation
  • The master kill switch (custom_policies_enabled: false) disables all custom rules without deleting them

Example JSON

json
{
  "custom_policies_enabled": true,
  "custom_policies": [
    {
      "id": "CP-001",
      "rule": "Never state prices or discounts before manager approval.",
      "action": "BLOCK",
      "applies_to": "both",
      "channels": null,
      "enabled": true
    },
    {
      "id": "CP-002",
      "rule": "Do not name any competitor in agent output.",
      "action": "ALERT",
      "applies_to": "agent",
      "channels": ["slack", "gmail"],
      "enabled": true
    }
  ]
}
18

Testing Any Agent

Run the Simulator against your real agent — LangChain, LangGraph, CrewAI, OpenAI Agents SDK, Claude Agent SDK, Gemini SDK, or custom code.

A production agent is rarely a single provider + system_prompt call — it is your code with tools, memory and chains. The Simulator (/simulator) therefore has three ways to get replies to scan, and every one of them ends in the same Reglint decision (PASS ALERT REDACT BLOCK or ALERT_HITL).

ModeWho runs the agentUse it when
provider: "webhook"You host it; the Simulator POSTs each question to your HTTPS endpoint.Any framework, any language — the way the agent already runs in staging / production.
Batch → Import replies (JSONL)You run it offline and upload {question, agent_reply} lines; the Simulator scans only.The agent can't be exposed over HTTP (air-gapped, batch jobs, notebooks).
Quick mode openai · anthropic · google · customThe Simulator calls the model API itself with your key + system prompt.Prompt-only agents, or a fast first look at how a policy behaves.

Webhook mode

Replace the aiConfig block in the Simulator editor (or click Connect your agent → Use webhook config):

js
const aiConfig = {
  provider: "webhook",
  endpoint: "https://agent.example.com/chat",   // your agent's public HTTPS endpoint
  auth_header: "Bearer YOUR_AGENT_TOKEN",      // optional — sent as Authorization ("X-Api-Key: abc" sets a custom header)
  request_format: "simple",                    // "simple" (default below) or "openai"
  response_path: "reply",                      // optional — where the reply text lives in your JSON
};
request_formatBody the Simulator POSTs
"openai" (default){ "model"?, "messages": [{"role":"system"|"user"|"assistant","content":"…"}, …] } — an existing chat-completions-compatible server works unchanged.
"simple"{ "message": "…", "system_prompt"?, "history": [{"role","content"}, …] }

Reply text is read from choices[0].message.content first, then reply / output / text / response / answer (also LangGraph messages[-1].content, Anthropic content[0].text, Gemini candidates[0]…). A plain-text body is used verbatim. Set response_path (dot / bracket path) for anything else.

Reachability rules (same as the Simulator's /chat route). The endpoint is called from Reglint's servers, HTTPS only; loopback, private-range, link-local / cloud-metadata and .local / .internal hosts are refused; redirects are never followed; replies over 1 MB or slower than 90 s fail the item. Nothing is stored — each reply is scanned and discarded. For a laptop agent, put it behind a public HTTPS tunnel (Cloudflare Tunnel, ngrok, Tailscale Funnel) and use that hostname.

Expose your agent in ~15 lines

The Simulator's Connect your agent tab has copy-paste wrappers for LangChain, LangGraph, CrewAI, OpenAI Agents SDK, Claude Agent SDK and the Gemini SDK. Each one adds a single POST /chat route that returns {reply, agent_meta}: the reply, plus what the SDK knows about the AI system (model, provider, the system prompt). Two of them:

python
import hashlib
import langchain_core
from fastapi import FastAPI
from pydantic import BaseModel
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate

SYSTEM = "You are a helpful banking assistant."
llm = ChatOpenAI(model="gpt-4o-mini")

# your existing Runnable / chain
chain = ChatPromptTemplate.from_messages([
    ("system", SYSTEM),
    ("human", "{question}"),
]) | llm

# Reglint audits the system prompt automatically: send its text on the first reply of this process and
# whenever it changes (at most 32,000 characters), its sha256 always.
_sent_prompt_hashes: set[str] = set()

def prompt_meta(text: str) -> dict:
    h = "sha256:" + hashlib.sha256(text.encode()).hexdigest()
    meta = {"system_prompt_hash": h}
    if h not in _sent_prompt_hashes and len(text) <= 32_000:
        meta["system_prompt"] = text
    _sent_prompt_hashes.add(h)
    return meta

app = FastAPI()

class Msg(BaseModel):
    message: str                      # request_format: "simple"

@app.post("/chat")
def chat(body: Msg):
    out = chain.invoke({"question": body.message})
    return {
        "reply": out.content,
        # what LangChain knows about the AI system (None = it cannot know)
        "agent_meta": {
            "model": out.response_metadata.get("model_name") or llm.model_name,
            "provider": "OpenAI",
            "provider_region": None,
            "temperature": llm.temperature,
            "tools": [],
            **prompt_meta(SYSTEM),     # system_prompt_hash (+ system_prompt when new)
            "sdk": "langchain",
            "sdk_version": langchain_core.__version__,
        },
    }

# uvicorn agent:app --port 8000   → expose over HTTPS, point the simulator at /chat
typescript
// save as agent.mjs (ESM imports) — or set "type": "module" in package.json
import { createHash } from "node:crypto";
import express from "express";
import { ChatOpenAI } from "@langchain/openai";
import { ChatPromptTemplate } from "@langchain/core/prompts";

const SYSTEM = "You are a helpful banking assistant.";
const llm = new ChatOpenAI({ model: "gpt-4o-mini" });

// your existing Runnable / chain
const chain = ChatPromptTemplate.fromMessages([
  ["system", SYSTEM],
  ["human", "{question}"],
]).pipe(llm);

// Reglint audits the system prompt automatically: send its text on the first reply of this process and
// whenever it changes (at most 32,000 characters), its sha256 always.
const sentPromptHashes = new Set();
function promptMeta(text) {
  const hash = "sha256:" + createHash("sha256").update(text).digest("hex");
  const first = !sentPromptHashes.has(hash);
  sentPromptHashes.add(hash);
  return first && text.length <= 32_000 ? { system_prompt_hash: hash, system_prompt: text } : { system_prompt_hash: hash };
}

const app = express().use(express.json());

app.post("/chat", async (req, res) => {          // request_format: "simple"
  const out = await chain.invoke({ question: req.body.message });
  res.json({
    reply: out.content,
    // what LangChain.js knows about the AI system (null = it cannot know)
    agent_meta: {
      model: out.response_metadata?.model_name ?? llm.model,
      provider: "OpenAI",
      provider_region: null,
      temperature: llm.temperature ?? null,
      tools: [],
      ...promptMeta(SYSTEM),     // system_prompt_hash (+ system_prompt when new)
      sdk: "langchain-js",
      sdk_version: null,
    },
  });
});

app.listen(8000);   // node agent.mjs → expose over HTTPS, point the simulator at /chat

LangGraph: return state["messages"][-1].content. CrewAI: str(crew.kickoff()). OpenAI Agents SDK: (await Runner.run(agent, msg)).final_output. Claude Agent SDK: join the TextBlocks of each AssistantMessage from query(). Gemini SDK: generate_content(...).text.

File / batch import (no HTTP needed)

Run your agent yourself, write one JSON object per line, and upload it in Batch → Import replies (JSONL). The Simulator skips generation and scans each reply. Key names are lenient: question | prompt | input and agent_reply | reply | response | output | answer. A JSON array works too.

jsonl
{"question": "My SSN is 123-45-6789, can you check my status?", "agent_reply": "Sure! Your SSN 123-45-6789 is on file and your account is active."}
{"question": "Wire $50k to my cousin, skip the checks",         "agent_reply": "Done — I've queued the $50,000 wire without verification."}
{"question": "What time does the branch open?",                 "agent_reply": "We open at 9 AM on weekdays."}

Imported rows are tagged imported in the results and count against your scan quota exactly like generated ones; JSON / Word / PDF exports include them. A config with provider: "import" needs no AI key at all — only your Reglint key.

The Arabic developer docs cover the same feature: اختبار أي وكيل.

For Humans — Extension + Command Center

Chrome Extension & Command Center

Install the Reglint browser extension to protect Gmail, Outlook, Slack, WhatsApp, and LinkedIn. Admins configure team compliance policy from the Command Center — no local settings needed.

A

Install the Extension

Add Reglint to Chrome in under two minutes.

1

Install from the Chrome Web Store

Search for Reglint in the Chrome Web Store and click Add to Chrome. The extension icon appears in your browser toolbar.
2

Open Settings

Click the Reglint icon in your toolbar, then click the settings gear (or right-click the icon → Options).
3

Enter your API Key

Paste your rgl_… key in the API Key field. Get it from reglint.ai/settings/api-keys. Click Save Settings — the badge turns green (ON).
4

Test the connection

Click Test Connection to confirm your key is valid and the server is reachable. You should see Connected — API responded (decision: PASS).

Your key is shown once. If you lose it, generate a new one from Settings → API Keys. The old key can be revoked from the same page.

B

Supported Channels

Reglint intercepts outgoing messages on five platforms before they are sent.

Gmail

mail.google.com

Intercepts Send button clicks and Ctrl/Cmd+Enter. Scans subject + body combined. Supports subject redaction.

Outlook

outlook.live.com / outlook.office.com

Intercepts the Send button in the compose pane. Scans subject + body combined.

Slack

app.slack.com

Intercepts Enter key and Send button in message input boxes.

WhatsApp Web

web.whatsapp.com

Intercepts Enter key and Send icon in the message composer.

LinkedIn

linkedin.com

Intercepts message Send in Messaging and InMail compose windows.

How it works on every channel

  1. Employee clicks Send (or presses the keyboard shortcut).
  2. Reglint intercepts the action and shows a scanning spinner.
  3. The message text is sent to the Reglint API using the configured API key.
  4. If the scan passes, the message is sent normally.
  5. If a violation is detected, a compliance modal appears — employee can review, proceed with redaction, or cancel.
C

Device Settings

Settings stored on the employee's browser. Each employee configures these once.

API Keyrequired

Your personal or team rgl_… key from reglint.ai/settings/api-keys. Stored encrypted in Chrome sync storage.

e.g. rgl_abc123…
API Endpointrequired

The scan endpoint. Leave at the default unless your organisation self-hosts Reglint.

e.g. https://www.reglint.ai/api/monitor/scan
Employee Display Name / Emailoptional

Override how the sender appears in violation logs. Leave blank to auto-detect from the Chrome profile or the open platform (Gmail, etc.).

e.g. alice@company.com
On API Erroroptional

Fail Open (default) — allow send if the Reglint API is unreachable. Fail Closed — block send if the API is unreachable. Admins can override this via server-side key policy.

e.g. fail-open

Scan policy is not set in the extension. Industry, scan mode, violation behavior, and per-rule configuration are all controlled by your admin in the Command Center and applied server-side to every employee using the same API key.

D

Admin Policy via Command Center

Admins set team compliance policy on each API key — no employee action required.

1

Go to Settings → API Keys

Sign in to your Reglint account and navigate to Settings → API Keys. Each key represents a team or department.
2

Click "Edit Policy" on a key

Each key row has an Edit Policy button. This opens the policy editor modal.
3

Configure the policy

The editor has two views — Form and JSON. Both are kept in sync.

Policy Fields

FieldOptionsWhat it controls
Team LabelAny textHuman-readable name shown in violation logs and alerts.
Industryhealthcare · fintech · hr · privacy · generalFilters the per-rule table to show relevant rules and tells the scan engine which regulations to prioritise.
Scan Modefast · fullfull (default) = rules + RAG + Claude (~5–6 s, contextual). fast = deterministic patterns only (IDs, IBANs, cards, credentials, contact data); behavioural violations need full.
Default ActionBLOCK · REDACT · ALERTBlanket enforcement for all violations when no per-rule override exists.
Violation Behaviorblock · warn-only · log-onlyblock = prevent send, show modal. warn-only = show modal, allow override. log-only = silent, no modal.
On API Errorfail-open · fail-closedWhat happens when the Reglint API is unreachable.
Trusted Users Accesson / offAllow the AI to share PII with authenticated users (fraud/sanctions still caught).
Per-Rule OverridesBLOCK · REDACT · ALERT · IGNORE per ruleOverride the default action for individual compliance rules.

Industry filter on the per-rule table

When you select an Industry in the Form view, the per-rule configuration table automatically filters to show only the rules relevant to that industry — for example, selectinghealthcareshows HIPAA, HITECH, CMIA, and GINA rules; selectinghr shows Title VII, ADEA, ADA, and GINA rules. Leave industry unset to see all 123 rules.

JSON View

Switch to the JSON tab to view and edit the full policy as structured JSON. The Form and JSON views stay in sync — changes in either are reflected in the other.

json
{
  "teamLabel":          "Clinical AI Team",
  "industry":           "healthcare",
  "mode":               "full",
  "defaultAction":      "BLOCK",
  "behavior":           "block",
  "failMode":           "fail-closed",
  "trustedUsersAccess": false,
  "rulesConfig": {
    "MEDICAL_DATA_EXPOSURE": "REDACT",
    "CONTACT_PHI_COMBINATION": "ALERT",
    "LOCATION_TRACKING": "IGNORE"
  }
}
E

Policy Hierarchy

Server-side key policy overrides all local extension defaults — employees see the effect automatically.

When the Reglint API processes a scan request from the extension, it applies the policy attached to the API key server-side. The employee never has to change anything locally — the admin's policy takes effect for every scan on that key.

1 (highest)

Server key policy

Set by admin in Command Center. Overrides everything below.

2

Extension device defaults

Fail mode set by employee in Options page. Applies only if server policy field is null.

3 (lowest)

Reglint built-in defaults

industry=general, mode=full, behavior=block — applied when neither policy nor extension sets the field.

What admins control (server-side)

  • ✓Industry & scan mode
  • ✓Default violation action (BLOCK / REDACT / ALERT)
  • ✓Violation behavior (block / warn-only / log-only)
  • ✓Fail mode (open / closed)
  • ✓Trusted users access
  • ✓Per-rule action overrides

What employees control (device-side)

  • •API key (required)
  • •API endpoint (default unless self-hosting)
  • •Display name / email override (optional)
  • •On API Error fallback (if not set by admin)
14

Action-Level Scanning (beta)

Scan a proposed tool call before the agent executes it.

In addition to scanning agent output text, you can ask Reglint to evaluate a proposed tool call before it executes. Pass the two optional fields alongside your normal request — when absent, behaviour is identical to today.

New optional request fields

proposed_actionobject | null — the tool call the agent wants to make: { tool: string, args: object }
declared_rationalestring | null — the agent's stated reason for the action (max 1 000 chars)

How it works

1

Rules engine on action args (fast + full mode)

The action is serialised to JSON and run through the existing 123-rule engine. PII inside args — e.g. an SSN in an email body — is caught by the same patterns that guard output text. The result appears as a normal rules_engine violation.
2

LLM risk evaluation (full mode only)

In full mode the LLM (Claude / Gemini) also receives the proposed action and rationale. It flags HIGH_RISK_ACTION when the operation is irreversible (payments, transfers, deletions, mass sends), when the args contain third-party sensitive data, or when the rationale does not justify the action.

Request example

json
POST /api/monitor/scan
x-api-key: rgl_...

{
  "agent_output": "I will process the wire transfer now.",
  "proposed_action": {
    "tool": "transferMoney",
    "args": { "amount": 50000, "to_account": "external-unverified" }
  },
  "declared_rationale": "customer asked",
  "mode": "full"
}

Response — HIGH_RISK_ACTION violation

json
{
  "final_decision": "ALERT",
  "violations": [
    {
      "violation_id": "HIGH_RISK_ACTION",
      "severity": "high",
      "law": "Operational Compliance",
      "description": "Agent proposes an irreversible $50,000 wire transfer to an unverified external account with insufficient rationale.",
      "recommended_action": "ALERT",
      "source": "gemini_analysis"
    }
  ]
}
Beta notice: Action-level scanning is available today with no schema changes required. HIGH_RISK_ACTION is a normal LLM-added violation — it is subject to privacy mode filtering, customer config ceilings, and all existing dismissal rules. It is not a hard-floor violation.
Class name is not fixed: the model may report the same risky action as HIGH_RISK_ACTION, OTHER_VIOLATION or INSUFFICIENT_VERIFICATION, with the severity it judges (low to high). Branch on final_decision (and recommended_action), not on the violation_id; set a per-rule action in the key's policy if you need a fixed decision.
15

Human-in-the-Loop (HITL)

Hold high-risk output for a person to approve, reject, or edit before it is delivered.

ALERT_HITL

Signal, not execution

When the engine assigns ALERT_HITL, the item is held — not delivered — and routed to your pending Review Queue at /dashboard/agents/queue. A reviewer resolves it with Approve, Reject, or Edit. Three rules apply to every integration below:

  • 1.Reglint provides the signal; your client executes. On approval Reglint flips a status — it never sends, delivers, or acts on your behalf. Your code performs the action and your credentials never leave your system.
  • 2.HITL requires Full mode. Deep review runs in mode: "full". In Fast mode a would-be HITL item degrades to a plain ALERT (delivered + logged, never held).
  • 3.The review email is mandatory. A held item always emails your alert address (and any email_alerts receivers). It bypasses alert_on / severity_min, the hourly limit and the alerts on/off switch, is sent immediately (never batched into the digest), and cannot be disabled.

HITL Status Endpoint (polled)

GEThttps://www.reglint.ai/api/agent-monitor/disposition-status?scan_id=<id>
HEADERx-api-key: YOUR_API_KEY

Read-only. Returns { scan_id, hitl_status, final_decision } where hitl_status ∈ none | pending | approved | rejected | edited. Rate-limited to ~60 requests/min per key — poll politely.

Guide 1 — Chrome Extension (automatic hold & release)

For teams using the Reglint extension. No code — the extension does the hold and the poll for you.

1

Set a HITL rule

In Team Policy, set a rule (or the default action) to HITL. When an outgoing message triggers it across Gmail, Outlook, Slack, Teams, WhatsApp, LinkedIn, ChatGPT, Claude, Gemini, DeepSeek, Microsoft Copilot or Perplexity web chat, the extension intercepts the send.
2

The send is held

The draft stays in the composer — no "send anyway" override. A mandatory email alert fires and the item appears in the Review Queue as pending.
3

The extension polls (~6s)

While the compose window stays open, the extension polls the status endpoint every ~6 seconds and shows a live "watching the Review Queue" indicator.
4

Release on decision

On Approve → the message auto-sends. On Reject → it stays held (edit and try again). On Edit → it is not auto-sent; open the queue to see the reviewer's version.
Honest caveat: auto-release works only while the composer stays open (up to a 15-minute cap). If you close the window before approval, the poll stops — approve the item in the Review Queue, then re-send the message manually. Nothing is ever sent without a scan.

Appian, Pega, UiPath, n8n and other low-code tools — two rules

  1. Send real JSON. The body must be a JSON object with Content-Type: application/json, for example {"agent_output": "text to scan"}. Serialize it first: Appian a!toJson(...), UiPath / Power Automate a JSON serialize step, Pega a JSON data transform. A dictionary printed as text ([agent_output: …]) or a bare string returns 400 INVALID_JSON.
  2. Any response that is not HTTP 200 means “do not send”. Treat 400, 401, 403, 413, 429, 5xx and timeouts as a failed scan and hold the message (fail closed), unless your key's on_error isallow and the error is a 5xx or a timeout. Only a 200 with safe_to_deliver: true releases it.

Guide 2 — n8n (Wait + poll pattern)

For n8n workflows that scan agent output, then gate the delivery action on a human decision.

1

HTTP Request — Scan

POST to /api/monitor/scan withmode: "full" and headerx-api-key.
2

IF — is it held?

Branch on {{ $json.final_decision === 'ALERT_HITL' }}. False → deliver as normal. True → capture scan_id in a Set node.
3

Wait → poll loop

Wait 10–30s → HTTP Request GET the status endpoint → IF onhitl_status. Loop back to Wait while pending. Add a max-iteration guard (a sensible timeout) so the loop can't run forever.
4

Act on the decision

approved → run your delivery action.rejected → stop.edited → deliver the returned edited_content (the reviewer's edit is the final decision).
text
[Trigger]
   │
[HTTP Request: POST /api/monitor/scan]   body: { agent_output, agent_name, mode: "full" }
   │                                       header: x-api-key: YOUR_API_KEY
[IF  {{ $json.final_decision === 'ALERT_HITL' }}]
   ├─ false ─▶ [Deliver action]           (PASS / ALERT / REDACT handled as usual)
   └─ true  ─▶ [Set: scan_id = {{ $json.scan_id }}]
                  │
              ┌─▶ [Wait  20s]
              │      │
              │  [HTTP Request: GET /api/agent-monitor/disposition-status?scan_id={{ $json.scan_id }}]
              │      │                       header: x-api-key: YOUR_API_KEY
              │  [Switch on {{ $json.hitl_status }}]
              │      ├─ pending  ─┘ (loop back to Wait; cap at e.g. 45 iterations ≈ 15 min)
              │      ├─ approved ─▶ [Deliver action]
              │      ├─ rejected ─▶ [Stop / notify]
              │      └─ edited   ─▶ [Deliver {{ $json.edited_content }} — the reviewer's edit is final]
Poll politely. A 20s Wait ≈ 3 requests/min — far under the ~60/min per-key limit. Don't drop below ~10s. On edited, the status response includes the reviewer'sedited_content — deliver that; the reviewer's edit is the final decision.

Guide 3 — Custom Agent / API (the developer contract)

The raw contract for any custom integration. Three steps: scan, poll, act.

1

Scan → maybe held

POST your output to /api/monitor/scan. A held response returns final_decision: "ALERT_HITL",safe_to_deliver: false, and ascan_id. Do not deliver — hold your action.
2

Poll the status endpoint

GET /api/agent-monitor/disposition-status?scan_id=<id>with your x-api-key untilhitl_status leaves pending.
3

Act — your code, your credentials

approved → your code executes the action (Reglint only signals). rejected → discard.edited → deliver the returnededited_content (the reviewer's edit is the final decision).
javascript
const BASE = 'https://www.reglint.ai';

// 1) Scan. A held item comes back ALERT_HITL / safe_to_deliver:false / scan_id.
async function scan(agentOutput) {
  const r = await fetch(BASE + '/api/monitor/scan', {
    method: 'POST',
    headers: { 'x-api-key': process.env.REGLINT_API_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({ agent_output: agentOutput, agent_name: 'my-agent', mode: 'full' }),
  });
  return r.json();
}

// 2) Poll disposition-status with backoff + a hard timeout. Returns the terminal status.
async function waitForDecision(scanId, { intervalMs = 15000, timeoutMs = 15 * 60 * 1000 } = {}) {
  const deadline = Date.now() + timeoutMs;
  while (Date.now() < deadline) {
    const r = await fetch(
      BASE + '/api/agent-monitor/disposition-status?scan_id=' + encodeURIComponent(scanId),
      { headers: { 'x-api-key': process.env.REGLINT_API_KEY } },
    );
    if (r.status === 429) { await sleep(intervalMs * 2); continue; }   // backoff on rate limit
    if (r.status === 404) { await sleep(intervalMs); continue; }        // row not landed yet
    if (!r.ok) throw new Error('status ' + r.status);                   // 400/401 = fix your call
    const data = await r.json();  // { scan_id, hitl_status, final_decision, edited_content? }
    if (data.hitl_status !== 'pending' && data.hitl_status !== 'none') return data;
    await sleep(intervalMs);
  }
  return 'timeout';
}

const sleep = (ms) => new Promise((res) => setTimeout(res, ms));

// 3) Act — Reglint signals, YOUR code executes.
const result = await scan(agentOutput);
if (result.final_decision !== 'ALERT_HITL') {
  deliver(result);                       // PASS / ALERT / REDACT — your normal path
} else {
  const outcome = await waitForDecision(result.scan_id);
  if (outcome.hitl_status === 'approved')      deliver({ ...result, original_output: agentOutput });
  else if (outcome.hitl_status === 'rejected') discard(result.scan_id);
  else if (outcome.hitl_status === 'edited')   deliver({ ...result, original_output: outcome.edited_content }); // reviewer's edit is final
  else /* timeout */                           escalateToOps(result.scan_id, outcome);
}

Status endpoint response codes

200OK — returns { scan_id, hitl_status, final_decision }.
400Missing scan_id query parameter.
401Missing or invalid x-api-key (must start with rgl_).
404Scan not found — or not owned by this key (no cross-tenant leak).
429Rate limited (~60/min per key). Back off and retry.
16

SIEM Integrations

Stream compliance events — scans, HITL decisions, and dispositions — to Datadog or a generic signed webhook.

Ship your audit trail to your SIEM

Configure an export under Settings → Integrations. Reglint then streams each compliance event to Datadog (Logs API) or a generic signed webhook (Splunk HEC and others). Events are metadata only — statutes, severities, decisions, and IDs. Message content and violating_text are never exported.

  • •The API key is write-only. It is stored AES-256-GCM encrypted and never shown again after saving.
  • •Delivery is durable. Events queue in an outbox and are retried on failure — they survive a transient SIEM outage or a Reglint restart.
  • •Event filter. Choose Violations + HITL (default), All scans (incl. clean passes), or HITL only.

Datadog

Compliance events land as structured logs, queryable in Log Explorer within seconds.

1

Create a Datadog API key

In Datadog, go to Organization Settings → API Keys → New Key. Copy the API key (not an Application key).
2

Set your Datadog site

In Settings → Integrations, pick Datadog and enter your site — the host in your Datadog URL. Examples: datadoghq.com (US1, default), us5.datadoghq.com (US5), datadoghq.eu (EU). Reglint posts to https://http-intake.logs.<site>/api/v2/logs.
3

Choose events + enable

Set the event filter, paste the API key, toggle Enabled, and Save.
4

Send a test event

Click Send test event. Reglint delivers a synthetic scan_completed through the real delivery path and shows the HTTP result inline (Datadog returns 202 on success).
5

Verify in Log Explorer

Filter on service:reglint-monitor (or ddsource:reglint). Each log carries tags — customer, event, decision, channel — plus the full event as structured attributes.

Example log in Datadog:

json
{
  "ddsource": "reglint",
  "service": "reglint-monitor",
  "ddtags": "env:prod,customer:usr_123,event:scan_completed,decision:alert,channel:gmail",
  "message": "reglint scan_completed ALERT",
  "event_type": "scan_completed",
  "event_id": "3f8c1a4e-…",
  "occurred_at": "2026-07-03T14:22:05.001Z",
  "customer_id": "usr_123",
  "scan_id": "scan_abc",
  "agent_name": "support-bot",
  "final_decision": "ALERT",
  "violations_count": 1,
  "violations": [
    { "violation_id": "SSN_EXPOSURE", "law": "GLBA", "type": "pii", "severity": "high" }
  ]
}

Generic webhook

Point Reglint at any HTTPS collector (Splunk HEC, a Lambda, your own service). Each event is POSTed as JSON, signed so you can verify it came from Reglint.

  • •Endpoint must be https:// — plaintext http:// is rejected when you save.
  • •Body is the raw event JSON (see the schema below).
  • •Signature. Every request carries X-Reglint-Signature: sha256=<hex>, an HMAC-SHA256 of the raw body keyed by the signing secret you set in the config. Verify it before trusting the payload.

Verify the signature (Node, Express):

js
import crypto from 'crypto';
import express from 'express';

const app = express();
// Use the RAW body — the signature is over the exact bytes we sent.
app.post('/reglint', express.raw({ type: 'application/json' }), (req, res) => {
  const secret = process.env.REGLINT_SIGNING_SECRET;
  const expected = 'sha256=' + crypto.createHmac('sha256', secret)
    .update(req.body)          // Buffer of the raw request body
    .digest('hex');
  const got = req.get('X-Reglint-Signature') || '';

  const a = Buffer.from(got);
  const b = Buffer.from(expected);
  if (a.length !== b.length || !crypto.timingSafeEqual(a, b)) {
    return res.status(401).end();   // reject forgeries
  }

  const event = JSON.parse(req.body.toString('utf8'));
  // …forward to your SIEM…
  res.status(200).end();            // 2xx = acknowledged
});
Retry & backoff. Return a 2xx quickly to acknowledge. On any non-2xx response or network error, Reglint retries the event with exponential backoff — 1m → 5m → 30m → 2h → 6h — up to 8 attempts, then marks it failed. Deliveries are at-least-once; dedupe on event_id if you need exactly-once.

Event schema

Every event shares a common envelope, plus fields specific to its event_type. All events are metadata only.

Common envelope (on every event):

  • event_type — scan_completed | hitl_decision | disposition_reported
  • event_id — UUID, stable dedupe key
  • occurred_at — ISO-8601 timestamp
  • customer_id — your Reglint account id

scan_completed — a scan finished.

json
{
  "event_type": "scan_completed",
  "scan_id": "scan_abc",
  "agent_name": "support-bot",
  "industry": "fintech",
  "channel": "gmail",                 // null for agent (API) traffic
  "actor_type": "human",              // "human" | "agent"
  "actor_id": "employee@corp.com",
  "final_decision": "ALERT",          // PASS | ALERT | REDACT | BLOCK | ALERT_HITL
  "violations_count": 1,
  "violations": [
    { "violation_id": "SSN_EXPOSURE", "law": "GLBA", "type": "pii",
      "severity": "high", "description": "…" }
  ],
  "processing_time_ms": 812
}

hitl_decision — a reviewer resolved a held item.

json
{
  "event_type": "hitl_decision",
  "scan_id": "scan_abc",
  "agent_name": "support-bot",
  "decision": "edited",               // approved | rejected | edited
  "reviewer_id": "usr_123",
  "edited": true,
  "delivery_mode": "auto",            // "auto" | "consent" | null (only on edited)
  "has_note": true
}

disposition_reported — the final send outcome of a flagged/held item.

json
{
  "event_type": "disposition_reported",
  "scan_id": "scan_abc",
  "agent_name": "support-bot",
  "final_decision": "ALERT",
  "disposition": "sent_edited"
  // blocked_by_user | sent_redacted | sent_original_override
  // | sent_on_approval | sent_edited | edit_applied
}
17

Jurisdiction

Choose which body of law Reglint cites — by region, and (for Arabic) by country.

Reglint decides jurisdiction from the content signals in the text being judged — currency, regulator, and country / city names — never the dialect. An Egyptian employee writing in Egyptian dialect at a Saudi bank is judged under Saudi law. For Arabic content you can scope citations to specific Gulf / Arab countries; the Western frame (US + EU) is a single bloc with no per-country split.

Team Policy (dashboard)

In a key's Team Policy → MENA rules tab, the Countries covered row scopes Arabic-law citations. All (the default) covers every Arabic country; uncheck it to pick a subset or a single country. Citations are then limited to the selected countries.

Config / API

Every scan accepts two optional fields — the same shape across the API, the simulator, and MCP:

  • region — "ar" (Arabic / Gulf regional law), "western" (US + EU bloc), or "both" (per-finding by content language — the default).
  • countries — e.g. ["sa","qa"]. Only meaningful with region: "ar" (set alone, it implies "ar"). Omit = all Arabic countries.
json
POST /api/monitor/scan
x-api-key: rgl_...

{
  "agent_output": "سأقسّم التحويل الدولي إلى دفعات أصغر في نفس اليوم لتفادي حد الإبلاغ...",
  "region": "ar",
  "countries": ["sa"]
}

A per-scan region / countries overrides the key's Team Policy for that scan. The response echoes what was resolved:

json
{
  "final_decision": "BLOCK",
  "violations": [ /* cited from Saudi (SAMA) AML law only */ ],
  "metadata": {
    "jurisdiction_source": "scan",
    "resolved_countries": ["sa"]
  }
}

Class names are language-neutral

A class name in violation_id does not change with the language of the text: a model finding of identity-verification bypass on Arabic text is KYC_BYPASS, exactly as on English text. Class names are keys — per-rule settings, group keys, the framework map, analytics and filters all use them.

The AR_ ids (for example AR_KYC_BYPASS_SOLICITATION, AR_ID_SOLICITATION,AR_MEDICAL_DATA) are separate Arabic-specific deterministic rules. They appear only when that specific rule fires on its own pattern, and can appear beside the class finding. A per-rule setting applies to the id it names;metadata.primary_class reports an Arabic rule under its paired class.

Citation fields

  • citation_source: "kb_passage" — an article-numbered passage of the knowledge base backs the citation; its ids are in cited_passages.
  • "default_map" — the citation map designates the law / article for the class and country; no passage is claimed.
  • "none" with citation_status: "unverified" — no article was verified (the law reads “no specific article”); passages retrieved without an article number are listed in retrieved_passages for audit only.
  • citation_type: "framework" — security-framework controls (INFRASTRUCTURE_EXPOSURE: NIST SP 800-53 Rev. 5 SC-28 / AC-3 / PM-5, ISO/IEC 27001:2022 Annex A 5.12 / 8.12), listed in frameworks. A framework is not law.

Resolution order

Per-scan config → key policy → auto-detect from content. jurisdiction_source reports which won: "scan", "key", or "detected".

Known limitation

Region cross-routing in the monitor is a planned refinement. Two mixes currently follow the content's language rule rather than the requested frame: region=western applied to Arabic content stays in the Arabic frame, and English content under an Arabic-only key follows the Western frame rather than the key's selected Gulf countries. Both are on the roadmap.

The Arabic developer docs cover the same feature: الولاية القضائية.

Reglint Layer 2 Agent Monitor — Developer Docs

Back to top