Configuration

LINK2AI.Trust is configured through the Portal web interface. Each Project has its own module configuration and API keys.


API Keys

To authenticate with the Controller API you need an API key scoped to a project. Create one in the Portal under Settings → API Keys.

API Keys

Click Create a new API Key, enter a description, and copy the key immediately — it is shown only once.

Keys take the form l2-<key_id>-<secret> and are passed as a Bearer token (Analysis API) or in the LINK2AI_API_KEY header (proxy mode). See Authentication.


Models and Providers

Several LINK2AI.Trust features — including analysis modules, red teaming, and the playground — need to call an LLM on your behalf. You configure which LLM services are available to the platform through Providers and Models, both found under Settings → Models.

Providers

A provider represents an OpenAI-compatible API endpoint. Any service that exposes an OpenAI-compatible API (OpenAI, Azure OpenAI, Anthropic via compatibility layers, local models via Ollama, LM Studio, etc.) can be added as a provider.

Field Description
Name A display name for this provider (e.g., "OpenAI", "Azure EU", "Local Ollama")
Base URL The API endpoint, e.g., https://api.openai.com/v1
API Key The authentication token for the provider

To add a provider, go to Settings → Models and click Add Provider.

Models

A model ties a specific model identifier to a provider. You can add multiple models from the same provider.

Field Description
Name A display name shown in the UI (e.g., "GPT-4o mini")
Model ID The exact model identifier sent in API requests (e.g., gpt-4o-mini)
Provider Which provider this model belongs to

To add a model, go to Settings → Models, select a provider, and click Add Model.

Deleting a provider also removes all models associated with it.

Where Models Are Used

Configured models are available across all features that require an LLM:

  • Instruction Adherence module — the model used to evaluate whether the LLM followed its system prompt
  • Guardrails module — the model used to evaluate input and output guardrail conditions
  • Harmful Content module — selects the provider whose API is called for content classification
  • Red Teaming — the model used to generate adversarial test cases
  • Playground — the model used when running manual analysis requests

Each feature lets you select a specific model independently, so you can use a faster or cheaper model for analysis and a more capable model for red team generation.

Cache Embedding Provider

Under Settings → Project, you can optionally select a Cache Embedding Provider. This provider is used by the controller service to generate embeddings for semantic request caching.


Applications

An Application describes an LLM app you want to test and monitor. It is a reusable target referenced by Red Teaming, the Playground, and the Instruction Adherence module — define it once and select it wherever an application is needed.

Manage applications from the Applications entry in the sidebar. Click New Application to create one, or use the edit and delete actions on an existing card.

Common fields

Field Description
Name A display name for the application (e.g. "Coffee Sales Assistant").
Description What the application does. Used as context when generating red team attacks.
Type The kind of application: OpenAI-compatible API or Chatkit server.

OpenAI-compatible API

The application exposes an OpenAI-compatible chat completions endpoint.

Field Required Description
Model Yes The model the application uses, selected from the configured Models.
System Prompt No The system prompt the application runs with. This is the prompt evaluated by Instruction Adherence and probed by Red Teaming.
Temperature No Sampling temperature (0–2) used when calling the model.
Additional Parameters No Extra request parameters as a JSON object, e.g. {"max_tokens": 512}.

Chatkit server

The application runs a ChatKit-compatible server.

