Security guide

Check requests before the model call

Configure checks for prompts, model outputs, and agent tool calls. LineMod can redact sensitive data, block disallowed actions, and record the result in the audit log.
Templates

Security policy levels

LineMod ships baseline templates. Set a default security template for your organization, then override it for individual API keys in Console.
strictMaximum scanning
Blocks high-risk prompts and outputs; recommended for regulated data.
standardBalanced default
Production baseline for most teams.
relaxedLower friction
For internal tools with trusted inputs. Security decisions are still logged.
offScanning disabled
Only when org policy explicitly allows; not recommended for production.
Pipeline

What runs on each request

StepCheckLogged detailOutcome
01
Prompt injectionDetect instructions that try to override application rules.
standard_policypass
02
PII maskingRedact sensitive values before upstream routing.
mask: card, emailredact
03
Tool accessBlock agent tool calls that policy does not allow.
tools: deny external_postblock
04
Output scanFlag XSS, malicious URLs, or policy violations.
X-LineMod-Output-Riskindexed
Recommended order
Inspect the prompt → redact sensitive data → check tool access → route to a provider → scan the model output → record the result with X-LineMod-Request-Id.
Keys

API key and header overrides

ConsolePin template per key
Separate production and staging keys with different defaults in API Keys.
HeaderPer-request override
Send X-LineMod-Security when org policy allows single-call tuning.
AgentTool approval tokens
Send X-LineMod-Tool-Approval when a tool call requires human approval.
Audit

Observability and review

Find blocked or redacted requests in Console Audit, along with the security decision and request ID.
Request IDX-LineMod-Request-Id
Input riskX-LineMod-Security-Risk
Output riskX-LineMod-Output-Risk
Console/console/security