For the complete documentation index, see llms.txt. This page is also available as Markdown.

Alinia

Hosted content-moderation and safety-detection API with configurable detection policies.

Sends a text input or a full conversation to the Alinia API, which runs whichever detections you enable via detection_config (e.g. {"security": True} for prompt-injection / data-exfiltration detection, plus safety, compliance, and hallucination policies) and reports per-category verdicts. Alinia's detection models are multilingual (its security model is trained on English, Spanish, and Catalan).

Verdict mapping: valid is True when Alinia does not flag the input. categories flattens Alinia's nested category_details into one entry per group/label — boolean details become triggered flags, numeric details become per-category score values. The top-level score is the highest numeric category score (higher = riskier), or None when the endpoint returns only booleans. explanation carries the recommendation text when the endpoint returns one (e.g. sensitive information), action carries a structured recommendation's action (e.g. "block"), and raw is the full response JSON.

Expected inputs: validate accepts either a plain string or a list of chat-message dicts ({"role": ..., "content": ...}), plus an optional model output and optional context_documents for detections that evaluate responses in context.

You must obtain an API key and the endpoint URL from Alinia, and pass them either directly to the constructor or via the ALINIA_API_KEY / ALINIA_ENDPOINT environment variables.

For more information, see:

Constructor

Parameter
Type
Required
Default
Description

detection_config

`str

dict[str, float

bool]

dict[str, dict[str, float

api_key

`str

None`

No

None

endpoint

`str

None`

No

None

metadata

`dict[str, Any]

None`

No

None

blocked_response

`dict[str, str]

None`

No

None

stream

bool

No

False

Whether to request a streaming API response. Defaults to False.

Initialize the Alinia guardrail with the provided configuration.

validate

Validate conversation or text input using the Alinia API.

This can be used for validation using any of the API endpoints provided by Alinia.

Parameters

Parameter
Type
Required
Default
Description

conversation

`str

list[dict[str, str]]`

Yes

output

`str

None`

No

None

context_documents

`list[str]

None`

No

None

Returns: GuardrailOutput

Benchmarks

No benchmark results recorded yet. See the benchmark methodology for how numbers are harvested (published) or measured and added.

License

  • Vendor: Alinia AI

  • Default license: proprietary (of the default model/service)

Last updated