@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— throwsPIIDetectedErroron first PII matchwarn— passes through unmodified, addspiiDetectedto 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
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, 500–504 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):
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.