Skip to main content
@complior/sdk accepts a MiddlewareConfig object at initialization. Every field is optional — sensible defaults are applied.

Core

PII / Sanitize

  • replace — redacts PII with labels like [PII:SSN], [PII:EMAIL], [PII:IBAN]
  • block — throws PIIDetectedError on first PII match
  • warn — passes through unmodified, adds piiDetected to metadata
See PII Detection for the full list of 50+ detectable types and checksum validators.

Disclosure

Bias Detection

The threshold depends on the active domain profile. See Bias Detection for domain-specific weights.

Safety Filter

Human-in-the-Loop Gate

See Safety & HITL for built-in rules and types.

Interaction Logging

Logs include provider, model, prompt/response hashes, token counts, latency, and compliance check results. Auto-rotates at 100 MB.

Runtime

RetryConfig

Retries apply to status codes 429, 500504 and network errors (ECONNREFUSED, ECONNRESET, ETIMEDOUT, EPIPE, EAI_AGAIN). Compliance errors (MiddlewareError subclasses) are never retried.

TOML File Configuration

Create .complior/proxy.toml for file-based configuration with hot-reload (100ms debounce):
Programmatic config takes precedence over file-based config on conflicts.

AgentConfig

AgentConfig extends MiddlewareConfig with passport enforcement fields. See Agent Mode for the full reference.

Agent Mode

Passport enforcement, budget, rate limits.

Advanced Features

Hot-reload, retry, streaming, logging.