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.
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.
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 →Getting Started
Get your API key and send your first compliance scan in minutes.
Get your API Key
Send your first request
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:
{
"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
https://www.reglint.ai/api/monitor/scanx-api-key: YOUR_API_KEYAPI Reference
Every request and response field of POST /api/monitor/scan, the decision vocabulary, identifiers, errors and latency.
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.
| Field | Type | Meaning |
|---|---|---|
agent_output | string, required | The 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_input | string | The 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_name | string | Which agent produced it — groups scans in the Violations Hub and the AI register. |
industry | string | Rule 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. |
countries | string[] | 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. |
channel | string | Where 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_id | string | Your 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_meta | object | What 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_prompt | string (≤ 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
| Field | Meaning |
|---|---|
final_decision | BLOCK | REDACT | ALERT_HITL | ALERT | PASS — the one value your code branches on. |
safe_to_deliver | true 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_output | Your 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_output | Your 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_mode | The privacy mode the scan ran in (strict when the request sent none). |
behavior | The 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_applied | true 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_error | The key's "if Reglint can't answer in time" setting (allow | block) — on every response, decisions and errors alike. |
metadata.primary_class | The class of the top finding (see below); null on PASS. |
scan_id | Look 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_action | final_decision it leads to | What to do |
|---|---|---|
| BLOCK | BLOCK | Do not deliver — the only hard stop. |
| HITL | ALERT_HITL | Hold: a reviewer approves, rejects or edits it in the Review Queue. |
| REDACT | REDACT | Deliver redacted_output. |
| ALERT | ALERT | Deliver (redacted_output when present); your team is notified. |
| PASS | PASS (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).
{
"error": {
"code": "VALIDATION_ERROR",
"message": "agent_meta.temperature must be a number between 0 and 10",
"field": "agent_meta.temperature"
}
}| Status | error.code | When | Retry? |
|---|---|---|---|
| 400 | VALIDATION_ERROR · AGENT_OUTPUT_REQUIRED · INVALID_REQUEST_BODY · INVALID_MODE · INVALID_PRIVACY_MODE · AUTH_CONTEXT_REQUIRED · CUSTOM_RULES_REQUIRED | The request is malformed (field in error.field). | No — fix the request. |
| 401 | UNAUTHORIZED | x-api-key missing, invalid, revoked or expired. | No. |
| 403 | NO_SUBSCRIPTION (+ error.upgrade_url) · MODEL_SWITCH_FORBIDDEN | No active subscription; or a test-only parameter on a customer key. | No. |
| 413 | PAYLOAD_TOO_LARGE | Body over 1 MB. | No — shorten agent_output. |
| 429 | RATE_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. |
| 429 | AGENT_CALL_LIMIT_REACHED (+ top-level upgrade_url) | The plan's monthly scan quota is used up. | No — upgrade, or wait for the next period. |
| 500 | INTERNAL_ERROR | Unexpected server error. | Yes, with backoff; the key's on_error decides what your wrapper delivers meanwhile. |
| 502 / 503 | LAMBDA_ERROR · SERVICE_UNAVAILABLE · NOT_CONFIGURED | The 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.
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
User Sees Result
Safe or redacted response delivered; violations logged
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
The agent output is never delivered. The most severe violations (e.g. bare SSNs, credit card numbers) trigger this.
Matched substrings are replaced with [REDACTED] and the sanitised response is delivered instead.
The response is delivered unchanged, but a compliance alert is emailed to your configured receivers and logged in your Agents dashboard.
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.
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.
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.
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→fintech→insurance→privacy→hr→general→Usage
Add the industry field to your request payload:
{
"agent_output": "...",
"agent_name": "MedicalAdvisorBot",
"industry": "healthcare",
"mode": "full"
}Scan Mode
Choose between instant regex scanning or deep RAG + Claude analysis.
- ✓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)
- ✓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.
// 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" })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.
Reglint uses each rule's own default action (recommended). Same as omitting the field.
All violations trigger BLOCK — output is suppressed entirely.
All violations trigger REDACT — sensitive text is masked in the response.
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.
// 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" })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:
{
"SSN_EXPOSURE": "BLOCK",
"EMAIL_EXPOSURE": "REDACT",
"MEDICAL_DATA_EXPOSURE": "ALERT",
"PHONE_EXPOSURE": "IGNORE"
}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 Case | Recommended Pattern | Why |
|---|---|---|
| Healthcare (HIPAA) | Pre-Display (Strict) | PHI must never reach unauthorized users |
| Finance (GLBA, SOX) | Pre-Display (Strict) | Financial data exposure has legal liability |
| HR / Hiring | Pre-Display (Strict) | Discrimination prevention is non-negotiable |
| Marketing chatbots | Post-Display (Soft) | Speed matters more than strict compliance |
| Internal tools | Audit-Only | Employees trusted, but need audit trail |
| Customer support (general) | Post-Display or Pre-Display | Depends 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 ID | Default Action | Severity | Law |
|---|---|---|---|---|
| 1 | SSN_EXPOSURE | REDACT | critical | Privacy Act 1974 |
| 2 | CREDIT_CARD_EXPOSURE | REDACT | critical | PCI DSS Requirement 3.2 |
| 3 | EMAIL_EXPOSURE | ALERT | low | GDPR Article 5, CCPA §1798.100 |
| 4 | PHONE_EXPOSURE | ALERT | high | TCPA, GDPR Article 5 |
| 5 | MEDICAL_DATA_EXPOSURE | BLOCK | critical | HIPAA §164.514, GDPR Article 9 |
| 6 | FINANCIAL_DATA_EXPOSURE | REDACT | critical | GLBA, PCI DSS |
| 7 | PASSWORD_EXPOSURE | BLOCK | critical | GDPR Article 32, NIST SP 800-63B |
| 8 | DISCRIMINATORY_CONTENT | BLOCK | critical | Title VII, ECOA, ADA |
| 9 | BIOMETRIC_DATA | BLOCK | critical | BIPA, GDPR Article 9 |
| 10 | CHILD_DATA | BLOCK | critical | COPPA, GDPR Article 8 |
| 11 | LOCATION_TRACKING | ALERT | high | CCPA, State Location Privacy Laws |
| 12 | DATA_BULK_EXPOSURE | BLOCK | critical | GDPR Article 5(1)(c), CCPA |
| 13 | FERPA_STUDENT_DATA | ALERT | critical | FERPA 20 U.S.C. §1232g |
| 14 | TCPA_MARKETING | ALERT | high | TCPA 47 U.S.C. §227 |
| 15 | CAN_SPAM_VIOLATION | ALERT | high | CAN-SPAM Act 15 U.S.C. §7704 |
| 16 | VPPA_VIDEO_DATA | ALERT | high | VPPA 18 U.S.C. §2710 |
| 17 | DPPA_DRIVER_DATA | REDACT | critical | DPPA 18 U.S.C. §2721 |
| 18 | ECPA_WIRETAP | ALERT | critical | ECPA 18 U.S.C. §2511 |
| 19 | GINA_GENETIC_DATA | ALERT | critical | GINA 42 U.S.C. §2000ff |
| 20 | FTC_DARK_PATTERNS | ALERT | high | FTC Dark Patterns Report 2022 |
| 21 | EU_AI_ACT_HIGH_RISK | ALERT | critical | EU AI Act Article 6 |
| 22 | GDPR_CONSENT_VIOLATION | BLOCK | critical | GDPR Article 7 |
| 23 | AGE_DISCRIMINATION | BLOCK | critical | ADEA 29 U.S.C. §623 |
| 24 | IMMIGRATION_STATUS | ALERT | critical | Immigration and Nationality Act |
| 25 | RACIAL_LANGUAGE | BLOCK | critical | Civil Rights Act Title VI |
| 26 | GLBA_FINANCIAL_PRIVACY | BLOCK | critical | GLBA 15 U.S.C. §6802 |
| 27 | SOX_FINANCIAL_MANIPULATION | ALERT | high | SOX Section 302 |
| 28 | ROUTING_NUMBER | REDACT | critical | GLBA |
| 29 | ACCOUNT_NUMBER_EXPOSURE | REDACT | critical | GLBA |
| 30 | FCRA_BACKGROUND_CHECK | ALERT | high | FCRA 15 U.S.C. §1681 |
| 31 | PASSPORT_EXPOSURE | REDACT | critical | Privacy Act 1974 |
| 32 | CONTACT_PHI_COMBINATION | REDACT | high | GDPR Article 5 |
| 33 | INSURANCE_ID_EXPOSURE | ALERT | high | HIPAA §164.514, GLBA |
| 34 | CFAA_UNAUTHORIZED_ACCESS | ALERT | critical | CFAA 18 U.S.C. §1030 |
| 35 | HITECH_BREACH_NOTIFICATION | ALERT | critical | HITECH Act §13402 (notification in the case of breach) |
| 36 | FTC_DECEPTIVE_CLAIMS | ALERT | high | FTC Act Section 5 15 U.S.C. §45 |
| 37 | GUARANTEED_OUTCOME_CLAIM | ALERT | high | FTC Act Section 5 15 U.S.C. §45 |
| 38 | KYC_BYPASS_COMMITMENT | BLOCK | critical | Identity verification before account access (KYC) |
| 39 | ADA_ACCESSIBILITY_BARRIER | ALERT | high | ADA Title II, WCAG 2.1 AA |
| 40 | CMIA_HEALTH_DATA | ALERT | critical | CMIA Cal. Health & Safety Code §56 |
| 41 | SHIELD_ACT_DATA_EXPOSURE | ALERT | high | NY SHIELD Act N.Y. Gen. Bus. Law §899-aa |
| 42 | EPRIVACY_TRACKING_CONSENT | ALERT | high | ePrivacy Directive 2002/58/EC |
| 43 | ADPPA_DATA_MINIMIZATION | ALERT | high | ADPPA (proposed) H.R. 8152 |
| 44 | STATE_PRIVACY_DATA_RIGHTS | ALERT | high | State Privacy Laws (TX, FL, OR, MT, DE, IA, IN, NJ, KY) |
| 45 | MEDICAL_PHI_SOLICITATION | ALERT | critical | HIPAA Privacy Rule (45 CFR Part 164) |
| 46 | DISCRIMINATORY_SOLICITATION | ALERT | critical | ECOA Reg B 12 CFR §202.5, Title VII 42 U.S.C. §2000e, Fair Lending |
| 47 | PHI_TARGETED_MARKETING | ALERT | critical | HIPAA §164.508(a)(3) |
| 48 | SSN_SOLICITATION | ALERT | low | GLBA §501(b), GLBA Safeguards Rule 16 CFR §314, NIST SP 800-53 IA-5 |
| 49 | PII_SOLICITATION | ALERT | medium | GLBA §501(b), GLBA Safeguards Rule 16 CFR §314, NIST SP 800-53 IA-5 (data minimisation) |
| 50 | CONTACT_INFO_SOLICITATION | ALERT | low | GLBA §501(b), GLBA Safeguards Rule 16 CFR §314, NIST SP 800-53 IA-5 (data minimisation) |
| 51 | FINANCIAL_PII_INSECURE_REQUEST | BLOCK | high | GLBA §501(b), GLBA Safeguards Rule 16 CFR §314, PCI DSS Req 3.2, NIST SP 800-53 IA-5 |
| 52 | OTP_SOLICITATION | BLOCK | critical | GLBA §501(b), GLBA Safeguards Rule 16 CFR §314, NIST SP 800-53 IA-5 (authenticator management) |
| 53 | SANCTIONS_AWARENESS | ALERT | high | OFAC Regulations (31 CFR Chapter V), IEEPA, Executive Orders |
| 54 | ELDER_FINANCIAL_ABUSE | BLOCK | critical | Elder Justice Act, State Elder Abuse Statutes |
| 55 | PREGNANCY_DISCRIMINATION_CONTEXT | ALERT | high | Title VII (sex discrimination includes pregnancy), FMLA |
| 56 | RELIGIOUS_DISCRIMINATION_CONTEXT | ALERT | high | Title VII, EEOC Religious Discrimination Guidelines |
| 57 | NATIONAL_ORIGIN_DISCRIMINATION | ALERT | high | Title VII, IRCA (Immigration Reform and Control Act), EEOC |
| 58 | MENTAL_HEALTH_DISCRIMINATION | ALERT | high | ADA (Americans with Disabilities Act), Mental Health Parity Act |
| 59 | VETERAN_STATUS_DISCRIMINATION | ALERT | high | USERRA, VEVRAA |
| 60 | FAMILIAL_STATUS_DISCRIMINATION | ALERT | high | Title VII (sex discrimination), Family Responsibilities Discrimination |
| 61 | AGE_DISCRIMINATION_LANGUAGE | ALERT | high | ADEA (Age Discrimination in Employment Act) |
| 62 | PRIVACY_ACT_THIRD_PARTY | REDACT | critical | 5 U.S.C. § 552a(b) |
| 63 | EG_NATIONAL_ID | REDACT | high | قانون حماية البيانات الشخصية 151/2020، المادة 1 + اللائحة التنفيذية قرار 816/2025 |
| 64 | SA_NATIONAL_ID | REDACT | high | نظام حماية البيانات الشخصية السعودي، المادة 1 + اللائحة التنفيذية لنظام حماية البيانات الشخصية |
| 65 | AE_EMIRATES_ID | REDACT | high | مرسوم بقانون اتحادي رقم 45 لسنة 2021 في شأن حماية البيانات الشخصية (الإمارات) |
| 66 | QA_QID | REDACT | high | قانون رقم 13 لسنة 2016 بشأن حماية خصوصية البيانات الشخصية (قطر) |
| 67 | KW_CIVIL_ID | REDACT | high | لائحة حماية خصوصية البيانات — قرار 26/2024 الهيئة العامة للاتصالات وتقنية المعلومات (الكويت) |
| 68 | BH_CPR | REDACT | medium | قانون رقم (30) لسنة 2018 بإصدار قانون حماية البيانات الشخصية (البحرين) |
| 69 | GCC_EG_IBAN | REDACT | high | قوانين حماية البيانات الخليجية/المصرية + تعليمات ساما لحماية عملاء البنوك |
| 70 | AR_PHONE_EXPOSURE | ALERT | medium | قوانين حماية البيانات الخليجية/المصرية (بيانات الاتصال) |
| 71 | AR_ID_SOLICITATION | ALERT | low | قوانين حماية البيانات الخليجية/المصرية (طلب بيانات تعريفية في المحادثة) |
| 72 | AR_CONTACT_SOLICITATION | ALERT | low | قوانين حماية البيانات الخليجية/المصرية (طلب بيانات اتصال في المحادثة) |
| 73 | AR_PASSWORD_EXPOSURE | BLOCK | critical | قوانين حماية البيانات + معايير أمن المعلومات (كشف كلمات المرور) |
| 74 | AR_CREDENTIAL_OVER_CHAT | BLOCK | critical | قوانين حماية البيانات + معايير أمن المعلومات (إرسال بيانات اعتماد عبر المحادثة أو تطبيقات المراسلة) |
| 75 | AR_OTP_SOLICITATION | BLOCK | critical | قوانين حماية البيانات + معايير أمن المعلومات (سرية رموز التحقق لمرة واحدة) |
| 76 | AR_MEDICAL_DATA | BLOCK | high | اللائحة التنفيذية 816/2025 (بيانات حساسة) / نظام حماية البيانات السعودي المادة 1 (البيانات الصحية) |
| 77 | AR_UNSAFE_MEDICAL_ADVICE | BLOCK | critical | نظام مزاولة المهن الصحية السعودي ولائحته التنفيذية |
| 78 | AR_CONTROLLED_SUBSTANCE | BLOCK | critical | نظام مكافحة المخدرات والمؤثرات العقلية السعودي؛ الهيئة العامة للغذاء والدواء |
| 79 | AR_SELF_HARM_IDEATION | BLOCK | critical | نظام الرعاية الصحية النفسية السعودي |
| 80 | SELF_HARM_RISK | BLOCK | critical | Joint Commission NPSG 15.01.01 (suicide risk); FDA / DEA dispensing rules (21 CFR 1306) |
| 81 | AR_SELF_HARM_NO_SUPPORT | BLOCK | critical | نظام الرعاية الصحية النفسية السعودي |
| 82 | SELF_HARM_NO_CRISIS_RESOURCE | BLOCK | critical | Joint Commission NPSG 15.01.01 (suicide risk) |
| 83 | AR_INTERPRETER_DENIAL | BLOCK | high | نظام مزاولة المهن الصحية السعودي |
| 84 | DISABILITY_ACCESS_DENIAL | BLOCK | high | Americans with Disabilities Act (ADA) — effective communication (auxiliary aids and services) |
| 85 | AR_GENETIC_UNDERWRITING | BLOCK | high | نظام حماية البيانات الشخصية السعودي |
| 86 | AR_PURCHASED_LIST_MARKETING | BLOCK | high | نظام الاتصالات وتقنية المعلومات |
| 87 | PURCHASED_LIST_MARKETING | BLOCK | high | Telephone Consumer Protection Act - 47 U.S.C. 227 |
| 88 | FCRA_ADVERSE_ACTION_CONCEALED | BLOCK | high | Fair Credit Reporting Act - 15 U.S.C. 1681 § 1681b |
| 89 | HOUSING_STATUS_DISCRIMINATION | BLOCK | high | Fair Housing Act (42 U.S.C. 3604) |
| 90 | STRUCTURING_ASSISTANCE | BLOCK | critical | Bank Secrecy Act - 31 U.S.C. 5324 (structuring transactions to evade reporting) |
| 91 | AR_STRUCTURING_ASSISTANCE | BLOCK | critical | نظام مكافحة غسل الأموال — تجزئة العمليات لتفادي الإبلاغ |
| 92 | CONCEALMENT_OFFER | HITL | high | Bank Secrecy Act - 31 U.S.C. 5318 (AML program, CDD, SAR) |
| 93 | MODEL_IDENTITY_MISMATCH | ALERT | low | Operational Compliance — AI system register accuracy |
| 94 | UNVERIFIED_TRANSFER_ACTION | HITL | critical | Bank Secrecy Act - 31 U.S.C. 5318 (AML program, CDD, SAR) |
| 95 | AUDIT_RECORD_DESTRUCTION_STATEMENT | BLOCK | critical | Operational Compliance — integrity of audit and monitoring records |
| 96 | SYSTEM_PROMPT_DISCLOSURE | BLOCK | high | Operational Compliance — confidentiality of the AI system configuration |
| 97 | FRAUD_CONTROL_DISCLOSURE | BLOCK | high | Operational Compliance — confidentiality of fraud and AML controls |
| 98 | CONFIDENTIAL_POLICY_DISCLOSURE | BLOCK | high | Operational Compliance — confidentiality of internal policies |
| 99 | UNDISCLOSED_COMMISSION | BLOCK | high | Operational Compliance — disclosure of commissions and conflicts of interest |
| 100 | CUSTOMER_RECORD_DELETION | HITL | critical | Operational Compliance — human approval before deleting customer records |
| 101 | LIMIT_CHANGE | HITL | critical | Operational Compliance — human approval before changing customer limits |
| 102 | HIDDEN_FEE_CONCEALMENT | BLOCK | high | Operational Compliance — disclosure of fees and charges |
| 103 | AUDIT_RECORD_DESTRUCTION | HITL | critical | Operational Compliance — integrity of audit and monitoring records |
| 104 | AR_SOFT_ENDORSEMENT | ALERT | medium | أنظمة العمل وحماية البيانات — موافقة الوكيل على طلب يمس فئة محمية أو بيانات طرف ثالث |
| 105 | UNAUTHORIZED_DISCLOSURE | BLOCK | critical | PDPL (personal data disclosure); Title VII §704(a) 42 U.S.C. §2000e-3(a) (retaliation) |
| 106 | SOFT_COMMITMENT_THIRD_PARTY | ALERT | medium | GLBA §6802; FTC Act §5 — commitment to retrieve or share a third party's data |
| 107 | DEVICE_IDENTIFIER_EXPOSURE | REDACT | high | Telecom subscriber data — CPNI / device identifiers (47 U.S.C. §222); أنظمة حماية البيانات الشخصية |
| 108 | CPNI_THIRD_PARTY_USAGE | BLOCK | critical | CPNI 47 U.S.C. §222; أنظمة حماية البيانات الشخصية وسرية الاتصالات |
| 109 | AR_LENDING_DISCRIMINATION | BLOCK | high | مبادئ وقواعد حماية عملاء المؤسسات المالية — البنك المركزي السعودي (ساما)، مبدأ المعاملة العادلة |
| 110 | AR_LABOR_RIGHTS_DENIAL | HITL | high | نظام العمل السعودي |
| 111 | LABOR_RIGHTS_DENIAL | HITL | high | FLSA 29 U.S.C. §206; state wage-payment laws |
| 112 | AR_DOB | ALERT | medium | قوانين حماية البيانات الخليجية/المصرية (بيانات تعريفية) |
| 113 | AR_KYC_BYPASS_SOLICITATION | BLOCK | critical | متطلبات مكافحة غسل الأموال وتمويل الإرهاب (KYC) — السعودية/الإمارات/مصر/قطر/الكويت/البحرين |
| 114 | AR_KYC_DEFERRAL | ALERT | low | متطلبات مكافحة غسل الأموال وتمويل الإرهاب (KYC) — التحقق من الهوية قبل التنفيذ |
| 115 | AR_UNAUTH_FINANCIAL_ACTION | ALERT | high | الأنظمة المصرفية وضوابط تنفيذ العمليات المالية والتفويض — إجراء مالي قبل التحقق من هوية العميل |
| 116 | THIRD_PARTY_ACCOUNT_DISCLOSURE | HITL | high | GLBA 15 U.S.C. §6802 (disclosure of nonpublic personal information to third parties) |
| 117 | IMPERSONATION | BLOCK | critical | FTC Impersonation Rule - 16 CFR Part 461 § 461.2 |
| 118 | IMPERSONATION_HUMAN_CLAIM | BLOCK | critical | Federal Trade Commission Act - 15 U.S.C. 45 |
| 119 | AR_IMPERSONATION_HUMAN_CLAIM | ALERT | high | لا توجد مادة محددة |
| 120 | UNVERIFIED_IDENTITY_DISCLOSURE | HITL | high | Identity verification before account access (KYC) |
| 121 | AR_ELDER_FINANCIAL_ABUSE | BLOCK | critical | حماية كبار السن من الاستغلال المالي — ضوابط التفويض على حسابات الغير |
| 122 | AR_EMPLOYMENT_DISCRIMINATION | BLOCK | high | نظام العمل السعودي — المادة 3 |
| 123 | GUARANTEE_WITH_ID_REQUEST | HITL | high | FTC Act Section 5 15 U.S.C. §45 |
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:
// 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"
};| Field | Type | Description |
|---|---|---|
| pattern | string (RegExp) | Regular expression source (no delimiters). Flags i and g are applied automatically. |
| violation_id | string | Unique machine-readable identifier. Appears in logs and dashboard. |
| law | string | The regulation this rule enforces — e.g. "HIPAA § 164.514", "GDPR Art. 9". |
| description | string | Human-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
Use when exposure of any kind is unacceptable.
\b\d{3}-\d{2}-\d{4}\bbare Social Security Number\b(?:4\d{12}(?:\d{3})?|5[1-5]\d{14})\bLuhn-valid card numbersUse when the response is still useful after masking the sensitive token.
\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\b(\+1[\s.-]?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}\bUS phone formatsUse when you need visibility but the data is low-risk or contextually acceptable.
MRN[:\s#]*\d{5,10}Medical Record Number reference\b[A-Z]\d{2}(?:\.\d{1,2})?\bICD-10 diagnostic codesHow to Add a Webhook
Send scan results from your agent infrastructure directly to Reglint.
Obtain your webhook secret
AGENT_MONITOR_SECRET. Store it as an environment variable in your agent host — never hard-code it.Configure the endpoint
https://www.reglint.ai/api/agent-monitor/webhookx-reglint-secret: <your-secret>Build the payload
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.Handle the response
{ "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 ?.
// 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 — 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 — 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
| Status | Meaning |
|---|---|
| 200 OK | Payload received and stored (or idempotent duplicate). |
| 400 Bad Request | Missing required fields: scan_id, customer_id, agent_name, or final_decision. |
| 401 Unauthorized | The x-reglint-secret header is missing or does not match. |
| 500 Internal Server Error | Unexpected 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.
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.
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: []
};
}
}delivered: false — show a generic error to the user.
delivered: true — serve redacted_output instead of the original.
delivered: true — serve redacted_output (any identifier stays masked; otherwise it equals the original). Compliance team is notified via email.
delivered: true — serve redacted_output (equals the original when nothing was masked). No violations found, no action needed.
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_decisionbefore 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_decisionbefore the activity that sends the message.
| Provider / Framework | Type | agent_name suggestion | Notes |
|---|---|---|---|
| OpenAI (GPT-4, GPT-3.5) | LLM | "gpt4o-agent" | Scan chat.completions response before returning to user. |
| Anthropic Claude | LLM | "claude-agent" | Scan message.content[0].text from Messages API. |
| Google Gemini | LLM | "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. |
| Mistral | LLM | "mistral-agent" | Mistral API or local — scan the text output. |
| Cohere | LLM | "cohere-agent" | Scan response.text from Co.generate or Co.chat. |
| LangChain | Framework | "langchain-chain" | Callback handler or a last runnable step that scans the final output — complete code in 9b. Framework recipes. |
| LlamaIndex | Framework | "llamaindex-query" | Wrap QueryEngine.query() response.response. |
| CrewAI | Framework | "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.
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.
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.
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.
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:
- Get your agent's raw output.
- POST it to the Reglint monitor endpoint with your API key.
- Check
final_decisionand enforce accordingly.
# 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'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.
# 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.
# 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 maskedEmail 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.
// 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
| Source | Recipients |
|---|---|
| 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.
// 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 — 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.
// 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
Critical violations — request was suppressed entirely
Sensitive data was masked in the response
Borderline issues flagged but response delivered
Default: all three when omitted.
severity_min — minimum severity threshold
criticalOnly critical violations (SSN, PHI, PCI, credentials)
highCritical + High (medical data, financial info, location)
mediumCritical + High + Medium (emails, phone numbers)
lowAll 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:
// 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:
// 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
What's in Each Alert Email
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.
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:
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.
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:
// 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):
// 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)| Priority | Source | Scope | Supports IGNORE? |
|---|---|---|---|
| 1 (highest) | Per-request rules_config | This scan only | No |
| 2 | default_action (body field) | All rules, this scan | No |
| 3 | DynamoDB customer config | All scans, this customer | Yes |
| 4 (lowest) | Reglint built-in default | Universal fallback | N/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 key | Applies to |
|---|---|
| en | All non-Arabic (Layer-1) rules |
| ar | All 13 Arabic Layer-1 rules |
| ar.sa · ar.ae · ar.eg · ar.qa · ar.kw · ar.bh | That country’s national-ID rule |
{
"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:
// 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.
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.
trueAuthenticated 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.
falseStandard mode (default)
All violations are active. PII exposure is blocked. This is the safe default for public-facing deployments.
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
{
"final_decision": "PASS",
"trusted_users_access": true,
"violations": [],
"metadata": {
"v3_dismissed_count": 3,
"scan_mode": "full"
}
}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 rule | Too 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
| Field | Values | Description |
|---|---|---|
| id | CP-001, CP-002 … | Auto-assigned sequential ID |
| rule | string ≤ 300 chars | Plain-language prohibition |
| action | BLOCK · REDACT · ALERT | Enforcement action when violated |
| applies_to | human · agent · both | Which actor type this rule targets |
| channels | null or channel array | null = all 8 channels; or restrict to a subset |
| enabled | true · false | Per-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
{
"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
}
]
}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).
| Mode | Who runs the agent | Use 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 · custom | The 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):
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_format | Body 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.
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:
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// 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 /chatLangGraph: 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.
{"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: اختبار أي وكيل.
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.
Install the Extension
Add Reglint to Chrome in under two minutes.
Install from the Chrome Web Store
Open Settings
Enter your API Key
rgl_… key in the API Key field. Get it from reglint.ai/settings/api-keys. Click Save Settings — the badge turns green (ON).Test the connection
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.
Supported Channels
Reglint intercepts outgoing messages on five platforms before they are sent.
mail.google.com
Intercepts Send button clicks and Ctrl/Cmd+Enter. Scans subject + body combined. Supports subject redaction.
outlook.live.com / outlook.office.com
Intercepts the Send button in the compose pane. Scans subject + body combined.
app.slack.com
Intercepts Enter key and Send button in message input boxes.
web.whatsapp.com
Intercepts Enter key and Send icon in the message composer.
linkedin.com
Intercepts message Send in Messaging and InMail compose windows.
How it works on every channel
- Employee clicks Send (or presses the keyboard shortcut).
- Reglint intercepts the action and shows a scanning spinner.
- The message text is sent to the Reglint API using the configured API key.
- If the scan passes, the message is sent normally.
- If a violation is detected, a compliance modal appears — employee can review, proceed with redaction, or cancel.
Device Settings
Settings stored on the employee's browser. Each employee configures these once.
API KeyrequiredYour personal or team rgl_… key from reglint.ai/settings/api-keys. Stored encrypted in Chrome sync storage.
e.g. rgl_abc123…API EndpointrequiredThe scan endpoint. Leave at the default unless your organisation self-hosts Reglint.
e.g. https://www.reglint.ai/api/monitor/scanEmployee Display Name / EmailoptionalOverride 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.comOn API ErroroptionalFail 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-openScan 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.
Admin Policy via Command Center
Admins set team compliance policy on each API key — no employee action required.
Go to Settings → API Keys
Settings → API Keys. Each key represents a team or department.Click "Edit Policy" on a key
Configure the policy
Policy Fields
| Field | Options | What it controls |
|---|---|---|
| Team Label | Any text | Human-readable name shown in violation logs and alerts. |
| Industry | healthcare · fintech · hr · privacy · general | Filters the per-rule table to show relevant rules and tells the scan engine which regulations to prioritise. |
| Scan Mode | fast · full | full (default) = rules + RAG + Claude (~5–6 s, contextual). fast = deterministic patterns only (IDs, IBANs, cards, credentials, contact data); behavioural violations need full. |
| Default Action | BLOCK · REDACT · ALERT | Blanket enforcement for all violations when no per-rule override exists. |
| Violation Behavior | block · warn-only · log-only | block = prevent send, show modal. warn-only = show modal, allow override. log-only = silent, no modal. |
| On API Error | fail-open · fail-closed | What happens when the Reglint API is unreachable. |
| Trusted Users Access | on / off | Allow the AI to share PII with authenticated users (fraud/sanctions still caught). |
| Per-Rule Overrides | BLOCK · REDACT · ALERT · IGNORE per rule | Override 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.
{
"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"
}
}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.
2Extension 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)
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
Rules engine on action args (fast + full mode)
rules_engine violation.LLM risk evaluation (full mode only)
Request example
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
{
"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"
}
]
}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.Human-in-the-Loop (HITL)
Hold high-risk output for a person to approve, reject, or edit before it is delivered.
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_alertsreceivers). It bypassesalert_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)
https://www.reglint.ai/api/agent-monitor/disposition-status?scan_id=<id>x-api-key: YOUR_API_KEYRead-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.
Set a HITL rule
The send is held
The extension polls (~6s)
Release on decision
Appian, Pega, UiPath, n8n and other low-code tools — two rules
- 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: Appiana!toJson(...), UiPath / Power Automate a JSON serialize step, Pega a JSON data transform. A dictionary printed as text ([agent_output: …]) or a bare string returns400 INVALID_JSON. - 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_errorisallowand the error is a 5xx or a timeout. Only a 200 withsafe_to_deliver: truereleases it.
Guide 2 — n8n (Wait + poll pattern)
For n8n workflows that scan agent output, then gate the delivery action on a human decision.
HTTP Request — Scan
/api/monitor/scan withmode: "full" and headerx-api-key.IF — is it held?
{{ $json.final_decision === 'ALERT_HITL' }}. False → deliver as normal. True → capture scan_id in a Set node.Wait → poll loop
hitl_status. Loop back to Wait while pending. Add a max-iteration guard (a sensible timeout) so the loop can't run forever.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).[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]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.
Scan → maybe held
/api/monitor/scan. A held response returns final_decision: "ALERT_HITL",safe_to_deliver: false, and ascan_id. Do not deliver — hold your action.Poll the status endpoint
/api/agent-monitor/disposition-status?scan_id=<id>with your x-api-key untilhitl_status leaves pending.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).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
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.
Create a Datadog API key
Set your Datadog site
datadoghq.com (US1, default), us5.datadoghq.com (US5), datadoghq.eu (EU). Reglint posts to https://http-intake.logs.<site>/api/v2/logs.Choose events + enable
Send a test event
scan_completed through the real delivery path and shows the HTTP result inline (Datadog returns 202 on success).Verify in Log Explorer
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:
{
"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://— plaintexthttp://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):
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
});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_reportedevent_id— UUID, stable dedupe keyoccurred_at— ISO-8601 timestampcustomer_id— your Reglint account id
scan_completed — a scan finished.
{
"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.
{
"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.
{
"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
}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 withregion: "ar"(set alone, it implies"ar"). Omit = all Arabic countries.
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:
{
"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 incited_passages."default_map"— the citation map designates the law / article for the class and country; no passage is claimed."none"withcitation_status: "unverified"— no article was verified (the law reads “no specific article”); passages retrieved without an article number are listed inretrieved_passagesfor 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 inframeworks. 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