Field Required Description
Chatkit URL Yes The endpoint URL of the ChatKit server (e.g. http://example.com:8000/chatkit).

Deleting an application does not affect runs or configurations that already reference it.

Modules

Modules are the analysis units of LINK2AI.Trust. The module configuration pages display warnings and errors when the current settings are incomplete or incompatible — for example, if a model is required but none is configured. Errors prevent the module from running correctly; warnings indicate a degraded or unexpected configuration. Each module inspects the messages in a conversation and returns a result.

Module overview

Module ID Name Runs on Security module Default mode
usage Usage Input + Output No Monitoring
malicious_intent Malicious Intent Input only Yes Response
guardrails Guardrails Input + Output Yes Blocking
harmful_content Harmful Content Input + Output Yes Response
pii PII Detection Input + Output Yes Monitoring
secrets Secrets Detection Input + Output Yes Monitoring
adherence Instruction Adherence Output only Yes Monitoring

Security module: when flagged, contributes to the top-level secure: false in the response. Non-security modules (Usage) always have secure: null.

Runs on: determines which API endpoint triggers the module. analyzeInput runs Input and Input+Output modules. analyzeOutput runs Output and Input+Output modules.

Module modes

Every module can be set to one of four modes:

Mode Behavior
Disabled The module does not run.
Monitoring Runs in the background and stores results in the database. Results are never included in the API response — the module key will not appear in the results map. Use this for passive data collection.
Response Runs, stores results, and includes them in the API response.
Blocking Proxy mode only. If the module flags the interaction, the request is rejected with HTTP 403 before the LLM is called. Results are stored and returned in the 403 response body.

Usage

Tracks token counts, the full message list, and the model name. Not a security module — secure is always null.

Runs on: input and output (BASIC_METADATA)

Configuration

Field Type Default Description
mode string monitoring Module mode.
save_message_content bool true If false, messages are stored without their text content.

Result

{
  "input_tokens": 86,
  "output_tokens": 60,
  "messages": [
    { "role": "system", "content": "You are a helpful assistant for a car rental company." },
    { "role": "user", "content": "What is the capital of France?" },
    { "role": "assistant", "content": "I can only help with car rental questions." }
  ],
  "model": "gpt-4o-mini"
}

output_tokens is null when analyzing input only.


Instruction Adherence

Measures whether the LLM followed the instructions in the system prompt. The system prompt is decomposed into individual instructions and each one is evaluated against the LLM response.

Runs on: output only (OUTPUT_VALIDATION)

Configuration

Field Type Default Description
mode string monitoring Module mode.
pre_check_threshold float | null 0.9 Similarity threshold for the pre-check filter that skips full analysis on obviously unrelated inputs. Set to null to always run full analysis.
system_prompt_configs array [] List of system prompt configurations to evaluate. Each entry has name, system_prompt (the full prompt text), and parts (character-level spans marking which parts are instructions).
model string gpt-4.1-mini LLM used for adherence classification.
cache_similarity_threshold float | null null Cosine similarity threshold for returning a cached result instead of re-running analysis.

Result

{
  "system_prompt": "You are a helpful assistant for a car rental company.\nThe only available car brands are Ford and Toyota.\nNever talk about other topics than car rental.",
  "instruction_adherence": [
    {
      "content": "The only available car brands are Ford and Toyota.",
      "start": 54,
      "end": 103,
      "adherence": "noInstruction",
      "confidence": 0.91
    },
    {
      "content": "Never talk about other topics than car rental.",
      "start": 104,
      "end": 150,
      "adherence": "adhering",
      "confidence": 0.96
    }
  ]
}

adherence values

Value Meaning
adhering The LLM followed the instruction.
violating The LLM did not follow the instruction.
noInstruction This part of the system prompt is not an instruction (e.g. context-setting text).

Adherence Example


Guardrails

Evaluates custom boolean statements against the conversation. Each guardrail defines a statement and whether the input or output must or must not satisfy it.

Runs on: input and output (INPUT_OUTPUT_VALIDATION)

Configuration

Field Type Default Description
mode string blocking Module mode.
guardrails array [] List of guardrail definitions.
model string gpt-4o-mini LLM used for guardrail evaluation.
cache_similarity_threshold float | null null Cosine similarity threshold for cache reuse.

Each guardrail definition:

Field Type Description
statement string The statement to evaluate (e.g. "The response is in English").
type "input" | "output" Whether to evaluate against the user input or the LLM output.
mode "must" | "must_not" Whether the statement must be true or false.

Result

{
  "guardrails": [
    {
      "guardrail": "The assistant speaks like a pirate",
      "compliant": true,
      "confidence": 0.97
    }
  ]
}

secure is false if any guardrail is non-compliant.


Harmful Content

Classifies the conversation against the 14 hazard categories of Llama Guard 4, served in-process by vLLM (text only — image parts are ignored, which is also what makes category S14 available). The last turn is the one being judged: a user turn is classified as a prompt, an assistant turn as a response. The model's own chat template builds the safety prompt; the result keys are the MLCommons taxonomy names of the S1S14 codes it returns.

Every category the model reports as violated is scored with the model's confidence that the turn is unsafe, derived from the safe/unsafe token logprobs; all other categories score 0. secure is false when that confidence exceeds the configured threshold.

Runs on: input and output (INPUT_OUTPUT_VALIDATION)

Configuration

Field Type Default Description
mode string response Module mode.
threshold float 0.5 Score above which a flagged category is considered harmful.

The model itself is deployment configuration, not project configuration — see the environment variables below.

Result

{
  "categories": {
    "violent_crimes": 0.0,
    "non_violent_crimes": 0.0,
    "sex_related_crimes": 0.0,
    "child_sexual_exploitation": 0.0,
    "defamation": 0.0,
    "specialized_advice": 0.0,
    "privacy": 0.0,
    "intellectual_property": 0.0,
    "indiscriminate_weapons": 0.96,
    "hate": 0.0,
    "suicide_and_self_harm": 0.0,
    "sexual_content": 0.0,
    "elections": 0.0,
    "code_interpreter_abuse": 0.0
  }
}

Malicious Intent

Detects prompt injection and jailbreak attempts in user messages. Each message in the conversation is scored individually.

Runs on: input only (INPUT_VALIDATION)

Configuration

Field Type Default Description
mode string response Module mode.

Result

{
  "message_labels": [
    { "label": "SAFE", "score": 0.999 },
    { "label": "INJECTION", "score": 0.989 }
  ]
}

One entry per message in the conversation. label is either SAFE or INJECTION. secure is false if any message is labeled INJECTION.


PII Detection

Identifies personally identifiable information (PII) in messages using Microsoft Presidio. secure is false if any entity is detected.

Runs on: input and output (INPUT_OUTPUT_VALIDATION)

Configuration

Field Type Default Description
mode string monitoring Module mode.
score_threshold float 0.5 Minimum confidence score for an entity to be reported.
entities array of strings [] Entity types to detect. An empty list enables all supported types (e.g. PERSON, EMAIL_ADDRESS, PHONE_NUMBER, CREDIT_CARD, IBAN_CODE, IP_ADDRESS, LOCATION, NRP).
language string "en" Language of the input text.

Result

{
  "detected_entities": [
    {
      "entity_type": "EMAIL_ADDRESS",
      "score": 0.85,
      "start": 23,
      "end": 45,
      "text": "user@example.com"
    },
    {
      "entity_type": "PERSON",
      "score": 0.72,
      "start": 0,
      "end": 10,
      "text": null
    }
  ]
}

text contains the matched span if save_message_content is enabled on the Usage module, otherwise null.


Secrets Detection

Detects secrets and credentials in messages using Yelp detect-secrets. secure is false if any secret is detected.

Runs on: input and output (INPUT_OUTPUT_VALIDATION)

Configuration

Field Type Default Description
mode string monitoring Module mode.
detectors array of strings All detectors List of detector names to enable. Defaults to the full built-in set (AWS keys, GitHub tokens, OpenAI keys, JWT tokens, private keys, and more).
detector_configs object {"HexHighEntropyString": {"limit": 3.0}, "Base64HighEntropyString": {"limit": 4.5}} Per-detector configuration. Currently supports limit (entropy threshold for high-entropy detectors).

Result

{
  "detected_secrets": [
    {
      "secret_type": "AWS Access Key",
      "start": 12,
      "end": 32
    }
  ]
}

start and end are character offsets in the concatenated message text.

Built-in detectors

ArtifactoryDetector, AWSKeyDetector, AzureStorageKeyDetector, BasicAuthDetector, CloudantDetector, DiscordBotTokenDetector, GitHubTokenDetector, GitLabTokenDetector, IbmCloudIamDetector, IbmCosHmacDetector, JwtTokenDetector, KeywordDetector, MailchimpDetector, NpmDetector, OpenAIDetector, PrivateKeyDetector, PypiTokenDetector, SendGridDetector, SlackDetector, SoftlayerDetector, SquareOAuthDetector, StripeDetector, TelegramBotTokenDetector, TwilioKeyDetector


Overriding configuration per request

The configuration field on the analysis request body lets you override the project's saved module configuration for a single call. Only the modules you specify are overridden; the rest use their project defaults.

{
  "messages": [ ... ],
  "model": "gpt-4o-mini",
  "configuration": {
    "guardrails": {
      "mode": "response",
      "guardrails": [
        {
          "statement": "The user is asking about a topic outside of car rental",
          "type": "input",
          "mode": "must_not"
        }
      ]
    },
    "harmful_content": {
      "mode": "response",
      "threshold": 0.3
    }
  }
}